Prompt file imported from bmwieczorek/my-apache-beam-dataflow (
.github/prompts/my-upgrade-beam-no-itests-rca-fix-flaky-tests.prompt.md). Copyright stays with the author.
Run the full upgrade workflow autonomously in non-interactive mode with these overrides and instructions:
Workflow Overrides
- Skip Step 5 (Integration Tests): Do NOT run integration tests. Execute steps 1 → 2 → 3 → 4 → 6 (skip itest).
Flaky Test Handling (Step 4 — Unit Tests)
If any unit tests fail:
- Analyze the root cause in detail (not just the stack trace — explain WHY it fails: API change, behavioral change, timing issue, dependency conflict, etc.).
- Determine how to reproduce the failure reliably.
- Attempt to fix the code or test so it passes — do NOT exclude/skip the test.
- Re-run unit tests to confirm the fix works.
If a test cannot be fixed automatically:
- Do NOT skip or
@Ignoreit. - STOP the workflow — do NOT proceed to Step 6 (commit).
- In the final output, include a detailed root cause analysis
for each unfixed test with ALL of the following:
- Test class and method name
- Error message and relevant stack trace excerpt
- Root cause explanation — why the test fails after the upgrade (e.g. "Beam 2.x changed the default coder for X", "API method Y was deprecated and removed").
- Suggested fix — concrete steps or code changes the user can apply manually to resolve the failure.
- Upstream references — links to relevant Beam JIRA issues, release notes, or migration guides if applicable.
- Then skip to the Final Output section and report the workflow as FAILED at Step 4.
Upfront Decisions (no prompts)
- Commit (Step 6): YES — commit ALL changes locally to the
upgrade branch, including
pom.xmlversion updates AND any flaky test fixes (e.g. modified test source files). Stage all changed files withgit add -Aand create a single commit with a message summarizing both the dependency upgrades and the test fixes (e.g. "Upgrade Apache Beam to 2.x.0 and fix flaky tests"). Only reached if ALL unit tests pass (fixed or otherwise). - Major version bumps: SKIP — only apply minor/patch upgrades. Keep current version for any major version change.
- Alpha/Beta/RC versions: SKIP — use latest stable only.
- Do NOT ask for any user confirmation at any step. Proceed autonomously with these defaults throughout the entire workflow.
Pre-Commit Summary (before Step 6)
After all tests pass and BEFORE executing the commit (Step 6), print a complete summary of all changes to the screen:
-
Dependency changes table — for every dependency or plugin whose version changed in
pom.xml, show:Artifact Old Version New Version Change Type example:artifact 1.0.0 1.1.0 minor -
Flaky test fixes — for each test that was fixed, show:
- Test class and method name
- Root cause (why it failed)
- What was changed to fix it
-
Unfixed test failures — for each test that could NOT be fixed automatically, show:
- Test class and method name
- Error message and relevant stack trace excerpt
- Root cause explanation
- Suggested manual fix (concrete code changes or steps)
- Upstream references (Beam JIRA, release notes, migration guides)
-
Full
git diff— rungit diffand print the complete output so all pending changes are visible before they are committed.
Final Output
After the workflow completes (success or failure), print ALL of the following to the screen:
-
Workflow summary table — all 6 steps with PASSED/FAILED/SKIPPED status.
-
Dependency changes table — for every dependency or plugin whose version changed, show:
Artifact Old Version New Version Change Type org.apache.beam:beam-sdks-java-core 2.x.0 2.y.0 minor Include Maven plugins in the same table.
-
Code changes summary — list every file modified and what was changed (e.g. "pom.xml: updated 12 dependency versions", "src/test/java/…Test.java: fixed assertion for new API").
-
Unfixed test failures — if any tests could NOT be fixed automatically, show for each:
- Test class and method name
- Error message and relevant stack trace excerpt
- Root cause explanation (why it fails after the upgrade)
- Suggested manual fix (concrete code changes or steps)
- Upstream references (Beam JIRA, release notes, migration guides)
-
Full
git diff— rungit diffand print the complete output so the user can see exactly what changed in the codebase.