Repository navigation
[2.0] Preserve automation workflow inputs on update (backport #36076) - #36212
Conversation
Triggers and runners read the saved execution inputs at separate times. Preserve those inputs across PUT and PATCH while allowing status and response updates. (cherry picked from commit 18f8ab8)
Code Review ✅ Approved🔴 High risk · Binding workflow type and request to their original values changes authorization and credential integrity; a regression could let edits redirect privileged runs or expose secrets. Backports the workflow update fix to 2.0 so PUT and PATCH requests preserve the saved automation VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
| if (method == WorkflowUpdateMethod.PUT) { | ||
| return fixture | ||
| .editor() | ||
| .getHttpClient() | ||
| .execute(HttpMethod.PUT, "/v1/automations/workflows", edit, Workflow.class); |
There was a problem hiding this comment.
The new editWorkflow helper returns from the PUT branch and again at the end. The Java guide requires one return statement at the end of each method. Assign the result in if/else, then return it once.
The guide also requires final on unchanged parameters and named constants for repeated strings. Apply those requirements to the new helper parameters and repeated strings such as "op" and "path". These repository requirements must be satisfied before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Describe your changes:
Backport #36076 to
2.0.Preserve the saved automation workflow
requestandworkflowTypeduring PUT and PATCH updates, while continuing to persist status, response, and description changes.Cherry-picked from
18f8ab82b6cd141ae40343e5726cfa5d63daa7a9. The production change and unit tests are unchanged. The integration test uses2.0's existing one-argumentqueryRunnerRequesthelper.No public issue was linked in the original PR; this backport uses the same
skip-pr-checksmetadata exemption.Type of change:
High-level design:
Not applicable — small backport of the existing immutable-field fix; no schema or migration changes.
Tests:
Use cases covered
Unit tests
WorkflowRepositoryUpdateTest: 6 passed.WorkflowResourceDecryptTest: 1 passed.WorkflowRepository.WorkflowUpdater(8/8 lines).Backend integration tests
WorkflowTriggerPermissionsIT: 16 passed, including all six backported update regressions.WorkflowResourceIT: 21 passed.Local Java test run: PASSED
Commit:
2fffde28d82be5a69799f838a1ddcbc12429ea11(baseorigin/2.0).The
java_affectedplanner is not present on2.0; these suites cover the workflow repository's REST callers. The full integration matrix was not run.Ingestion integration tests
Not applicable — no ingestion changes.
Playwright (UI) tests
Not applicable — no UI changes.
Manual testing performed
No separate manual run. The automated REST regressions create a test-connection workflow, attempt to retarget its connection or switch its type through each update API, fetch the persisted workflow, and verify the original inputs, stored credentials, result updates, and trigger authorization.
UI screen recording / screenshots:
Not applicable — backend-only fix.
Checklist:
CONTRIBUTING.md.mvn -B spotless:apply spotless:check -pl openmetadata-service,openmetadata-integration-testspassed; commit-time Java formatting hook passed;git diff --checkpassed.REVIEW.mdat2fffde28d82be5a69799f838a1ddcbc12429ea11: fixed the test-helper signature mismatch; final review has no unanswered important findings.The production fix appears sound, but the explicit Java requirements for the new test helpers must be satisfied before merging.
Findings
Summary
This backport preserves saved automation workflow inputs during PUT and PATCH updates.
Reviews (1) · Last reviewed commit: "fix: preserve automation workflow inputs" · Reviewed by Greptile