Repository navigation
fix(webhook): align ToolFile owner with Trigger EndUser for multipart uploads - #42988
Closed
leilei3167 wants to merge 2 commits into
Closed
leilei3167 wants to merge 2 commits into
leilei3167 wants to merge 2 commits into
Conversation
leilei3167
requested review from
CourTeous33,
QuantumGhost and
laipz8200
as code owners
September 26, 2026 16:23
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-09-26 20:21:18.310439991 +0000
+++ /tmp/pyrefly_pr.txt 2026-09-26 20:21:09.838363349 +0000
@@ -6709,27 +6709,27 @@
ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
--> tests/unit_tests/services/test_webhook_service.py:552:79
ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:794:88
+ --> tests/unit_tests/services/test_webhook_service.py:804:88
ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:821:83
+ --> tests/unit_tests/services/test_webhook_service.py:831:83
ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:841:83
+ --> tests/unit_tests/services/test_webhook_service.py:851:83
ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:859:86
+ --> tests/unit_tests/services/test_webhook_service.py:869:86
ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:878:91
+ --> tests/unit_tests/services/test_webhook_service.py:888:91
ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:900:86
+ --> tests/unit_tests/services/test_webhook_service.py:910:86
ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:919:86
+ --> tests/unit_tests/services/test_webhook_service.py:929:86
ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:937:91
+ --> tests/unit_tests/services/test_webhook_service.py:947:91
ERROR Argument `dict[str, str | dict[str, str]]` is not assignable to parameter `webhook_data` with type `RawWebhookDataDict` in function `services.trigger.webhook_service.WebhookService._validate_http_metadata` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service_additional.py:249:57
+ --> tests/unit_tests/services/test_webhook_service_additional.py:261:57
ERROR Argument `dict[str, dict[str, int] | dict[str, str]]` is not assignable to parameter `webhook_data` with type `RawWebhookDataDict` in function `services.trigger.webhook_service.WebhookService.build_workflow_inputs` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service_additional.py:261:55
+ --> tests/unit_tests/services/test_webhook_service_additional.py:273:55
ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service_additional.py:273:65
+ --> tests/unit_tests/services/test_webhook_service_additional.py:285:65
ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
--> tests/unit_tests/services/test_workflow_collaboration_service.py:25:56
ERROR Argument `list[int | str]` is not assignable to parameter `mentioned_user_ids` with type `Sequence[str]` in function `services.workflow_comment_service.WorkflowCommentService._filter_valid_mentioned_user_ids` [bad-argument-type]
|
Contributor
Pyrefly Type Coverage
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #42988 +/- ##
==========================================
- Coverage 88.07% 88.05% -0.02%
==========================================
Files 5308 5151 -157
Lines 327512 323369 -4143
Branches 66277 65169 -1108
==========================================
- Hits 288443 284732 -3711
+ Misses 33685 33253 -432
Partials 5384 5384
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
6 tasks done
Contributor
Author
|
Closing this. The branch is conflicted, the patch check is red, and there has been no review. Thank you for the time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #42987
Summary
Webhook multipart uploads created
ToolFilerows withuser_id=webhook_trigger.created_by(the workflow owner account). Async webhook runs execute as a TriggerEndUser, so file access checks could not find those uploads (ToolFile not found)._create_file_from_binary()now resolves the same TriggerEndUserused bytrigger_workflow_execution()and stores uploaded files under that identity.Testing
pytest -o addopts= tests/unit_tests/services/test_webhook_service_additional.py::TestWebhookServiceExtractionFallbacks::test_create_file_from_binary_should_call_tool_file_manager_and_file_factoryfails onmain(expects Trigger EndUser id, code used account id).pytest -o addopts= tests/unit_tests/services/test_webhook_service.py tests/unit_tests/services/test_webhook_service_additional.py— 75 passed.Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint gods