fix(release-publish-oci): keep one Artifact block per release and surface np errors - #103
Merged
Merged
Conversation
…face np errors - Replace the '## Artifact' block instead of appending: every re-run rebuilds the image with a new digest, so the digest-based skip never matched and each backfill attempt left another block in the release. - Read the artifact id from .resource_id too; np returns it under that key, so releases said 'registered (id unavailable)'. - Print np's output when artifact create fails; the JSON error goes to stdout and was swallowed by the assignment under set -e.
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.
Qué pasó
Al publicar
services-dynamo-dbv0.3.0 el paso "Register artifact & finalize release" falló tres veces por configuración del repo (rol OIDC, variable, API key) antes de salir. Cada intento dejó la release así:## Artifacten el body, con cuatro digests distintos y tres con "registration failed". Solo el último era el real.Artifact ID: registered (id unavailable)aunquenpsí devolvió el id.Process completed with exit code 1, sin el motivo.Por qué
grepnunca matchea. Y el step corre con!cancelled(), o sea también cuando el registro falló..iden la salida denp artifact create, ynplo devuelve como.resource_id.npimprime el error como JSON por stdout. ConOUTPUT=$(np ...)bajoset -e, el step corta antes de llegar alecho "$OUTPUT"y el mensaje nunca aparece en el log. Lo reprodujimos localmente con una API key inválida:{"error": "{\"statusCode\":403,...}"}y exit 1.Qué cambia
## Artifact(el mismosedque ya usa el step de registro para armar el changelog) y se escribe el bloque actual una sola vez. El bloque siempre refleja la última corrida, que es la imagen que quedó en el tag de ECR, y un intento fallido se sobreescribe al reintentar..id // .resource_idal leer el id del artifact.|| { echo "$OUTPUT"; exit 1; }en la llamada anp, con un::error::para que el motivo quede en el log del step.Sin cambios de comportamiento para las corridas que hoy salen bien: un solo intento produce el mismo body que antes, ahora con el id real.
Caso de referencia
La release limpiada a mano: https://github.com/nullplatform/services-dynamo-db/releases/tag/v0.3.0. Los runs con el problema: 34385508954, 34385753809, 34386263560 (fallidos) y 34479106818 (ok) en ese repo.