Skip to content

fix(library-publish): read a package's versions without needing a latest tag - #17

Merged
igorlamos merged 1 commit into
mainfrom
fix/library-publish-view-without-latest
Oct 8, 2026
Merged

igorlamos merged 1 commit into
mainfrom
fix/library-publish-view-without-latest

Conversation

@beplus-agent-claude

Copy link
Copy Markdown
Contributor

The first stage promotions after #15 refused aws, cdk, config and database with "is not in GitHub Packages, so dev never released it", for versions their dev runs had published there (Publishing @beplus/aws-core@0.1.0-next.2 to GitHub Packages (dist-tag dev), green).

Why

Called with a bare name, npm view answers only for the latest tag, and for a package without one it prints nothing and exits 0 (npm's lib/commands/view.js: no matching version, and no E404 when the version it looked for is latest). dev publishes with --tag dev, so every package dev first published that way has no latest in GitHub Packages, and #15's lookup read its versions as none.

That covers aws-core, cdk-estate, cdk-release, config and the three database packages. It's also why cdk@0.9.0 passed in the same run, and why all of beplus/ai's packages passed: their latest dates from the old pipeline. Before #15, the promote job asked for the exact version, so it never hit this.

The change

  • Each lookup names a version.
  • With latest present, it's still one call per registry.

beplus/be#10 makes the same fix in be's catch-up-codeartifact.sh.

Tested

Not run on GitHub yet. Locally, the steps ran against a stubbed npm that answers like the real one (nothing for a bare name without latest, "No match found" for a missing version):

  • aws-core, with no latest in GitHub Packages and nothing in stage: next.1 caught up, next.2 becomes latest
  • an old package with latest everywhere: one call per registry
  • a CodeArtifact package without latest and with a leftover catch-up tag: versions read, tag removed
  • a version dev never released, and a package GitHub Packages has never seen: still refused

After merge

  • Tag v2.10.2 and move v2.
  • Dispatch Publish on stage for aws, cdk, config and database.

…test` tag

The first stage promotions after #15 refused aws, cdk, config and database: "is
not in GitHub Packages, so dev never released it", for versions dev's runs had
published there. Called with a bare name, `npm view` answers only for the
`latest` tag, and a package without one prints nothing, exit 0. dev publishes
with `--tag dev`, so every package dev first published that way (aws-core,
cdk-estate, cdk-release, config, the three database packages) has no `latest` in
GitHub Packages, and its versions read as none.

Each lookup now names a version: GitHub Packages is asked for the version the
commit carries, as the promote job did before #15; CodeArtifact for `latest`,
then that version, then each earlier one dev released, until one matches. A
package with `latest` still costs one call a registry.

Co-Authored-By: Igor Lamos <igor@be.plus>
@igorlamos igorlamos self-assigned this Oct 8, 2026
@igorlamos
igorlamos merged commit 7a2b39f into main Oct 8, 2026
@igorlamos
igorlamos deleted the fix/library-publish-view-without-latest branch October 8, 2026 17:33
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.

2 participants