Repository navigation
ci: cancel a superseded pull-request run, never a push run - #80
Merged
Merged
Conversation
The first CI run of every PR fails by design until Prepare commits the version bump. Grouping PR runs by number with cancel-in-progress cancels that run when the bump lands. Pushes and dispatches keep a group of their own (run_id), so a master release is never dropped or cancelled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xPA1vZ4n7nf2yeQmrNBib
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xPA1vZ4n7nf2yeQmrNBib
mkczarkowski
force-pushed
the
ci/pr-cancel-superseded
branch
from
October 6, 2026 07:49
87a3271 to
b05eab9
Compare
4 tasks done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Co
ci.ymldostajeconcurrencyna poziomie workflow:ci-pr-<numer>zcancel-in-progress: true. Nowy push do PR anuluje trwający run.ci-<run_id>, czyli unikalna, icancel-in-progress: false. Run na master nigdy nie zostanie anulowany ani porzucony jako oczekujący, więc release, który niesie, zawsze się wykona.Po co
Pierwszy run CI każdego PR pada z założenia:
version-bootstrapczeka, ażPrepare CLI versiondoda commitchore(release): prepare vX.Y.Z. W ostatnich 30 dniach mediana to 2 runy CI na PR, a w 21 z 37 PR-ów pierwszy był czerwony. Po tej zmianie taki run zostaje anulowany (szary) w chwili, gdy przychodzi commit bumpa, zamiast kończyć się czerwienią po ~1,8 min. Działa to też przy każdym szybkim drugim pushu.Bezpieczeństwo (warunki vg-orch)
Brak skutków ubocznych w anulowanym jobie. W
ci.ymljedyny krok związany z wersją toprepare-version.mjs --bootstrapwversion-bootstrap. Na tej ścieżce są tylko GET-y do API,git fetch, zapis lokalnego pliku i upload artefaktu, a token ma tylko odczyt. Zapisy (blob/tree/commit/PATCH ref) istnieją wyłącznie wpreparePullRequestwprepare-version.yml, którego ta zmiana nie dotyczy.preparedalej ma swoją grupę per PR bez cancel.Provenance bez zmian. Provenance przy merge (
loadPreparationForMerge) bierze tylko udane runy CIpull_requestz artefaktem dla scalonego heada. Ostatni run na tym headzie nie jest anulowany, a mniej runów odsuwa limitper_page=100.Slack.
notify-slackdziała tylko dlapushna master, to jedyny job z akcją Slacka. Anulowany run PR nic nie wysyła.Test kontraktu (
tests/release-workflow.test.ts) przypina:pull_request,concurrencyna poziomie jobów wci.yml,cancel-in-progress: falsewprepareipublish-npm,notify-slacki tylko dla push na master.Celowe zepsucie (
cancel-in-progress: true) daje 1 fail.Lokalnie przechodzą
actionlint, typecheck, lint i 945 testów.Pomiar
Na tym PR: pierwszy commit (
f06465a) uruchomił run 37426760520. Push drugiego commita w trakcie runu sprawił, że run został anulowany (06:57:53 → 06:58:36Z). Run 37426801750 na87a3271przeszedł na zielono.Preparenie dodał bumpu.Przed zmianą (np. #78): czerwony run 37421708721 na pierwszym commicie dobiegał do końca, a dopiero po nim przychodził zielony 37421752958.
Zachowania na master nie da się sprawdzić na PR. Po merge sprawdzić, czy dwa szybkie merge dają dwa pełne runy z release.
Wersja
Bez bumpu (
Preparenie dodał commita), merge nie publikuje npm.🤖 Generated with Claude Code
https://claude.ai/code/session_017xPA1vZ4n7nf2yeQmrNBib