fix(release): fail fast with a clear error when VSCE_PAT/OVSX_PAT are unset - #50
Merged
Merged
Conversation
…re unset vsce publish was called with --pat '' because the VSCE_PAT/OVSX_PAT secrets aren't configured yet, which made Azure DevOps reject the request and aborted the whole semantic-release run before it could create the GitHub Release for the already-published npm packages. Skip the marketplace/registry publish with a warning when either PAT is missing instead of throwing, so this optional integration can't block the rest of the release. Closes #49
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Publishing to the VS Code Marketplace/Open VSX still requires VSCE_PAT/OVSX_PAT — this is not optional. Replace the confusing `vsce publish --pat ''` / TF400813 Azure DevOps error with an explicit error naming the missing secret(s) and pointing at RELEASING.md.
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.
Closes #49
What changed
scripts/release-vscode-extension.mjs'spublish()now throws an explicit error naming which ofVSCE_PAT/OVSX_PATis missing and pointing at RELEASING.md, instead of callingvsce publish --pat ''and letting Azure DevOps reject it with a crypticTF400813error.Publishing the extension is still required, not optional — this only replaces the confusing failure with a clear one; it does not skip the publish step.
Why
Run https://github.com/bhouston/hdrify/actions/runs/35386664895 failed with:
That message doesn't say what's actually wrong (the
VSCE_PAT/OVSX_PATrepo secrets from RELEASING.md step 6 aren't configured yet). This makes the failure self-explanatory so the next person doesn't have to dig through vsce/Azure DevOps internals to find the real cause.Test plan
pnpm buildpnpm tscpnpm lintpnpm test --coverage(thresholds met: 89.22% stmts / 72.29% branches / 93.92% funcs / 89.78% lines)pnpm release:check— added a test assertingpublish()throws a clear error naming the missing secret(s) whenVSCE_PAT/OVSX_PATare unsetpnpm sizepnpm audit --audit-level=highreviewed — findings are pre-existing/unrelated (same as noted in the failed run's CI annotations)