Skip to content

[2.0] Preserve automation workflow inputs on update (backport #36076) - #36212

Merged
pmbrull merged 1 commit into
2.0from
backport/36076-to-2.0
Oct 26, 2026
Merged

pmbrull merged 1 commit into
2.0from
backport/36076-to-2.0

Conversation

@pmbrull

@pmbrull pmbrull commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Backport #36076 to 2.0.

Preserve the saved automation workflow request and workflowType during 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 uses 2.0's existing one-argument queryRunnerRequest helper.

No public issue was linked in the original PR; this backport uses the same skip-pr-checks metadata exemption.

Type of change:

  • Bug fix

High-level design:

Not applicable — small backport of the existing immutable-field fix; no schema or migration changes.

Tests:

Use cases covered

  • PUT, PATCH by ID, and PATCH by name retain the original execution inputs and trigger permissions.
  • Runner status and response updates still persist, including updates containing decrypted inputs.

Unit tests

  • WorkflowRepositoryUpdateTest: 6 passed.
  • WorkflowResourceDecryptTest: 1 passed.
  • JaCoCo: 100% line coverage of WorkflowRepository.WorkflowUpdater (8/8 lines).
mvn -B package -pl openmetadata-service -am -Dtest=WorkflowRepositoryUpdateTest,WorkflowResourceDecryptTest -Dsurefire.failIfNoSpecifiedTests=false -Dspring-boot.repackage.skip=true -Pstatic-code-analysis
mvn -B jacoco:report -pl openmetadata-service

Backend integration tests

  • WorkflowTriggerPermissionsIT: 16 passed, including all six backported update regressions.
  • WorkflowResourceIT: 21 passed.
  • MySQL + Elasticsearch: 37 tests, 0 failures, 0 errors, 0 skipped.

Local Java test run: PASSED

Commit: 2fffde28d82be5a69799f838a1ddcbc12429ea11 (base origin/2.0).

Step Scope Tests Failed Skipped Result
Unit WorkflowRepositoryUpdateTest, WorkflowResourceDecryptTest 7 0 0 Passed
Integration MySQL + Elasticsearch; WorkflowTriggerPermissionsIT, WorkflowResourceIT 37 0 0 Passed

The java_affected planner is not present on 2.0; these suites cover the workflow repository's REST callers. The full integration matrix was not run.

mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel -Dit.test=WorkflowTriggerPermissionsIT,WorkflowResourceIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false

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:

  • Read CONTRIBUTING.md.
  • Linked the original PR and retained cherry-pick provenance.
  • Included the original unit and integration regression tests, with the release-branch helper adaptation above.
  • mvn -B spotless:apply spotless:check -pl openmetadata-service,openmetadata-integration-tests passed; commit-time Java formatting hook passed; git diff --check passed.
  • Fresh-context self-review against REVIEW.md at 2fffde28d82be5a69799f838a1ddcbc12429ea11: fixed the test-helper signature mismatch; final review has no unanswered important findings.
  • Decision check: backports an existing fix; no new contract or design decision.
  • Schema migrations, ingestion tests, and UI recording are not applicable.

RetriggerView in GreptileConfidence Score: 4/5

The production fix appears sound, but the explicit Java requirements for the new test helpers must be satisfied before merging.

Findings

  1. P2 Test helpers break Java rules ▶

Summary

This backport preserves saved automation workflow inputs during PUT and PATCH updates.

  • Workflow updates keep each saved run tied to its original inputs.

Reviews (1) · Last reviewed commit: "fix: preserve automation workflow inputs" · Reviewed by Greptile

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)
@pmbrull
pmbrull requested a review from a team as a code owner October 26, 2026 08:08
@pmbrull
pmbrull removed the request for review from a team October 26, 2026 08:08
@pmbrull pmbrull added the skip-pr-checks Bypass PR metadata validation check label Oct 26, 2026
@pmbrull
pmbrull requested a review from IceS2 October 26, 2026 08:08
@pmbrull pmbrull added backend skip-pr-checks Bypass PR metadata validation check labels Oct 26, 2026
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 26, 2026
@gitar-bot

gitar-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
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 request and workflowType, while status, response, and description changes still persist. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

Comment on lines +310 to +314
if (method == WorkflowUpdateMethod.PUT) {
return fixture
.editor()
.getHttpClient()
.execute(HttpMethod.PUT, "/v1/automations/workflows", edit, Workflow.class);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Test helpers break Java rules

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!

@pmbrull
pmbrull merged commit ffbef75 into 2.0 Oct 26, 2026
120 of 143 checks passed
@pmbrull
pmbrull deleted the backport/36076-to-2.0 branch October 26, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant