WKS-2687 - Compute publish-api release version from git tags - #71
Merged
Conversation
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.
Summary
publish-api.ymlused to compute the next release version vianpm version minoragainst whatever version is committed inapi/package.jsononmain. That's fragile: if a prior run's "merge release branch back to main" step fails or is skipped,main's committed version silently goes stale relative to what's actually been published.0.17.0successfully, but its merge-back tomainnever landed. A subsequent run (merging PR WKS-2687 - Add PlatformCrypto to PlatformContext #70, thePlatformCryptoaddition) recomputed the same0.17.0, saw the tag already existed, and silently skipped the entire publish via the existing "already released" guard — so a real, merged feature change was never actually published, with no failure signal anywhere.jfrog-workers/*git tag on the remote (the true source of truth for what's been published) instead of frommain's committedpackage.json, which is now treated as a mutable placeholder that can safely go stale.set -euo pipefailplus a guard on the onegrepthat legitimately produces zero matches on a first-ever run (so the "no tags yet" bootstrap path still falls through cleanly instead of the script aborting).Test plan
0.17.0as latest)0.17.0and would still silently skip; new logic correctly computes0.18.0set -euo pipefail+grepguard: genuine pipeline failures still abort loudly; the legitimate empty/no-tags case still falls through to thepackage.jsonfallbackworkflow_dispatchto actually publish the pendingPlatformCryptochange (merging this workflow-only change won't itself trigger a release, since it doesn't touchapi/**)