Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(blocks): Various block QoL improvements #8749

Merged
merged 91 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
857ae69
Add `Graph.on_update`, `Block.on_node_update`, `Block.on_node_delete`…
Pwuts Oct 16, 2024
2f405c3
Add credentials injection to `Graph.on_update` etc hooks
Pwuts Oct 17, 2024
921f614
Add webhooks and their links to nodes to DB schema
Pwuts Oct 17, 2024
946b35e
update webhooks db schema
Pwuts Oct 17, 2024
dfe36c1
Introduce `PLATFORM_BASE_URL` config attribute
Pwuts Oct 17, 2024
321ef9d
Add `WebhooksManager` base and GitHub implementation + graph lifecycl…
Pwuts Oct 17, 2024
f4ce0f4
Add webhook ingress endpoint
Pwuts Oct 17, 2024
40e846e
fix(blocks): Allow having an input and output pin with the same name
Pwuts Oct 19, 2024
6dc9e0c
fix bootstrapping issues
Pwuts Oct 19, 2024
ab5b336
hide input pins on webhook blocks
Pwuts Oct 20, 2024
41ccae7
dedup `generateInputHandles`
Pwuts Oct 20, 2024
a82acc7
refactor(backend): Make `RedisEventQueue` generic
Pwuts Oct 20, 2024
36b87eb
apply event type filter in webhook ingress endpoint
Pwuts Oct 21, 2024
13e6a75
add webhook ping endpoint
Pwuts Oct 21, 2024
f117d3f
hide `payload` input
Pwuts Oct 21, 2024
c604d27
fix graph creation
Pwuts Oct 21, 2024
34d82bf
fix enum usage
Pwuts Oct 21, 2024
98aed6d
smol cleanup
Pwuts Oct 21, 2024
9f37671
fix webhook resource string formatting
Pwuts Oct 21, 2024
e5c95f6
add debug stuff for webhooks
Pwuts Oct 21, 2024
5e995f9
fix webhook ingress URL
Pwuts Oct 21, 2024
aa12a5a
fix github events
Pwuts Oct 21, 2024
707df04
Merge branch 'dev' of github.com:Significant-Gravitas/AutoGPT into re…
majdyz Oct 24, 2024
5158b87
[Reduce code change size] Revert CreatableGraph/CreatableNode -> Grap…
majdyz Oct 24, 2024
5e70973
[Reduce code change size] Take Redis generic refactor out of the PR
majdyz Oct 24, 2024
6885fa8
Merge branch 'dev' into reinier/open-1961-implement-github-on-pull-re…
majdyz Oct 24, 2024
2734d83
Merge branch 'dev' of github.com:Significant-Gravitas/AutoGPT into re…
majdyz Oct 25, 2024
19b38fb
Fix frontend_base_url / platform_base_url clash
majdyz Oct 25, 2024
1a23591
Set default platform_base_url & fix agent output block bug
majdyz Oct 25, 2024
0343402
Fix CORS issue, make ValueError 400, toast saveAgent HTTP error
majdyz Oct 25, 2024
90d1fc7
Propagate clean error message from github error to user
majdyz Oct 26, 2024
dfeecf4
Propagate clean error message from github error to user
majdyz Oct 26, 2024
089b236
Merge branch 'dev' into reinier/open-1961-implement-github-on-pull-re…
majdyz Oct 27, 2024
1ebadb7
Merge branch 'dev' of github.com:Significant-Gravitas/AutoGPT into re…
majdyz Oct 27, 2024
35f044d
Lint
majdyz Oct 27, 2024
3e14f45
Merge remote-tracking branch 'origin/reinier/open-1961-implement-gith…
majdyz Oct 27, 2024
94d7567
Refactor to use new RedisEventBus
majdyz Oct 27, 2024
e9d1b1b
Skip webhook activation on no events
majdyz Oct 28, 2024
4b8cd25
Fix webhook changes breakage
majdyz Oct 28, 2024
2b45c28
Remove already done note
majdyz Oct 28, 2024
843d1cb
Unify channel name format
majdyz Oct 28, 2024
c357ea7
undo removing subgraph stuff
Pwuts Oct 28, 2024
57b532d
fix Node <-> Webhook reference and NodeModel usages
Pwuts Oct 29, 2024
9e0695f
smol clean
Pwuts Oct 29, 2024
02e952c
remove user auth middleware from webhook ingress endpoint
Pwuts Oct 29, 2024
d818af6
fix `add_execution` webhook mechanism
Pwuts Oct 29, 2024
4c68a1c
fix GitHub PR trigger block propagating output from base implementation
Pwuts Oct 29, 2024
e7dc870
move event output from base to PR trigger block
Pwuts Oct 30, 2024
5c82edc
Merge branch 'dev' into reinier/open-1961-implement-github-on-pull-re…
Pwuts Nov 4, 2024
dd446a7
change event filter input to a MultiSelect
Pwuts Nov 5, 2024
a525ce6
Merge branch 'dev' into reinier/open-1961-implement-github-on-pull-re…
Pwuts Nov 5, 2024
ca942cc
fix registration of pyro (de)serializers on `DatabaseManager`
Pwuts Nov 9, 2024
00882c0
format
Pwuts Nov 9, 2024
a573848
Merge branch 'dev' into reinier/open-1961-implement-github-on-pull-re…
Pwuts Nov 9, 2024
1de18a8
format frontend
Pwuts Nov 9, 2024
b1fac14
fix `NodeMultiSelectInput` click behavior
Pwuts Nov 9, 2024
d4c5e63
fix `NodeMultiSelectInput` scroll behavior
Pwuts Nov 9, 2024
ce56136
add docs for webhook-triggered blocks
Pwuts Nov 9, 2024
2a32b3b
fix collapsers?
Pwuts Nov 9, 2024
90418e0
docs: wording & formatting
Pwuts Nov 10, 2024
f40aef8
formatting
Pwuts Nov 11, 2024
8f708a2
fix code block titles
Pwuts Nov 11, 2024
35ffa09
add instruction to add event filter
Pwuts Nov 11, 2024
4048cc8
formatting
Pwuts Nov 11, 2024
060b1bc
Merge branch 'dev' into reinier/open-1961-implement-github-on-pull-re…
Pwuts Nov 12, 2024
b7c7028
fix pre-commit isort
Pwuts Nov 12, 2024
9e4f657
fix CI
Pwuts Nov 12, 2024
bdc3590
Merge branch 'dev' into reinier/open-1961-implement-github-on-pull-re…
Pwuts Nov 12, 2024
63a41f7
make `GithubPullRequestTriggerBlock` test an actual test
Pwuts Nov 13, 2024
865ac4b
address feedback
Pwuts Nov 13, 2024
fd0a3c2
add instructions for `PLATFORM_BASE_URL` to .env.example
Pwuts Nov 13, 2024
3ae2128
move github example payload
Pwuts Nov 15, 2024
5bb9e91
fix(backend): Add migrations to fix credentials inputs
Pwuts Nov 15, 2024
5ec5834
Merge branch 'dev' into reinier/open-1961-implement-github-on-pull-re…
Pwuts Nov 18, 2024
9e16e74
Merge branch 'dev' into reinier/open-1961-implement-github-on-pull-re…
Pwuts Nov 19, 2024
bc79d3b
Remove `ProviderName` enum
Pwuts Nov 19, 2024
4a5b783
Improve input descriptions and fix tooltips on GitHub Pull Request Tr…
Pwuts Nov 21, 2024
4c53eb3
Rename `sender` output to `triggered_by_user`
Pwuts Nov 21, 2024
7c0b336
Update description of `triggered_by_user`
Pwuts Nov 21, 2024
0f7fa4b
Fix description of `payload` output to be generic
Pwuts Nov 21, 2024
2dcbcfe
Add `pull_request_url` output
Pwuts Nov 21, 2024
397ae0b
Merge branch 'dev' into reinier/open-1961-implement-github-on-pull-re…
Pwuts Nov 21, 2024
8761c03
Remove webhooks before deleting credentials
Pwuts Nov 21, 2024
6eb643d
Prevent use of webhook system if `PLATFORM_BASE_URL` is not set
Pwuts Nov 21, 2024
4e4b254
feat: changes for QoL
ntindle Nov 24, 2024
5a8bc63
fix: type hinting and user hinting
ntindle Nov 24, 2024
46a1ee3
Merge branch 'dev' into ntindle/github-webhook-changes
ntindle Nov 25, 2024
777a793
Merge branch 'dev' into ntindle/github-webhook-changes
ntindle Nov 26, 2024
fe376d4
Discard changes to autogpt_platform/backend/backend/blocks/github/tri…
ntindle Nov 27, 2024
6a3042e
Merge branch 'dev' into ntindle/github-webhook-changes
ntindle Nov 27, 2024
371451c
Merge branch 'dev' into ntindle/github-webhook-changes
ntindle Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions autogpt_platform/backend/backend/blocks/github/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def _get_headers(credentials: GithubCredentials) -> dict[str, str]:
}


def get_api(credentials: GithubCredentials) -> Requests:
def get_api(credentials: GithubCredentials, convert_urls: bool = True) -> Requests:
return Requests(
trusted_origins=["https://api.github.com", "https://github.com"],
extra_url_validator=_convert_to_api_url,
extra_url_validator=_convert_to_api_url if convert_urls else None,
extra_headers=_get_headers(credentials),
)
24 changes: 19 additions & 5 deletions autogpt_platform/backend/backend/blocks/github/issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,27 @@ def __init__(self):
categories={BlockCategory.DEVELOPER_TOOLS},
input_schema=GithubCommentBlock.Input,
output_schema=GithubCommentBlock.Output,
test_input={
"issue_url": "https://github.com/owner/repo/issues/1",
"comment": "This is a test comment.",
"credentials": TEST_CREDENTIALS_INPUT,
},
test_input=[
{
"issue_url": "https://github.com/owner/repo/issues/1",
"comment": "This is a test comment.",
"credentials": TEST_CREDENTIALS_INPUT,
},
{
"issue_url": "https://github.com/owner/repo/pull/1",
"comment": "This is a test comment.",
"credentials": TEST_CREDENTIALS_INPUT,
},
],
test_credentials=TEST_CREDENTIALS,
test_output=[
("id", 1337),
("url", "https://github.com/owner/repo/issues/1#issuecomment-1337"),
("id", 1337),
(
"url",
"https://github.com/owner/repo/issues/1#issuecomment-1337",
),
],
test_mock={
"post_comment": lambda *args, **kwargs: (
Expand All @@ -70,6 +82,8 @@ def post_comment(
) -> tuple[int, str]:
api = get_api(credentials)
data = {"body": body_text}
if "pull" in issue_url:
issue_url = issue_url.replace("pull", "issues")
comments_url = issue_url + "/comments"
response = api.post(comments_url, json=data)
comment = response.json()
Expand Down
2 changes: 1 addition & 1 deletion autogpt_platform/backend/backend/blocks/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def parse_response(resp: str) -> tuple[dict[str, Any], str | None]:
class AITextGeneratorBlock(Block):
class Input(BlockSchema):
prompt: str = SchemaField(
description="The prompt to send to the language model.",
description="The prompt to send to the language model. You can use any of the {keys} from Prompt Values to fill in the prompt with values from the prompt values dictionary by putting them in curly braces.",
placeholder="Enter your prompt here...",
)
model: LlmModel = SchemaField(
Expand Down