Skip to content

Fix vpk pack duplicate#161

Merged
danzhu54 merged 4 commits into
mainfrom
fix-vpk-pack-duplicate
Jul 9, 2026
Merged

Fix vpk pack duplicate#161
danzhu54 merged 4 commits into
mainfrom
fix-vpk-pack-duplicate

Conversation

@syrle-foronda

Copy link
Copy Markdown
Member

This pull request updates the build and packaging pipeline for the .NET Upgrade Planner to simplify versioning and improve reliability. The most significant change is the removal of the dependency on the nbgv tool for versioning, replacing it with a versioning scheme based on the Azure DevOps Build.BuildId and Git commit hash. Additional improvements include better error handling in the packaging step and updates to environment variable usage.

Build versioning improvements:

  • Replaced the use of the nbgv tool for versioning with a custom version string that uses Build.BuildId and a shortened Git commit hash, ensuring monotonically increasing and unique versions. (pipelines/templates/steps-build-planner.yml)
  • Updated all references from the previous PLANNER_SEMVER1 environment variable to the new NBGV_SemVer1 variable, aligning with the new versioning approach. (pipelines/templates/steps-build-planner.yml) [1] [2]

Packaging and error handling:

  • Enhanced the error handling in the vpk pack step to gracefully handle cases where the package version already exists, avoiding unnecessary failures and providing clearer log messages. (pipelines/templates/upload-build-planner.yml)

Wrap vpk pack in a try/catch to detect and handle duplicate-version conflicts. Adds logging for attempts and success, sets PlannerVersionExists=true when the error indicates the version already exists (matches "equal or greater" or HTTP 409), and rethrows other errors. This prevents the pipeline from failing when attempting to upload an already-published Planner package while preserving the PlannerVersion variable.
Replace nbgv-based versioning with a deterministic version computed from Build.BuildId and the commit hash (format: 0.1.<BuildId>-beta+<gitHash>). This removes the nbgv tool install/update steps, exposes the computed version as the NBGV_SemVer1 pipeline variable for later steps, and updates error messages to reflect the new variable/flow and avoid references to unexpanded nbgv output.
Comment thread pipelines/templates/steps-build-planner.yml Outdated
Comment thread pipelines/templates/upload-build-planner.yml
Comment thread pipelines/templates/steps-build-planner.yml Outdated
Remove the '-beta' suffix from the version string to release as a stable version. Rename the version variable from NBGV_SemVer1 to PlannerSemVer for clarity. Add error checking for the vpk tool availability and the vpk pack command execution.
Comment thread pipelines/templates/upload-build-planner.yml
@danzhu54 danzhu54 merged commit 95d6fa7 into main Jul 9, 2026
1 check passed
@danzhu54 danzhu54 deleted the fix-vpk-pack-duplicate branch July 9, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants