Fix Python emitter CI publish failure: stamp prerelease version in Build-Packages.ps1#10817
Open
iscai-msft wants to merge 5 commits into
Open
Fix Python emitter CI publish failure: stamp prerelease version in Build-Packages.ps1#10817iscai-msft wants to merge 5 commits into
iscai-msft wants to merge 5 commits into
Conversation
The Build-Packages.ps1 script accepted a -Prerelease flag but never used
it to stamp the package version. Every CI build on main produced a package
with the same version from package.json, causing npm publish to fail with
a 409 conflict when publishing to the DevOps feed.
Added prerelease version stamping (matching the pattern used by the C#
emitter) that appends -alpha.{BuildNumber} or -beta.{BuildNumber} to the
version and updates package.json before npm pack.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
24d3fa9 to
9e5527f
Compare
pnpm is not available in the CI build environment which only has npm/node. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add pnpm install step to the build-step template so chronus is available in the CI environment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chronus is not in http-client-python's node_modules, so pnpm can't find it. Install it globally alongside pnpm. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Problem
The Python emitter's
Build-Packages.ps1script accepts a-Prereleaseflag but never uses it to stamp the package version. Every CI build onmainproduces a package with the exact same version frompackage.json, causingnpm publishto fail with a 409 conflict when publishing to the DevOps feed.See failing build: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6353671
Fix
Added prerelease version stamping that:
-alpha.{BuildNumber}(when-Prerelease) or-beta.{BuildNumber}to the versionpackage.jsonbeforenpm packso the tarball has the correct versionThis matches the existing pattern used by the C# emitter's
Build-Packages.ps1.Changes
packages/http-client-python/eng/scripts/Build-Packages.ps1: Use-Prereleaseand-BuildNumberparams to stamp version before packaging