Skip to content

Fix vpk pack duplicate#161

Open
syrle-foronda wants to merge 2 commits into
mainfrom
fix-vpk-pack-duplicate
Open

Fix vpk pack duplicate#161
syrle-foronda wants to merge 2 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.
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.

1 participant