fix(ci): release-format consistency and npm publish verification#34
Merged
fix(ci): release-format consistency and npm publish verification#34
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #33
This was referenced May 5, 2026
Addresses issue #33 across all four pipelines (JS/Rust/Python/C#). JavaScript false-positive publish (run 25288053638): publish-to-npm.mjs now retries the registry verification with exponential backoff and pre-checks the registry before re-running `changeset publish`, so npm CDN propagation lag no longer surfaces a `##[error]` annotation in a green run. Release format: added a small `release-format-helpers` module per language (helpers inline in Python). All four `create-github-release` scripts now produce `[Language] X.Y.Z` titles, append a registry shields.io badge if the body lacks one, and use `lang_v` tag prefixes. The C# script previously had no `gh` exit-code check at all; it now fails honestly and treats `already_exists` as idempotent. Workflows: js/rust/python/csharp .yml updated to pass `--tag-prefix "<lang>_v" --language "<Language>"`. csharp.yml gains a NuGet propagation verification step between publish and release creation, matching the existing patterns in the other three pipelines. format-release-notes.mjs (JS): badge formatter now uses the new `normalizeReleaseVersionForBadge` helper instead of `replace(/^v/, '')`, which previously left language prefixes (e.g. `js-v0.3.5`) embedded in shields.io URLs. Tests: 11 new JS, 4 new Rust, 5 new C#, 4 new Python helper tests. Case study: docs/case-studies/issue-33/ contains the original log, metadata, and a README citing exact log lines for each finding. Upstream template issues filed: - link-foundation/js-ai-driven-development-pipeline-template#52 - link-foundation/rust-ai-driven-development-pipeline-template#44 - link-foundation/python-ai-driven-development-pipeline-template#6 - link-foundation/csharp-ai-driven-development-pipeline-template#5 Refs #33
Patch-level changeset: covers the npm publish verification retry fix, the `[JavaScript] X.Y.Z` release title format, the `js_v` tag prefix, and the shields.io badge URL fix in format-release-notes.mjs. Refs #33
Member
Author
Working session summaryAll work on issue #33 is complete. PR #34 is ready for review with all 4 CI workflows green on commit Final state:
PR: #34 This summary was automatically extracted from the AI working session output. |
Member
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $14.702276📊 Context and tokens usage:Claude Opus 4.7: (5 sub-sessions)
Total: (14.0K new + 470.8K cache writes + 17.9M cache reads) input tokens, 109.8K output tokens, $14.702276 cost 🤖 Models used:
📎 Log file uploaded as Gist (6017KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Member
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit 7f9b7ca.
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.
Fixes #33
Summary
Addresses all five CI/CD requirements from issue #33 across the JavaScript, Rust, Python, and C# pipelines.
74135563079).js/scripts/publish-to-npm.mjsnow retries registry verification with exponential backoff, and the outer attempt loop pre-checks the registry before re-runningchangeset publish. CDN propagation lag no longer surfaces a##[error]annotation in a green run.[Language] X.Y.Zand tag prefixes to<lang>_vacross all four languages.csharp.yml(the only language that had none).ghexit-code check tocsharp/scripts/create-github-release.mjs(it had none — same false-positive class as Rust before issue CI/CD is broken #31).format-release-notes.mjs:replace(/^v/, '')left language prefixes intact, producing brokennpm-js-v0.3.5-blue.svgshields.io URLs and/v/js-v0.3.5npm links in the 0.3.5 release.Evidence and Case Study
docs/case-studies/issue-33/contains the original GitHub Actions log (run-25288053638-js.log), run metadata, and a README that cites exact log lines for each finding (4321, 4322, 4330–4331, 4346, 4356, 4370).Changes
Shared release-format helpers
Each language has a small helper module exposing the same four operations:
normalizeReleaseVersionForBadge— stripslang-,lang_, or barevprefix, returns clean SemVer (preserving pre-release/build metadata).encodeShieldsStaticBadgeSegment— applies shields.io static-badge escape rules (-→--,_→__).build<Registry>VersionBadge(packageName, version)— npm/crates.io/NuGet/PyPI.buildReleaseTitle(language, version)andbuildReleaseTag(prefix, version).Files:
js/scripts/release-format-helpers.mjs+ 11 tests injs/tests/test_release_format_helpers.test.jsrust/scripts/release-format-helpers.mjs+ 4 testscsharp/scripts/release-format-helpers.mjs+ 5 testspython/scripts/create_github_release.py(helpers inline) + 4 tests inpython/tests/test_create_github_release_helpers.pynpm publish verification
js/scripts/publish-to-npm.mjs: newverifyPublishedWithRetrywithVERIFY_MAX_ATTEMPTS=5and exponential backoff (3s, 6s, 12s, 24s, 30s capped). The outer retry loop guards re-runs ofchangeset publishwith a pre-check, so the first publish succeeding plus a slow CDN no longer causes a second publish attempt.Release-creation scripts
All four
create-github-releasescripts now:--tag-prefixto<lang>_vand accept--languageand a registry-package arg.buildReleaseTitle("Language", version)so titles read[JavaScript] 0.3.5,[Rust] 0.2.1,[Python] 0.2.0,[C#] 0.2.0.img.shields.iois not already present.already_existsas idempotent, otherwise fail.Workflows
.github/workflows/js.yml—--tag-prefix "js-v"→--tag-prefix "js_v" --language "JavaScript"..github/workflows/rust.yml—--tag-prefix "rust-v"→--tag-prefix "rust_v" --language "Rust"..github/workflows/python.yml—--tag-prefix "python-v"→--tag-prefix "python_v" --language "Python"..github/workflows/csharp.yml—--tag-prefix "csharp-v"→--tag-prefix "csharp_v" --language "C#", plus a newVerify package on NuGetstep that pollshttps://api.nuget.org/v3-flatcontainer/<id>/<version>/<id>.nuspecbetweendotnet nuget pushandCreate GitHub Release.Reproduction Tests
Each new helper test fails on the bug it fixes and passes on the fix:
normalizeReleaseVersionForBadge('js-v0.3.5') === '0.3.5'(badge prefix)buildNpmVersionBadge('lino-objects-codec', 'js-v0.3.5')does not containjs-vand links to/v/0.3.5(broken npm link)buildReleaseTitle('JavaScript', 'js-v0.3.5') === '[JavaScript] 0.3.5'(name: tagbug)buildReleaseTag('js_v', '0.3.5') === 'js_v0.3.5'(new tag prefix convention)Verification
npm test— 160 pass,npm run lint— clean (5 pre-existing warnings),npm run format:check— clean.cargo test— 32 pass,cargo fmt --check— clean,cargo clippy --all-targets --all-features— clean,node --test scripts/*.test.mjs— 12 pass.node --test scripts/*.test.mjs— 5 pass.pytest tests/test_create_github_release_helpers.py— 4 pass,ruff check src tests scripts— clean,ruff format --check— clean.Template Comparison and Upstream Follow-Up
Audited the four template repositories. Filed an issue in each for the shared bugs:
tag_prefix): create-github-release.rs sets release name to "${tag_prefix}${version}" — produces titles like "rust-v0.2.1" instead of "[Rust] 0.2.1" rust-ai-driven-development-pipeline-template#44--tag-prefix/--language, no PyPI badge): create_github_release.py sets release title to bare "v${version}" and never adds a PyPI badge python-ai-driven-development-pipeline-template#6v${version}, no NuGet badge, no NuGet propagation verification): create-github-release.mjs sets name to "v${version}", missing [C#] prefix, no NuGet badge, and workflow has no NuGet propagation verification csharp-ai-driven-development-pipeline-template#5Test plan
npm test(160 tests pass)npm run lintandnpm run format:checkcargo test,cargo fmt --check,cargo clippy --all-targets --all-featuresnode --test scripts/*.test.mjsnode --test scripts/*.test.mjspytest tests/test_create_github_release_helpers.pyruff check,ruff format --checkyaml.safe_load[JavaScript] X.Y.Ztitle with thejs_vtag and a clean shields.io badgeNotes for Reviewers
This PR is a CI fix; it does not bump versions or add changesets/changelog fragments. Trigger a release manually after merge by adding the appropriate changeset (JS) or changelog fragment (Python) on a follow-up PR — the new title/tag/badge format will then take effect automatically.