Repository navigation
fix(library-publish): read a package's versions without needing a latest tag - #17
Merged
Merged
Conversation
…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
approved these changes
Oct 8, 2026
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.
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 viewanswers only for thelatesttag, and for a package without one it prints nothing and exits 0 (npm'slib/commands/view.js: no matching version, and no E404 when the version it looked for islatest). dev publishes with--tag dev, so every package dev first published that way has nolatestin 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.0passed in the same run, and why all of beplus/ai's packages passed: theirlatestdates from the old pipeline. Before #15, the promote job asked for the exact version, so it never hit this.The change
latest, then that version, then each earlier one dev released, newest first, until one matches. "No match found for version" means try the next one; a plain E404 means the package isn't there.latestpresent, it's still one call per registry.beplus/be#10 makes the same fix in
be'scatch-up-codeartifact.sh.Tested
Not run on GitHub yet. Locally, the steps ran against a stubbed
npmthat answers like the real one (nothing for a bare name withoutlatest, "No match found" for a missing version):aws-core, with nolatestin GitHub Packages and nothing in stage: next.1 caught up, next.2 becomeslatestlatesteverywhere: one call per registrylatestand with a leftovercatch-uptag: versions read, tag removedAfter merge
v2.10.2and movev2.stagefor aws, cdk, config and database.