Skip to content

Ci/winget bootstrap - #66

Closed
elkaix wants to merge 7 commits into
mainfrom
ci/winget-bootstrap
Closed

Ci/winget bootstrap#66
elkaix wants to merge 7 commits into
mainfrom
ci/winget-bootstrap

Conversation

@elkaix

@elkaix elkaix commented Jun 3, 2026

Copy link
Copy Markdown
Member

Related Issue

Resolve #(issue_number)

Description

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Summary by CodeRabbit

  • Chores
    • Added an automated pipeline that generates and submits Windows package manifests. It detects installer type to select appropriate install options, produces version/installer/locale manifests, and automatically submits them when updates are pushed to the designated branch.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 990412f1-696d-43ca-a0c3-fc2af89ae406

📥 Commits

Reviewing files that changed from the base of the PR and between 95d8377 and d5c0921.

📒 Files selected for processing (1)
  • .github/workflows/winget-bootstrap.yml

📝 Walkthrough

Walkthrough

Adds a one-off GitHub Actions workflow triggered on pushes to ci/winget-bootstrap that downloads and verifies wingetcreate.exe, inspects a release installer to detect its type, generates version/installer/locale WinGet manifest YAMLs, and submits them using secrets.WINGET_SUBMIT_TOKEN.

Changes

WinGet Package Bootstrap

Layer / File(s) Summary
Installer fetch and type detection
.github/workflows/winget-bootstrap.yml
PowerShell job downloads a pinned wingetcreate.exe and the product installer, verifies wingetcreate.exe SHA-256, extracts installer SHA, and detects installer type by scanning the installer binary header.
Manifest generation (version + installer)
.github/workflows/winget-bootstrap.yml
Creates the versioned manifests\p\PythoughtsLabs\PythinkerCode\<version>\ directory and writes the version and installer YAML manifests (installer URL, SHA256, architecture, minimum OS, and silent switches derived from installer type).
Default-locale manifest and submission
.github/workflows/winget-bootstrap.yml
Generates the default-locale manifest (package metadata, license, description, moniker, tags), lists generated files, and calls wingetcreate.exe submit with the token from secrets.WINGET_SUBMIT_TOKEN.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Ci/winget bootstrap' does not follow conventional commits format (type(scope)?: description). It lacks proper type prefix and uses incorrect casing. Rewrite as 'ci(winget): add bootstrap workflow for manifest generation' to follow conventional commits with lowercase type and descriptive message.
Description check ⚠️ Warning The PR description contains only the template with no actual content filled in. All required sections (Related Issue, Description) are empty and all checklist items are unchecked. Fill in the Related Issue number, provide a detailed description of the workflow changes and their purpose, and confirm completion of checklist items.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/winget-bootstrap

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/winget-bootstrap.yml (1)

11-27: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Validate WINGET_TOKEN before use.

The script uses $env:WINGET_TOKEN at line 26 without verifying it's set. If secrets.WINGET_SUBMIT_TOKEN is unconfigured, the command will fail with an unclear error.

🛡️ Proposed defensive check
         run: |
           $ErrorActionPreference = "Stop"
+          if (-not $env:WINGET_TOKEN) {
+            throw "WINGET_SUBMIT_TOKEN is not configured"
+          }
           $installerUrl = "https://github.com/Pythoughts-labs/pythinker-code/releases/download/v0.30.0/PythinkerSetup-0.30.0.exe"

As per coding guidelines, the existing winget.yml workflow includes this validation pattern (see .github/workflows/winget.yml:46-48).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/winget-bootstrap.yml around lines 11 - 27, Add a guard
that validates the WINGET_TOKEN environment variable before invoking
.\wingetcreate.exe to avoid unclear failures; check that $env:WINGET_TOKEN (or
the local variable WINGET_TOKEN if set) is non-empty and throw or exit with a
clear error message if missing, then proceed to run the wingetcreate command
that uses --token $env:WINGET_TOKEN; ensure the validation appears before the
call to .\wingetcreate.exe new and references the same variable name used in the
script.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/winget-bootstrap.yml:
- Around line 7-10: The workflow's job "bootstrap" currently relies on default
broad permissions; add an explicit minimal permissions block under the bootstrap
job definition (the job named bootstrap in the workflow) — either set
permissions: { contents: read } if read access is needed or permissions: {} if
no repo access is required — so the job no longer inherits wide default
permissions.

---

Outside diff comments:
In @.github/workflows/winget-bootstrap.yml:
- Around line 11-27: Add a guard that validates the WINGET_TOKEN environment
variable before invoking .\wingetcreate.exe to avoid unclear failures; check
that $env:WINGET_TOKEN (or the local variable WINGET_TOKEN if set) is non-empty
and throw or exit with a clear error message if missing, then proceed to run the
wingetcreate command that uses --token $env:WINGET_TOKEN; ensure the validation
appears before the call to .\wingetcreate.exe new and references the same
variable name used in the script.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2e90a520-b6d8-41e7-9cae-ac2c5b5513ec

📥 Commits

Reviewing files that changed from the base of the PR and between 1008aba and 4b1c8f9.

📒 Files selected for processing (1)
  • .github/workflows/winget-bootstrap.yml

Comment on lines +7 to +10
jobs:
bootstrap:
runs-on: windows-latest
steps:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Restrict workflow permissions to minimum required scope.

The workflow runs with default broad permissions. For security, explicitly set minimal permissions. Since this workflow only downloads external tools and doesn't interact with the repository, consider:

jobs:
  bootstrap:
    runs-on: windows-latest
    permissions:
      contents: read

Or if no repository access is needed:

jobs:
  bootstrap:
    runs-on: windows-latest
    permissions: {}
🧰 Tools
🪛 zizmor (1.25.2)

[info] 8-8: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/winget-bootstrap.yml around lines 7 - 10, The workflow's
job "bootstrap" currently relies on default broad permissions; add an explicit
minimal permissions block under the bootstrap job definition (the job named
bootstrap in the workflow) — either set permissions: { contents: read } if read
access is needed or permissions: {} if no repo access is required — so the job
no longer inherits wide default permissions.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/winget-bootstrap.yml:
- Around line 14-16: Add an explicit validation for the WINGET_TOKEN secret
before running the rest of the script: inside the run block that currently sets
$ErrorActionPreference, check the WINGET_TOKEN environment variable
(WINGET_TOKEN) and fail early with a clear error message if it is null/empty so
the job exits before calling wingetcreate; update the run step that contains
$ErrorActionPreference = "Stop" to include this guard and return a non-zero exit
when the token is missing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d88c6cdf-3cf4-4212-8cef-b9b526c064de

📥 Commits

Reviewing files that changed from the base of the PR and between 4b1c8f9 and 95d8377.

📒 Files selected for processing (1)
  • .github/workflows/winget-bootstrap.yml

Comment on lines +14 to +16
WINGET_TOKEN: ${{ secrets.WINGET_SUBMIT_TOKEN }}
run: |
$ErrorActionPreference = "Stop"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add token validation before proceeding.

The reference workflow (winget.yml) validates the token is set before use. This avoids a cryptic wingetcreate failure if the secret is misconfigured.

Proposed fix
         run: |
           $ErrorActionPreference = "Stop"
+          if (-not $env:WINGET_TOKEN) {
+            throw "WINGET_SUBMIT_TOKEN is not configured"
+          }
           $version    = "0.30.0"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/winget-bootstrap.yml around lines 14 - 16, Add an explicit
validation for the WINGET_TOKEN secret before running the rest of the script:
inside the run block that currently sets $ErrorActionPreference, check the
WINGET_TOKEN environment variable (WINGET_TOKEN) and fail early with a clear
error message if it is null/empty so the job exits before calling wingetcreate;
update the run step that contains $ErrorActionPreference = "Stop" to include
this guard and return a non-zero exit when the token is missing.

@elkaix elkaix closed this Jun 3, 2026
@elkaix
elkaix deleted the ci/winget-bootstrap branch June 3, 2026 00:15
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