AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix: check if linear is enabled before showing blocks (#9338)
Nicholas Tindle996efaf4fcba
diff --git a/autogpt_platform/backend/backend/blocks/linear/comment.py b/autogpt_platform/backend/backend/blocks/linear/comment.pyindex ea2ff1e613..6789fd12e3 100644--- a/autogpt_platform/backend/backend/blocks/linear/comment.py+++ b/autogpt_platform/backend/backend/blocks/linear/comment.py@@ -1,5 +1,6 @@from backend.blocks.linear._api import LinearAPIException, LinearClientfrom backend.blocks.linear._auth import (+ LINEAR_OAUTH_IS_CONFIGURED,TEST_CREDENTIALS_INPUT_OAUTH,TEST_CREDENTIALS_OAUTH,LinearCredentials,@@ -41,6 +42,7 @@ class LinearCreateCommentBlock(Block):"comment": "Test comment","credentials": TEST_CREDENTIALS_INPUT_OAUTH,},+ disabled=not LINEAR_OAUTH_IS_CONFIGURED,test_credentials=TEST_CREDENTIALS_OAUTH,test_output=[("comment_id", "abc123"), ("comment_body", "Test comment")],test_mock={diff --git a/autogpt_platform/backend/backend/blocks/linear/issues.py b/autogpt_platform/backend/backend/blocks/linear/issues.pyindex 4c2c3ffa09..ff99c70e67 100644--- a/autogpt_platform/backend/backend/blocks/linear/issues.py+++ b/autogpt_platform/backend/backend/blocks/linear/issues.py@@ -1,5 +1,6 @@from backend.blocks.linear._api import LinearAPIException, LinearClientfrom backend.blocks.linear._auth import (+ LINEAR_OAUTH_IS_CONFIGURED,TEST_CREDENTIALS_INPUT_OAUTH,TEST_CREDENTIALS_OAUTH,LinearCredentials,@@ -44,6 +45,7 @@ class LinearCreateIssueBlock(Block):super().__init__(id="f9c68f55-dcca-40a8-8771-abf9601680aa",description="Creates a new issue on Linear",+ disabled=not LINEAR_OAUTH_IS_CONFIGURED,input_schema=self.Input,output_schema=self.Output,categories={BlockCategory.PRODUCTIVITY, BlockCategory.ISSUE_TRACKING},@@ -132,6 +134,7 @@ class LinearSearchIssuesBlock(Block):description="Searches for issues on Linear",input_schema=self.Input,output_schema=self.Output,+ disabled=not LINEAR_OAUTH_IS_CONFIGURED,test_input={"term": "Test issue","credentials": TEST_CREDENTIALS_INPUT_OAUTH,diff --git a/autogpt_platform/backend/backend/blocks/linear/projects.py b/autogpt_platform/backend/backend/blocks/linear/projects.pyindex 9d33b3f77b..695064a6a1 100644--- a/autogpt_platform/backend/backend/blocks/linear/projects.py+++ b/autogpt_platform/backend/backend/blocks/linear/projects.py@@ -1,5 +1,6 @@from backend.blocks.linear._api import LinearAPIException, LinearClientfrom backend.blocks.linear._auth import (+ LINEAR_OAUTH_IS_CONFIGURED,TEST_CREDENTIALS_INPUT_OAUTH,TEST_CREDENTIALS_OAUTH,LinearCredentials,@@ -36,6 +37,7 @@ class LinearSearchProjectsBlock(Block):"term": "Test project","credentials": TEST_CREDENTIALS_INPUT_OAUTH,},+ disabled=not LINEAR_OAUTH_IS_CONFIGURED,test_credentials=TEST_CREDENTIALS_OAUTH,test_output=[(diff --git a/autogpt_platform/backend/backend/blocks/linear/triggers.py b/autogpt_platform/backend/backend/blocks/linear/triggers.pydeleted file mode 100644index e69de29bb2..0000000000