Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@typespec/http-client-python"
---

Fix CI publish failures by stamping prerelease version in Build-Packages.ps1. The `-Prerelease` flag was accepted but unused, causing every CI build to produce the same version and fail with a 409 conflict on the DevOps feed.
3 changes: 3 additions & 0 deletions eng/emitters/pipelines/templates/steps/build-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ steps:
arguments: -UseTypeSpecNext:$${{ parameters.UseTypeSpecNext }}
workingDirectory: $(selfRepositoryPath)

- script: npm install -g pnpm @chronus/chronus
displayName: Install pnpm and chronus

- task: PowerShell@2
displayName: "Run build script"
name: ci_build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ try {
Invoke-LoggedCommand "npm run lint" -GroupOutput
}

# Step 3: Create npm package
# Step 3: Stamp prerelease version if this is a prerelease build
if ($Prerelease) {
Write-Host "`n=== Stamping prerelease version ===" -ForegroundColor Cyan
Invoke-LoggedCommand "pnpm chronus version --prerelease --only `"@typespec/http-client-python`""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Invoke-LoggedCommand "pnpm chronus version --prerelease --only `"@typespec/http-client-python`""
Invoke-LoggedCommand "pnpm chronus version --prerelease --only @typespec/http-client-python"

I think the ` and " is surplus here?

$emitterVersion = node -p -e "require('./package.json').version"
Write-Host "Stamped version: $emitterVersion"
}
Copy link
Copy Markdown
Contributor

@msyyc msyyc May 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The 409 conflict is NOT fully fixed. As long as no new change files are added under .chronus/changes/, every subsequent main build produces the same A.B.C-dev.C string → 409 returns immediately. The C# emitter avoids this by suffixing the unique $BuildNumber, which is exactly why the PR description mentions -alpha.{BuildNumber}. The code doesn't actually do that. To match C#/be robust, use a template like:
    pnpm chronus version --prerelease "{nextVersion}-alpha.$BuildNumber" --only "@typespec/http-client-python"
  2. A.B.C-dev.C would be published to public npm with the latest tag unless the publish step explicitly passes --tag dev. That means right after a bump PR, a prerelease can hijack latest and your users running npm i @typespec/http-client-python would download a -dev.N build instead of A.B.C. The C# emitter publishes alpha builds to the internal DevOps feed, not public npm — but publish.yml here is Publish: "public". So either:
  • the alpha/dev tarballs need a non-latest npm dist-tag in the publish step, or
  • this pipeline should publish prereleases to the internal feed (and a separate publish flow handles stable A.B.C releases to public).


Write-Host "`n=== Creating npm package ===" -ForegroundColor Cyan
Invoke-LoggedCommand "npm pack"
Copy-Item "typespec-http-client-python-$emitterVersion.tgz" -Destination "$outputPath/packages"
Expand Down
Loading