Skip to content

Add --public-release argument to nbgv get-version command #1245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 10, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 10, 2025

This PR adds the --public-release option to the nbgv get-version command, allowing users to override the PublicRelease environment variable directly from the command line.

Usage

The new option supports multiple syntaxes:

# Explicitly set to true
nbgv get-version --public-release=true

# Explicitly set to false  
nbgv get-version --public-release=false

# Space-separated syntax
nbgv get-version --public-release true

# Flag-only (defaults to true)
nbgv get-version --public-release

Behavior

  • When --public-release is specified, it takes precedence over the PublicRelease environment variable
  • When not specified, the existing behavior is preserved (checks environment variable)
  • The option uses bool? to distinguish between unspecified (null), explicitly true, and explicitly false values
  • This affects version formatting - public releases get stable package versions while non-public releases include git commit suffixes

Example

# Without the flag - respects environment variable
$ PublicRelease=true nbgv get-version --variable NuGetPackageVersion
1.0.1

# With the flag - overrides environment variable  
$ PublicRelease=true nbgv get-version --public-release=false --variable NuGetPackageVersion
1.0.1-g7709ab7a22

This feature is particularly useful for testing how packages will be versioned after merging into public release branches, as mentioned in the issue description.

Fixes #492.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Add --public-release as argument for nbgv get-version Add --public-release argument to nbgv get-version command Aug 10, 2025
@Copilot Copilot AI requested a review from AArnott August 10, 2025 19:26
Copilot finished work on behalf of AArnott August 10, 2025 19:26
@AArnott AArnott marked this pull request as ready for review August 10, 2025 19:30
@AArnott AArnott enabled auto-merge (squash) August 10, 2025 19:30
@AArnott AArnott merged commit 6c7bb08 into main Aug 10, 2025
12 checks passed
@AArnott AArnott deleted the copilot/fix-492 branch August 10, 2025 19:47
@AArnott AArnott added this to the v3.8 milestone Aug 10, 2025
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.

Add --public-release as argument for nbgv get-version
2 participants