-
-
Notifications
You must be signed in to change notification settings - Fork 475
docs(agents): Fold pr.mdc into the create-java-pr skill #5936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+128
โ305
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # Stacked PRs | ||
|
|
||
| Stacked PRs split a large feature into small, easy-to-review PRs where each builds on the previous | ||
|
runningcode marked this conversation as resolved.
|
||
| one. The general mechanics are the standard [Graphite](https://graphite.dev/) stacking workflow โ | ||
| this file covers only what is specific to sentry-java. | ||
|
|
||
| ## Why a Collection Branch | ||
|
|
||
| ``` | ||
| main โ collection-branch โ stack-pr-1 โ stack-pr-2 โ stack-pr-3 โ ... | ||
| ``` | ||
|
|
||
| A **collection branch** is created from `main` and targets `main`. The first stack PR targets it | ||
| rather than `main`, and each later PR targets the previous stack PR's branch. | ||
|
|
||
| It exists because PRs targeting `main` are **squash**-merged, which causes repeated merge conflicts | ||
| when syncing a stack. Stack PRs are therefore **merge-committed** into the collection branch, and | ||
| only the collection branch is squash-merged into `main` at the end โ giving `main` one clean commit | ||
| for the whole feature. | ||
|
|
||
| Create it with an empty commit, so GitHub allows opening a PR: | ||
|
|
||
| ```bash | ||
| git commit --allow-empty -m "collection: <topic>" | ||
| ``` | ||
|
|
||
| Push it and open its PR against `main` right away โ it is the PR the whole stack is eventually | ||
| squash-merged through, and it carries the stack list like every other PR. Give it a plain title | ||
| (`<type>(<scope>): <Topic>`, no `[<Topic> <N>]` bracket) and no merge method reminder. | ||
|
|
||
| ## Rules That Will Destroy a Stack If Broken | ||
|
|
||
| **Never update the collection branch yourself.** Never merge, fast-forward, or push stack branch | ||
| commits into it. It stays at its initial position (the empty commit on `main`) until the user merges | ||
| stack PRs through GitHub one by one. Fast-forwarding it makes GitHub auto-merge and delete every | ||
| stack PR branch, destroying the entire stack. | ||
|
|
||
| **Never amend or force-push a stack branch.** No `git commit --amend`, `--force`, or | ||
| `--force-with-lease` on a branch that is part of a stack โ a force-push can cause GitHub to | ||
| auto-merge or auto-close the other PRs in the stack. If a commit needs fixing, add a fixup commit. | ||
|
|
||
| **Sync only between adjacent stack branches**, by merging forward โ never into the collection branch. | ||
| Prefer merge over rebase; only rebase if explicitly requested. | ||
|
|
||
| **Do not merge PRs.** Only the user merges them, bottom to top. | ||
|
|
||
| ## PR Title Naming | ||
|
|
||
| Include the topic name and a sequential number in brackets: | ||
|
|
||
| ``` | ||
| <type>(<scope>): [<Topic> <N>] <Subject> | ||
| ``` | ||
|
|
||
| Examples: | ||
| - `feat(core): [Global Attributes 1] Add scope-level attributes API` | ||
| - `feat(core): [Global Attributes 2] Wire scope attributes into LoggerApi and MetricsApi` | ||
|
|
||
| ## Stack List in PR Description | ||
|
|
||
| Every PR in the stack โ **including the collection branch PR** โ must have a stack list **at the top | ||
| of its description**, before the `## :scroll: Description` section. When a PR is added, update the | ||
| description on **all** PRs in the stack. The stack list is also how you enumerate a stack: read it | ||
| off any PR body rather than guessing from branch names, which may use different prefixes. | ||
|
|
||
| ```markdown | ||
| ## PR Stack (<Topic>) | ||
|
|
||
| - #5118 | ||
| - #5120 | ||
| - #5121 | ||
|
|
||
| --- | ||
| ``` | ||
|
|
||
| No status column โ GitHub already shows that. The `---` separates the stack list from the rest of | ||
| the description. | ||
|
|
||
| **Merge method reminder:** on stack PRs (not the collection branch PR), end the description with: | ||
|
|
||
| ```markdown | ||
| > โ ๏ธ **Merge this PR using a merge commit** (not squash). Only the collection branch is squash-merged into main. | ||
| ``` | ||
|
|
||
| Updating every PR's stack list means editing several descriptions โ follow the procedure in | ||
| `SKILL.md` ยง "Editing PR Descriptions". | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.