Skip to content

Add file version & copyright info to windows package#13506

Open
kilasuit wants to merge 3 commits into
cli:trunkfrom
kilasuit:copilot/add-file-version-copyright-info
Open

Add file version & copyright info to windows package#13506
kilasuit wants to merge 3 commits into
cli:trunkfrom
kilasuit:copilot/add-file-version-copyright-info

Conversation

@kilasuit
Copy link
Copy Markdown

fixes #13079

Copilot AI review requested due to automatic review settings May 24, 2026 09:01
@kilasuit kilasuit requested a review from a team as a code owner May 24, 2026 09:01
@kilasuit kilasuit requested a review from babakks May 24, 2026 09:01
@github-actions github-actions Bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed unmet-requirements and removed needs-triage needs to be reviewed labels May 24, 2026
@github-actions
Copy link
Copy Markdown

Thanks for your pull request! Unfortunately, it doesn't meet the requirements for review:

  • None of the referenced issues have the help wanted label

Please update your PR to address the above. This PR will be automatically closed in 4 days if these requirements are not met.

Full contribution requirements
  1. Include a detailed description of what this PR does
  2. Link to an issue with the help wanted label (use Fixes #123 or Closes #123)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds guardrails around Windows resource/version metadata by enforcing a non-empty legal copyright string and ensuring the winres generation script passes explicit version components to goversioninfo.

Changes:

  • Added Go tests validating versioninfo.template.json and presence of fixed version flags in gen-winres.ps1.
  • Populated LegalCopyright in versioninfo.template.json.
  • Updated gen-winres.ps1 to parse product version components and pass -ver-* / -product-ver-* flags to goversioninfo.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
script/winres_test.go Adds tests to assert version template and winres script contain required metadata/flags
script/versioninfo.template.json Sets a non-empty LegalCopyright value
script/gen-winres.ps1 Parses version components and passes fixed version fields to goversioninfo

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread script/gen-winres.ps1
Comment thread script/gen-winres.ps1
Comment thread script/gen-winres.ps1
Comment thread script/gen-winres.ps1
Comment on lines +43 to +48
$_version_major = [int]$_product_version_components.Groups[1].Value
$_version_minor = [int]$_product_version_components.Groups[2].Value
$_version_patch = [int]$_product_version_components.Groups[3].Value
$_version_build = 0
if (-not [string]::IsNullOrEmpty($_product_version_components.Groups[4].Value)) {
$_version_build = [int]$_product_version_components.Groups[4].Value
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not needed.

Comment thread script/gen-winres.ps1

$_product_version_components = [regex]::Match($_product_version, "^[^0-9]*([0-9]+)\.([0-9]+)\.([0-9]+)(?:\.([0-9]+))?")
if (-not $_product_version_components.Success) {
Write-Host "error: product-version argument '$_product_version' must include semantic version numbers"
Copy link
Copy Markdown
Member

@babakks babakks May 24, 2026

Choose a reason for hiding this comment

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

Good point. We should add an example. Also the input must not include the v prefix.

@kilasuit
Copy link
Copy Markdown
Author

@babakks I am not gonna be able to spend any more time back and forth on this so i hope that this is good enough start

Copy link
Copy Markdown
Member

@babakks babakks left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I haven't yet tried it, and here are some comments.

I'll check this out later and if no progress I'll wrap it up. So, no worries.

Comment thread script/gen-winres.ps1
Comment on lines +46 to +48
$_version_build = 0
if (-not [string]::IsNullOrEmpty($_product_version_components.Groups[4].Value)) {
$_version_build = [int]$_product_version_components.Groups[4].Value
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't have build number in our version, so let's get rid of these and populate the flags with zero.

Comment thread script/winres_test.go
@@ -0,0 +1,43 @@
package main
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not a reliable test. Let's remove it all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh.exe (Windows) wrongly reporting 0.0.0.0 for File Version & no Copyright info

4 participants