Repository navigation
refactor(packaging): push the install-tested Chocolatey package; simplify - #55
Merged
Merged
Conversation
…lify Feature-level /simplify review of the Chocolatey channel. - publish-packages' chocolatey job now pushes the .nupkg chocolatey-verify packed and install-tested, via a workflow_call output naming its artifact, instead of re-rendering and re-packing. What reaches moderation is byte for byte what passed, and the job drops checkout, Node, the render (which downloaded two DMGs it never used) and the pack. - chocolateyuninstall.ps1 uses Chocolatey's own [array]$keys idiom instead of @(...) | Where-Object: the root of the @($null) bug, not a filter after it. - render-packaging.mjs drops COPIES/copyFiles: the placeholder-free uninstall script is listed with the templates, since rendering it is a verbatim copy and --check already covers a missing template. Output is byte-identical. - verify-chocolatey.ps1 folds the six exit-code checks into Invoke-Choco (-ExpectFailure for the tamper step); labels unchanged. - The 409 message no longer guesses "likely still pending moderation". - Comments: why step 2 sleeps instead of polling; how the literal install path ties to managed_by(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Feature-level
/simplifyreview of the Chocolatey channel. Four reviewers looked at it from different angles (reuse, simplification, efficiency, altitude); this applies the findings that survived deduplication and checking.Applied
chocolateyjob used to re-render and re-pack before pushing, so the package that reached moderation was a rebuild presumed identical to the onechocolatey-verifyinstall-tested. It now downloadschocolatey-verify's.nupkgartifact, whose name is exposed as aworkflow_calloutput so the two can't drift, and pushes that file. The job drops checkout, Node, the render (which downloaded two DMGs it never used) and the pack. Flagged by three of the four reviewers.[array]$keys = Get-UninstallRegistryKey …, Chocolatey's own template idiom, replaces@(…) | Where-Object { $_ }. The@()wrapper is what turned$nullinto a one-element array; this removes the cause rather than filtering after it. Checked locally with stubs returning$null, nothing, one key and two keys: counts 0/0/1/2.COPIESmachinery is removed fromrender-packaging.mjs. The placeholder-free uninstall script is listed with the templates: rendering it is a verbatim copy, and--checkalready fails on a missing template. The rendered output is byte-identical tomain's for all 5 files.Invoke-Choconow checks the exit code itself. This replaces six repeated call-then-check pairs, with-ExpectFailurefor the tamper step. Labels are unchanged, so CI logs read the same.managed_by().Skipped, with reasons
--icon-commitfrom the caller (altitude): afteractions/checkout,git rev-parse HEADisgithub.sha, so the gain is marginal.verify-homebrew.ymlis outside this feature, and bash's-emeans the two copies don't actually behave differently.Test plan
npm run test:scripts: 5/5;render-packaging.mjs --check: cleanmain's renderer, run over the same sources (all 5 files)workflow_calloutput →download-artifactinpublish-packages. Thechocolateyjob no longer renders or packs.Invoke-Choco+Checkdefinitions, pulled from the script's AST and run against a fakechoco, give the right verdict for exit 0/1 ×-ExpectFailureon/off, with exactly one result object each timeVerify Chocolatey packagerun: the install test against the reworked script and the[array]uninstallpublish-packagesonly runs on a release or dispatch; the next tagged release exercises it🤖 Generated with Claude Code