Commit 092dcc0
committed
fix(ci): cut-release tombstone sync handles no-op substitution
The 'Sync plugin versions' step has two Python heredocs that rewrite
the version in tombstones/pypi/pyproject.toml and the heading in
tombstones/vscode/CHANGELOG.md. Both used 'if new_t == t' as the
sanity guard, which incorrectly fired whenever the substitution was
a byte-identical no-op — exactly what happens when the file is
authored directly at the target version (as the tombstones were for
v0.3.0 in PR #186).
Replace the post-substitution equality check with an explicit
pre-substitution anchor-presence check:
if not re.search(PATTERN, t, flags=re.MULTILINE):
raise SystemExit('::error::... anchor not found.')
new_t = re.sub(PATTERN, ..., t, count=1, flags=re.MULTILINE)
p.write_text(new_t, ...)
This correctly distinguishes 'regex anchor missed' (real bug; fail)
from 'anchor matched, value already at target' (legitimate; no-op
write is harmless because the workflow's downstream Update CHANGELOG
step always mutates CHANGELOG.md so the resulting commit is non-empty).
Failure surfaced by run 26608283472 (v0.3.0 first dispatch); the
release branch was not pushed because the failure happened before
Commit and push.1 parent f099947 commit 092dcc0
1 file changed
Lines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
148 | 146 | | |
149 | 147 | | |
150 | 148 | | |
| |||
0 commit comments