You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the prompts I used to propagate changes and rebase the various feature PRs (#1692)
* Updates from trial run
After completing all the work the first time, make the following corrections.
* Experience with rebase prompt
Update this prompt based on what was learned rebasing the C# 9 prompts.
* Update prompts from experience
Update the prompts to match the experience in updating the V11 PRs.
Copy file name to clipboardExpand all lines: .github/prompts/post-meeting-propagate.prompt.md
+40-10Lines changed: 40 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ You are propagating the changes merged into the current "starting" draft branch
11
11
12
12
- The committee secretary has already merged all approved PRs into the starting branch (default: `draft-v8`). Do **not** merge any other open PRs.
13
13
- The `.github/workflows/update-on-merge.yaml` workflow will open an automated PR titled "Automated Section renumber and grammar extraction" on each branch that receives a push. These auto-PRs **must be merged** before the next propagation hop.
14
+
- Auto-PRs may show a `BLOCKED` merge state due to branch protection rules requiring review approval — this is normal and not a CI failure. Wait for checks to pass, then merge.
14
15
- You have `git` and `gh` available, and push permission to this repo.
15
16
16
17
## Propagation chain
@@ -19,17 +20,26 @@ Walk these branches in order. Each step merges the previous branch into the next
19
20
20
21
1.`draft-v8` (starting branch — no merge in; just merge its auto-PR)
21
22
2.`draft-v9` ← merges `draft-v8`
22
-
3.`v9-alpha` ← merges `draft-v9`
23
-
4.`draft-v10` ← merges `v9-alpha`
24
-
5.`v10-alpha` ← merges `draft-v10`
25
-
6.`draft-v11` ← merges `v10-alpha`
23
+
3.`alpha-v9` ← merges `draft-v9`
24
+
4.`draft-10`← merges `alpha-v9`
25
+
5.`alpha-v10` ← merges `draft-10`
26
+
6.`draft-v11` ← merges `alpha-v10`
26
27
7.`v11-alpha` ← merges `draft-v11`
27
28
8.`draft-v12` ← merges `v11-alpha`
28
29
29
-
> When new version branches are added (v12-alpha, draft-v13, etc.), append
30
-
> them here in the same pattern: each `draft-v(N+1)` merges `vN-alpha`, and
31
-
> each `vN-alpha` merges `draft-vN`. Also add the new branches to
30
+
> **Branch-naming is inconsistent across versions** (e.g. `alpha-v9` vs
31
+
> `v11-alpha`, `draft-10` vs `draft-v11`). Always verify actual branch
32
+
> names with `git branch -r | grep upstream/` before starting.
33
+
>
34
+
> When new version branches are added, append them here using the actual
35
+
> branch names on the remote. Also add any new branches to
"origin/$b" -- 'standard/*.md'| sed "s|^origin/$b:||" \
77
+
> /tmp/vnext-baseline-$b.txt ||true
67
78
done
68
79
```
69
80
@@ -107,6 +118,13 @@ Before starting, confirm the chain with the user and show which branches will be
107
118
prose in `standard/*.md`. Doing so can silently resurrect text the
108
119
committee deleted on the downstream branch in this cycle or a prior
109
120
one.
121
+
-**Never use `git checkout --theirs <file>` or `git checkout --ours <file>`**
122
+
to resolve conflicts — these commands replace the *entire file* with
123
+
one side, not just the conflicted hunks, silently discarding all
124
+
non-conflicting changes from the other side. Resolve each hunk
125
+
individually in the conflict markers instead. If you accidentally
126
+
run `checkout --theirs/--ours`, recover with `git checkout -m <file>`
127
+
to restore the conflict markers.
110
128
- For each conflicted hunk in `standard/*.md`:
111
129
a. Cross-check the hunk's file and line range against the deletion inventory captured in Pre-flight (`/tmp/starting-deletions.patch`) **and** against any prior `Post-meeting propagation:` merges on the downstream branch (`git log --grep '^Post-meeting propagation:' -p origin/<branch> -- <file>`).
112
130
b. If the downstream side intentionally removed the text, keep the deletion and re-apply only non-overlapping upstream edits to the surrounding region.
@@ -117,6 +135,14 @@ Before starting, confirm the chain with the user and show which branches will be
117
135
- the generated TOC in `standard/README.md`.
118
136
- For any conflict in `tools/`, `.github/`, or any prose conflict you are not 100% sure is mechanical: **abort the merge** and stop.
119
137
3. After conflicts are resolved (or if the merge was clean), **do not push yet**. Run Steps B.5 and B.6 below first.
138
+
4.**Section-number drift in alpha branches.** Alpha branches often have
139
+
additional sections inserted (e.g. new feature clauses), which shift
140
+
subsequent section numbers. When merging upstream changes into an alpha
141
+
branch, check for duplicate section headers (e.g. two `## 14.5` headings)
142
+
caused by the merge combining the upstream's numbering with the alpha's
143
+
shifted numbering. The StandardAnchorTags tool will crash with
144
+
`System.InvalidOperationException: Duplicate section header` if this
145
+
happens. Fix by renumbering the duplicated header to its correct value.
120
146
121
147
### Step B.5 — Cross-reference validation
122
148
@@ -127,7 +153,7 @@ Run the section-renumber tool in dry-run mode against the post-merge working tre
127
153
--owner dotnet --repo csharpstandard --dryrun )
128
154
```
129
155
130
-
1.**Broken references.** Any `TOC002` ("`<ref>` not found") diagnostic is a **hard stop**. Reset the merge commit (`git reset --hard origin/<branch>`), report the failing references to the user, and do not push.
156
+
1.**Broken references.** Any *new*`TOC002` ("`<ref>` not found") diagnostic that was not already present on `upstream/<branch>` before the merge is a **hard stop**. Compare the tool output against a pre-merge run (or `git stash && run && git stash pop`) to distinguish new from pre-existing. Pre-existing TOC002s from incomplete feature PRs on alpha branches are expected and should be reported but do not block the merge.
131
157
2.**Concept drift.** Count how many section numbers the dry run would change (lines beginning with `§` in the tool's diff output). If more than ~25 sections shift, sections have drifted enough that surviving cross-references like `§X.Y (Foo)` may now point at a different concept — the renumber tool fixes the *number* but cannot detect when the *concept* (parenthetical name, surrounding prose) is now wrong. Pause, list the affected references to the user, and proceed only on explicit confirmation.
132
158
3. The actual renumber/grammar regeneration runs in the auto-PR opened by `update-on-merge.yaml` after push (Step A on the next iteration); do not commit dry-run output.
133
159
@@ -138,11 +164,15 @@ against the Pre-flight baseline to surface anything new this propagation brought
3. If prior commits exist and the current PR head SHA introduces changes to those files not yet on `vN-alpha`, record P as **"alpha has stale version"**.
@@ -58,7 +58,11 @@ If `vN` is missing or unparseable from the comment, list the entry as unrouted a
58
58
59
59
### Step 1 — List target base branches
60
60
61
-
List target base branches (the propagation chain — see the propagate prompt). Default: `draft-v8 draft-v9 v9-alpha draft-v10 v10-alpha draft-v11 v11-alpha draft-v12`. Allow the user to override.
61
+
List target base branches (the propagation chain — see the propagate prompt). Default: `draft-v8 draft-v9 alpha-v9 draft-10 alpha-v10 draft-v11 v11-alpha draft-v12`. Allow the user to override.
62
+
63
+
> **Branch-naming is inconsistent across versions** (e.g. `alpha-v9` vs
64
+
> `v11-alpha`, `draft-10` vs `draft-v11`). Always verify actual branch
65
+
> names with `git branch -r | grep upstream/` before starting.
62
66
63
67
### Step 2 — For each base branch, list and process open PRs
64
68
@@ -72,20 +76,51 @@ gh pr list --base <base> --state open \
72
76
For each PR returned:
73
77
74
78
- If `headRepositoryOwner.login` matches this repo's owner (`dotnet`), the head is in this repo. **Rebase it:**
75
-
1.`gh pr checkout <num>`
79
+
1.`gh pr checkout <num>` — if this fails to fast-forward (branch has
80
+
diverged from upstream), run `git reset --hard upstream/<headRefName>`
81
+
to sync to the upstream version of the PR branch before proceeding.
76
82
2.**Capture the pre-rebase SHA** so we can recover if the post-rebase cross-reference check fails: `PRE=$(git rev-parse HEAD)`.
77
-
3.`git fetch origin <base>`
78
-
4.`git rebase origin/<base>`
79
-
5.**If the rebase has conflicts:**`git rebase --abort`, record the PR as "needs manual rebase", post the **attempted-rebase** comment below, and move on. Do not attempt to resolve feature-text conflicts.
83
+
3.`git fetch upstream <base>`
84
+
4.`git rebase upstream/<base>` — **use `upstream/`** (the main repo
85
+
remote), not `origin/`. The PR branches track `upstream`.
86
+
5.**If the rebase has conflicts:**
87
+
-**Binary conflicts** in `.github/workflows/dependencies/` (e.g.
88
+
`GrammarTestingEnv.tgz`): resolve by taking the PR's version
89
+
(`git checkout --theirs <file> && git add <file>`) and continue
90
+
the rebase. These are feature-specific test artifacts and the PR's
91
+
version is correct.
92
+
-**Formatting-only conflicts** in `standard/*.md` (e.g. table
93
+
pipe characters, smart-quote vs straight-quote differences):
94
+
take the PR's version (`git checkout --theirs <file> && git add
95
+
<file>`) and continue. The PR's formatting fix is the intended
96
+
change.
97
+
-**Independent additive conflicts** in `standard/*.md` (two
98
+
features each added text to the same list or paragraph, but the
99
+
additions are logically independent): combine both additions in
100
+
the correct order, resolve, and continue.
101
+
-**Structural/semantic conflicts** in `standard/*.md` (e.g.
102
+
grammar reorganization where the base refactored a production
103
+
hierarchy and the PR uses the old structure), or conflicts in
104
+
`tools/`: `git rebase --abort`, record the PR as "needs manual
105
+
rebase", and move on. Do not attempt to resolve conflicts that
106
+
require the author's design decision.
80
107
6.**Cross-reference check before push.** Run the renumber tool in dry-run mode against the rebased worktree:
81
108
82
109
```bash
83
110
( cd tools && dotnet run --project StandardAnchorTags -- \
84
111
--owner dotnet --repo csharpstandard --dryrun )
85
112
```
86
113
87
-
If any `TOC002` diagnostic fires, the rebase has produced broken cross-references. Recover with `git reset --hard "$PRE"`, record the PR as "needs manual rebase", and post the **attempted-rebase** comment below with the failing references quoted in the body. Do not push.
88
-
7. Otherwise: `git push --force-with-lease`. Record success with the new SHA.
114
+
If any *new*`TOC002` diagnostic fires that was not already present
115
+
on the PR branch before rebase, the rebase has introduced broken
116
+
cross-references. Recover with `git reset --hard "$PRE"`, record
117
+
the PR as "needs manual rebase", and move on. To distinguish new
118
+
from pre-existing: check the same ref against
119
+
`upstream/<headRefName>` (the pre-rebase state). Pre-existing
120
+
TOC002s from incomplete feature work are expected and do not block
- If the head is on a fork, **do not attempt to rebase.** Post the
91
126
**please-rebase** comment below. Avoid duplicate comments: skip if any existing comment on the PR already contains the marker `<!-- post-meeting-rebase-notice -->`.
0 commit comments