Skip to content

fix(ci): waiver obsoleto e achado proprio, nao "esqueceu de bumpar" - #134

Merged
fabianocruz merged 1 commit into
mainfrom
fix/publish-drift-stale-waiver-message
Sep 6, 2026
Merged

fix(ci): waiver obsoleto e achado proprio, nao "esqueceu de bumpar"#134
fabianocruz merged 1 commit into
mainfrom
fix/publish-drift-stale-waiver-message

Conversation

@fabianocruz

Copy link
Copy Markdown
Member

Correcao pequena no guarda que entrou no #133, achada rodando ele contra o caso que ele vai encontrar de verdade: alguem bumpa o @codespar/sdk para fechar a core#131 e esquece o waiver.

O defeito

Cenario reproduzido, guarda do main em 4f6d21c:

$ sed -i 's/"version": "0.11.0"/"version": "0.12.0"/' packages/core/package.json
$ node scripts/check-publish-drift.mjs --only @codespar/sdk
✗ @codespar/sdk@0.12.0 — 0.12.0 is not on the registry, so the waiver in
  scripts/publish-drift-baseline.json (pinned to 0.11.0) is stale — delete it

::error::1 package(s) changed without a version bump: @codespar/sdk@0.12.0.
  npm versions are immutable — republishing over them is impossible ...

A linha por pacote esta certa. A anotacao ::error::, que e o que o GitHub mostra em cima do job e no diff, diz "changed without a version bump" sobre um pacote que acabou de ser bumpado corretamente. Quem le so a anotacao e mandado consertar exatamente a unica coisa que ja estava certa.

Sao duas falhas diferentes com consertos opostos: uma quer uma versao, a outra quer uma linha deletada. Estavam saindo com a mesma etiqueta.

O que mudou

Waiver obsoleto passa a ter status proprio, stale-waiver, e linha de resumo propria. As duas continuam reprovando o build.

$ node scripts/check-publish-drift.mjs --only @codespar/sdk
✗ @codespar/sdk@0.12.0 — ... the waiver ... (pinned to 0.11.0) is stale — delete it

::error::1 stale waiver(s) in scripts/publish-drift-baseline.json:
  @codespar/sdk@0.12.0. These packages no longer match the state their waiver
  was written for — the fix is to delete the waiver entry, not to change a version.
$ echo $?
1

Controles

Teste novo: does not tell a correctly bumped package that it forgot to bump. Ele exige que os dois status difiram e que a mensagem do bumpado nao contenha bump the version.

Nao-vacuidade, por mutacao: revertendo stale-waiver para drift no guarda, 3 testes morrem, incluindo o novo.

$ node --test scripts/check-publish-drift.test.mjs   # com a mutacao
ℹ tests 11 / ℹ pass 8 / ℹ fail 3
  ✖ fails as stale once the package is bumped
  ✖ fails as stale once the drift is gone
  ✖ does not tell a correctly bumped package that it forgot to bump

Restaurado: 11/11 passam. O guarda completo no estado do main continua saindo 0, com os mesmos 2 waived e 12 identical.

Comportamento inalterado nos outros caminhos, medido: drift real continua drift e continua reprovando; waiver removido sem bump continua reprovando como drift; bump com waiver removido passa.

Nao fecha issue. Ajusta o guarda do #133.

Found by running the guard through the case it will actually meet: someone
bumps @codespar/sdk to close core#131 and leaves the waiver behind.

The per-package line was right ("the waiver is stale, delete it") but the
::error:: annotation that GitHub surfaces said "1 package(s) changed without
a version bump: @codespar/sdk@0.12.0" — about a package that had just been
bumped correctly. A reader who sees only the annotation is sent to fix the
one thing that is already right.

Stale waivers now carry status "stale-waiver" and their own summary line.
Both still fail the build; they no longer claim to be the same finding, and
the two fixes are opposites: one wants a version, the other wants a deleted
line.

Co-Authored-By: Claude Opus 5 (1M context) <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.

1 participant