Skip to content

fix(skill): Detect stacked PR context from branch#5223

Open
adinauer wants to merge 4 commits intomainfrom
feat/create-java-pr-stack-detection
Open

fix(skill): Detect stacked PR context from branch#5223
adinauer wants to merge 4 commits intomainfrom
feat/create-java-pr-stack-detection

Conversation

@adinauer
Copy link
Copy Markdown
Member

📜 Description

Improve the local create-java-pr skill so it determines whether to run in standalone or stacked PR mode from git context.

The skill now checks the current branch and existing PR relationships to infer stack context, instead of relying on manual prompting.

💡 Motivation and Context

When the workflow starts on main, it should default to a normal PR against main and not accidentally assume stacked PR behavior.

This change makes that default explicit and still allows stacked mode when the user asks for it.

💚 How did you test it?

  • Ran ./gradlew spotlessApply apiDump successfully (using JDK 17 locally)
  • Verified the updated skill content and git diff

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

  • Use the updated skill in future PR prep flows and refine heuristics if new branch patterns appear.

#skip-changelog

Update the create-java-pr skill to infer standalone vs stacked PR mode\nfrom git branch and existing PR relationships.\n\nWhen running on main/master, default to standalone PR mode and only\nenter stack mode when explicitly requested by the user.\n\nCo-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 23, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@sentry
Copy link
Copy Markdown

sentry bot commented Mar 23, 2026

Sentry Build Distribution

App Name App ID Version Configuration Install Page
SDK Size io.sentry.tests.size 8.37.1 (1) release Install Build

@adinauer adinauer marked this pull request as ready for review March 23, 2026 15:23
adinauer and others added 2 commits March 25, 2026 06:38
Check for downstream PRs even when the current branch already has a PR targeting main/master.

This prevents collection branches in a stacked PR flow from being misclassified as standalone PR context.

Co-Authored-By: Claude <noreply@anthropic.com>
When downstream PRs are found for a branch, classify the result as an existing stack flow instead of an undefined "stack base context".

Clarify that the next PR in an existing stack can target either the previous stack PR branch or the collection branch, so all detection outcomes map to actionable PR types.

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

…nches

The decision tree in create-java-pr Step 0 had a gap: when a non-main
branch has no existing PR and no downstream PRs target it, no outcome
was specified. This is the most common case (fresh feature branch).

Add explicit fallback to standalone PR context, matching the behavior
of the parallel branch where a PR exists with base main and no
downstream PRs.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants