Skip to content

fix(ci): release-format consistency and npm publish verification#34

Merged
konard merged 4 commits intomainfrom
issue-33-2c527aa50b81
May 5, 2026
Merged

fix(ci): release-format consistency and npm publish verification#34
konard merged 4 commits intomainfrom
issue-33-2c527aa50b81

Conversation

@konard
Copy link
Copy Markdown
Member

@konard konard commented May 5, 2026

Fixes #33

Summary

Addresses all five CI/CD requirements from issue #33 across the JavaScript, Rust, Python, and C# pipelines.

  • Fixed the npm publish false positive in run 25288053638 (job 74135563079). js/scripts/publish-to-npm.mjs now retries registry verification with exponential backoff, and the outer attempt loop pre-checks the registry before re-running changeset publish. CDN propagation lag no longer surfaces a ##[error] annotation in a green run.
  • Standardized release titles to [Language] X.Y.Z and tag prefixes to <lang>_v across all four languages.
  • Added a NuGet propagation verification step to csharp.yml (the only language that had none).
  • Added a gh exit-code check to csharp/scripts/create-github-release.mjs (it had none — same false-positive class as Rust before issue CI/CD is broken #31).
  • Fixed the JavaScript badge URL bug in format-release-notes.mjs: replace(/^v/, '') left language prefixes intact, producing broken npm-js-v0.3.5-blue.svg shields.io URLs and /v/js-v0.3.5 npm 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 — strips lang-, lang_, or bare v prefix, 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) and buildReleaseTag(prefix, version).

Files:

  • js/scripts/release-format-helpers.mjs + 11 tests in js/tests/test_release_format_helpers.test.js
  • rust/scripts/release-format-helpers.mjs + 4 tests
  • csharp/scripts/release-format-helpers.mjs + 5 tests
  • python/scripts/create_github_release.py (helpers inline) + 4 tests in python/tests/test_create_github_release_helpers.py

npm publish verification

js/scripts/publish-to-npm.mjs: new verifyPublishedWithRetry with VERIFY_MAX_ATTEMPTS=5 and exponential backoff (3s, 6s, 12s, 24s, 30s capped). The outer retry loop guards re-runs of changeset publish with 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-release scripts now:

  • Default --tag-prefix to <lang>_v and accept --language and a registry-package arg.
  • Build the title via buildReleaseTitle("Language", version) so titles read [JavaScript] 0.3.5, [Rust] 0.2.1, [Python] 0.2.0, [C#] 0.2.0.
  • Append a registry badge to the body if img.shields.io is not already present.
  • Inspect the publish/release-create exit code, treat already_exists as 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 new Verify package on NuGet step that polls https://api.nuget.org/v3-flatcontainer/<id>/<version>/<id>.nuspec between dotnet nuget push and Create 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 contain js-v and links to /v/0.3.5 (broken npm link)
  • buildReleaseTitle('JavaScript', 'js-v0.3.5') === '[JavaScript] 0.3.5' (name: tag bug)
  • buildReleaseTag('js_v', '0.3.5') === 'js_v0.3.5' (new tag prefix convention)

Verification

  • JavaScript: npm test — 160 pass, npm run lint — clean (5 pre-existing warnings), npm run format:check — clean.
  • Rust: cargo test — 32 pass, cargo fmt --check — clean, cargo clippy --all-targets --all-features — clean, node --test scripts/*.test.mjs — 12 pass.
  • C#: node --test scripts/*.test.mjs — 5 pass.
  • Python: pytest tests/test_create_github_release_helpers.py — 4 pass, ruff check src tests scripts — clean, ruff format --check — clean.
  • All four workflow YAML files parse cleanly.

Template Comparison and Upstream Follow-Up

Audited the four template repositories. Filed an issue in each for the shared bugs:

Test plan

  • JS: npm test (160 tests pass)
  • JS: npm run lint and npm run format:check
  • Rust: cargo test, cargo fmt --check, cargo clippy --all-targets --all-features
  • Rust: node --test scripts/*.test.mjs
  • C#: node --test scripts/*.test.mjs
  • Python: pytest tests/test_create_github_release_helpers.py
  • Python: ruff check, ruff format --check
  • All four workflow YAML files parse with yaml.safe_load
  • First end-to-end release after merge produces [JavaScript] X.Y.Z title with the js_v tag and a clean shields.io badge

Notes 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.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #33
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
@konard konard changed the title [WIP] All CI/CD issues must be diagnosed and fixed fix(ci): release-format consistency and npm publish verification May 5, 2026
@konard konard marked this pull request as ready for review May 5, 2026 19:45
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
@konard
Copy link
Copy Markdown
Member Author

konard commented May 5, 2026

Working session summary

All work on issue #33 is complete. PR #34 is ready for review with all 4 CI workflows green on commit d0fe09b.

Final state:

  • Case study at docs/case-studies/issue-33/README.md with cited evidence (e.g., run-25288053638-js.log:4321 for the false-positive ##[error], :4356 for the broken name: js-v0.3.5, :4370 for the broken badge URL).
  • Changeset js/.changeset/issue-33-release-format.md resolves the "Check for Changesets" gate that failed on ab1fb11.
  • Five fixes shipped: npm publish verification with exponential backoff, [Language] X.Y.Z release titles, <lang>_v tag prefix, shields.io badge URL stripping the language prefix, and a new NuGet verification step for C#.
  • Four upstream issues filed against the *-ai-driven-development-pipeline-template repos with concrete file:line evidence.
  • Test counts green: js 160 + 11 helper, rust 32 cargo + 12 node, csharp 5, python 4 helper.

PR: #34


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Member Author

konard commented May 5, 2026

🤖 Solution Draft Log

This 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)

  1. 115.7K / 1M (12%) input tokens, 9.1K / 128K (7%) output tokens
  2. 116.6K / 1M (12%) input tokens, 6.5K / 128K (5%) output tokens
  3. 116.9K / 1M (12%) input tokens, 36.1K / 128K (28%) output tokens
  4. 117.3K / 1M (12%) input tokens, 29.4K / 128K (23%) output tokens
  5. 32.2K / 1M (3%) input tokens, 412 / 128K (0%) output tokens

Total: (14.0K new + 470.8K cache writes + 17.9M cache reads) input tokens, 109.8K output tokens, $14.702276 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.7 (claude-opus-4-7)

📎 Log file uploaded as Gist (6017KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented May 5, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit 8311348 into main May 5, 2026
35 checks passed
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.

All CI/CD issues must be diagnosed and fixed

1 participant