Skip to content

Commit

Permalink
fix: check if linear is enabled before showing blocks (#9338)
Browse files Browse the repository at this point in the history
<!-- Clearly explain the need for these changes: -->
Linear blocks show up even if oauth isn't configured

### Changes 🏗️
disables the linear blocks if oauth isn't configured

<!-- Concisely describe all of the changes made in this pull request:
-->

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  <!-- Put your test plan here: -->
  - [x] checked block list with and without oauth configured
  • Loading branch information
ntindle authored Jan 26, 2025
1 parent 479a847 commit 996efaf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions autogpt_platform/backend/backend/blocks/linear/comment.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from backend.blocks.linear._api import LinearAPIException, LinearClient
from backend.blocks.linear._auth import (
LINEAR_OAUTH_IS_CONFIGURED,
TEST_CREDENTIALS_INPUT_OAUTH,
TEST_CREDENTIALS_OAUTH,
LinearCredentials,
Expand Down Expand Up @@ -41,6 +42,7 @@ def __init__(self):
"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={
Expand Down
3 changes: 3 additions & 0 deletions autogpt_platform/backend/backend/blocks/linear/issues.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from backend.blocks.linear._api import LinearAPIException, LinearClient
from backend.blocks.linear._auth import (
LINEAR_OAUTH_IS_CONFIGURED,
TEST_CREDENTIALS_INPUT_OAUTH,
TEST_CREDENTIALS_OAUTH,
LinearCredentials,
Expand Down Expand Up @@ -44,6 +45,7 @@ def __init__(self):
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},
Expand Down Expand Up @@ -132,6 +134,7 @@ def __init__(self):
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,
Expand Down
2 changes: 2 additions & 0 deletions autogpt_platform/backend/backend/blocks/linear/projects.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from backend.blocks.linear._api import LinearAPIException, LinearClient
from backend.blocks.linear._auth import (
LINEAR_OAUTH_IS_CONFIGURED,
TEST_CREDENTIALS_INPUT_OAUTH,
TEST_CREDENTIALS_OAUTH,
LinearCredentials,
Expand Down Expand Up @@ -36,6 +37,7 @@ def __init__(self):
"term": "Test project",
"credentials": TEST_CREDENTIALS_INPUT_OAUTH,
},
disabled=not LINEAR_OAUTH_IS_CONFIGURED,
test_credentials=TEST_CREDENTIALS_OAUTH,
test_output=[
(
Expand Down
Empty file.

0 comments on commit 996efaf

Please sign in to comment.