-
Notifications
You must be signed in to change notification settings - Fork 192
Add -AsTag parameter to Get-Version #1965
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
base: dev
Are you sure you want to change the base?
Conversation
- Add -AsTag switch to Get-Version.ps1 that returns the full git tag (e.g., "v13") - Update Package-Toolkit.ps1 to use Get-Version -AsTag for zip filenames - Update Update-Version.ps1 to use Get-Version -AsTag for ftktag.txt Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@flanakin please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
1 similar comment
|
@flanakin please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a new -AsTag switch to the version helper script and updates packaging/versioning scripts to use git-tag style versions (for example, v13) where needed.
Changes:
- Added
-AsTagswitch toGet-Version.ps1to return a git tag format (for example,v13). - Updated
Update-Version.ps1to useGet-Version -AsTagwhen writingftktag.txt. - Updated
Package-Toolkit.ps1to useGet-Version -AsTagfor packaging output naming (but this currently impacts non-zip uses of$versiontoo).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/scripts/Get-Version.ps1 | Adds -AsTag switch and updates help text/examples. |
| src/scripts/Update-Version.ps1 | Uses Get-Version -AsTag to populate ftktag.txt (removes inline regex). |
| src/scripts/Package-Toolkit.ps1 | Switches to tag-based version for ZIP naming, but currently also changes doc/deploy/version behaviors that appear to expect semantic major.minor. |
src/scripts/Package-Toolkit.ps1
Outdated
| $zip = if ($unversionedZip) { | ||
| Join-Path (Get-Item $relDir) "$templateName.zip" | ||
| } else { | ||
| Join-Path (Get-Item $relDir) "$templateName-v$version.zip" | ||
| Join-Path (Get-Item $relDir) "$templateName-$version.zip" |
Copilot
AI
Jan 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ZIP filename now uses $version directly. If $version is kept as semantic (e.g., 13.0), this will produce finops-hub-13.0.zip (dropping the expected v tag prefix). If $version remains a tag (v13), it affects other behaviors in this script (docs/deploy + ftkver.txt). Consider using a dedicated tag variable for ZIP naming (e.g., $tag = Get-Version -AsTag) and keep $version semantic for internal paths.
| function Copy-TemplateFiles() | ||
| { | ||
| Write-Host "Packaging $(if ($Template) { "$Template v$version template" } else { "v$version templates" })..." | ||
| Write-Host "Packaging $(if ($Template) { "$Template $version template" } else { "$version templates" })..." |
Copilot
AI
Jan 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ($Template) { ... } else { ... } will always take the first branch because $Template is a non-empty string by default ("*"). If the intent is to show the "all templates" message when packaging everything, check for $Template -eq '*' (or similar) instead of truthiness.
| Write-Host "Packaging $(if ($Template) { "$Template $version template" } else { "$version templates" })..." | |
| Write-Host "Packaging $(if ($Template -ne "*") { "$Template $version template" } else { "$version templates" })..." |
| .PARAMETER AsTag | ||
| Optional. Returns the version as a git tag (e.g., "v13" instead of "13.0"). Default = false. | ||
|
|
||
| .PARAMETER AsDotNetVersion | ||
| Optional. Indicates that the returned version should be in the format "x.x.x.x". Otherwise, semantic versioning is used. Deafult = false. | ||
| Optional. Indicates that the returned version should be in the format "x.x.x.x". Otherwise, semantic versioning is used. Default = false. | ||
|
|
Copilot
AI
Jan 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change affects release/packaging behavior (new -AsTag switch and updated ZIP naming). Per repo standards, please add a corresponding entry to docs-mslearn/toolkit/changelog.md under the next release section so the behavior change is discoverable.
src/scripts/Package-Toolkit.ps1
Outdated
| } | ||
|
|
||
| $version = & "$PSScriptRoot/Get-Version" | ||
| $version = & "$PSScriptRoot/Get-Version" -AsTag |
Copilot
AI
Jan 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$version is now set to the git tag (e.g., v13), but later in this script $version is also used for doc/deploy naming and writing docs/_includes/ftkver.txt, which currently holds a semantic major.minor value (e.g., 13.0). Using v13 here will change the generated deploy file names/paths (currently *-13.0.*) and will overwrite ftkver.txt with a tag value. Keep $version as the semantic version and introduce a separate $tag (from Get-Version -AsTag) specifically for ZIP filenames / tag-specific paths.
| $version = & "$PSScriptRoot/Get-Version" -AsTag | |
| $version = & "$PSScriptRoot/Get-Version" |
Keep $version as semantic version (13.0) for deploy paths and ftkver.txt, and use $tag (v13) only for zip filenames. Addresses PR review feedback. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🛠️ Description
Added
-AsTagswitch toGet-Version.ps1that returns the full git tag (e.g.,v13instead of13.0). UpdatedPackage-Toolkit.ps1to use it so zip filenames match release expectations (finops-hub-v13.zipinstead offinops-hub-v13.0.zip). UpdatedUpdate-Version.ps1to use it for writingftktag.txtinstead of inline regex.📋 Checklist
🔬 How did you test this change?
🙋♀️ Do any of the following that apply?
📑 Did you update
docs/changelog.md?📖 Did you update documentation?
🤖 Generated with Claude Code