Conversation
Agent-Logs-Url: https://github.com/Belphemur/SoundSwitch/sessions/d5956fcd-da14-4ae6-951b-41c726b479cc Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
…nforce PS 7.0+ - Delete Download-Release.ps1, replaced by Publish-Release.ps1 - Publish-Release.ps1: full release orchestrator using gh CLI (download draft, build installer, upload, changelog body, publish) - Build-Installer.ps1: replace -DownloadRelease with -SkipBuild, focused on building and code signing only - Add #Requires -Version 7.0 to Build-Installer.ps1 and Sign-Binary.ps1 - Update tests and README.md Agent-Logs-Url: https://github.com/Belphemur/SoundSwitch/sessions/d5956fcd-da14-4ae6-951b-41c726b479cc Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughDownload-based release script was removed and replaced by a new end-to-end release orchestrator Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Publish as Publish-Release.ps1
participant GH as GitHub CLI (gh)
participant FS as File System
participant Installer as Build-Installer.ps1
participant Signer as Sign-Binary.ps1
participant CHANGELOG as CHANGELOG.md
User->>Publish: run with -Channel / options
Publish->>GH: list/releases -> select draft matching channel
GH-->>Publish: draft metadata + asset list
Publish->>GH: download SoundSwitch-v*.zip to temp
GH-->>Publish: zip downloaded
Publish->>FS: extract zip -> `Final` (or BuildFromSource -> dotnet publish -> `Final`)
FS-->>Publish: Final populated
Publish->>Installer: Invoke with -FinalDir and InstallerReleaseState
Installer->>FS: validate FinalDir exists & non-empty
Installer->>Installer: locate ISCC.exe (registry / PATH)
Installer->>FS: run ISCC -> produce *Installer.exe in FinalDir
Installer->>Signer: call Sign-Binary.ps1 (if signing enabled)
Signer-->>Installer: signed installer(s)
Installer-->>Publish: return success
Publish->>CHANGELOG: extract latest changelog section
CHANGELOG-->>Publish: release notes content
Publish->>GH: gh release upload --clobber Final\Installer\*Installer.exe
GH-->>Publish: assets updated
Publish->>User: prompt to publish
User-->>Publish: confirm
Publish->>GH: gh release edit --draft=false
GH-->>Publish: release published
Publish-->>User: done
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tools/Install-BuildTools.Tests.ps1 (1)
480-518: Please add one mocked behavior test for the new release contract.These additions only prove that the scripts parse and contain certain strings. They will not catch workflow regressions in
tools/Publish-Release.ps1, such as-Channel betastill generating aReleaseinstaller state or a custom-OutputDirdrifting away fromtools/Build-Installer.ps1's fixedFinal\path.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tools/Install-BuildTools.Tests.ps1` around lines 480 - 518, Add a Pester test that mocks the downstream behavior to verify the new release contract: in the tests for Publish-Release.ps1 create a spec that Mocks the call to Build-Installer.ps1 (or the function/command that Publish-Release.ps1 invokes), invoke Publish-Release.ps1 with representative args (e.g. -Channel 'beta' and a custom -OutputDir), and assert the mocked call received the expected parameters (ensure -Channel does not translate to installer state "Release" and that -OutputDir maps to the expected final path like 'Final\'), using Pester Mock and Should assertions to fail if Publish-Release.ps1 sends incorrect parameters to Build-Installer.ps1.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tools/Publish-Release.ps1`:
- Around line 69-70: The script defines [string]$OutputDir but never passes it
into the downstream build/upload steps, causing mismatches between where the
installer is built and where the pipeline uploads; update the Publish-Release
flow to propagate $OutputDir into the Build-Installer invocation and all uses
(e.g., the call to tools/Build-Installer.ps1 and the upload path referencing
$OutputDir\Installer), and adjust the -SkipBuild precondition logic to validate
against the same $OutputDir (or default to '..\Final' if none supplied) so build
and upload always operate on the same directory.
- Around line 64-75: The script currently hardcodes
InstallerReleaseState='Release' regardless of -Channel; change the defaulting so
when Channel is 'beta' InstallerReleaseState is set to 'Beta' (or otherwise
derived from $Channel) unless the caller explicitly passes
-InstallerReleaseState; update the parameter handling and any places that
forward InstallerReleaseState (references: the parameter names $Channel and
$InstallerReleaseState and calls to tools/Build-Installer.ps1) to
compute/override the value at startup and ensure the same logic is applied at
the other occurrences noted (the other places forwarding InstallerReleaseState).
---
Nitpick comments:
In `@tools/Install-BuildTools.Tests.ps1`:
- Around line 480-518: Add a Pester test that mocks the downstream behavior to
verify the new release contract: in the tests for Publish-Release.ps1 create a
spec that Mocks the call to Build-Installer.ps1 (or the function/command that
Publish-Release.ps1 invokes), invoke Publish-Release.ps1 with representative
args (e.g. -Channel 'beta' and a custom -OutputDir), and assert the mocked call
received the expected parameters (ensure -Channel does not translate to
installer state "Release" and that -OutputDir maps to the expected final path
like 'Final\'), using Pester Mock and Should assertions to fail if
Publish-Release.ps1 sends incorrect parameters to Build-Installer.ps1.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4812db39-93ae-413e-82fd-db478b2ca166
📒 Files selected for processing (7)
tools/Build-Installer.ps1tools/Download-Release.ps1tools/Install-BuildTools.Tests.ps1tools/Install-BuildTools.ps1tools/Publish-Release.ps1tools/README.mdtools/Sign-Binary.ps1
💤 Files with no reviewable changes (1)
- tools/Download-Release.ps1
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR replaces the REST API–based release download script with a GitHub CLI–driven release publishing orchestrator, and refactors the installer build script to separate release orchestration from build/sign responsibilities.
Changes:
- Added
tools/Publish-Release.ps1to orchestrate draft release download → build/sign → upload assets → set notes → publish viagh. - Refactored
tools/Build-Installer.ps1to use-SkipBuild(assumeFinal\is already populated) instead of downloading releases. - Updated build tooling installation and tests to include GitHub CLI and validate new scripts.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Publish-Release.ps1 | New end-to-end release orchestrator using GitHub CLI (gh). |
| tools/Build-Installer.ps1 | Removes release download; introduces -SkipBuild flow for pre-populated Final\. |
| tools/Install-BuildTools.ps1 | Installs GitHub CLI via winget and updates installed-tools output. |
| tools/Install-BuildTools.Tests.ps1 | Adds tests for GitHub CLI ordering and basic parse/parameter validation for scripts. |
| tools/README.md | Updates tooling documentation to reference Publish-Release.ps1 and new behavior. |
| tools/Sign-Binary.ps1 | Enforces PowerShell 7+ via #Requires. |
| tools/Download-Release.ps1 | Removes deprecated REST API download script. |
|
@copilot apply changes based on the comments in this thread and code rabbit comments. Only relevant and comment on the thread and close them. |
… release state from channel - Build-Installer.ps1: focused on signing + Inno Setup compilation only, accepts -FinalDir param, invokes ISCC.exe directly via registry lookup (no Make-Installer.bat dependency), uses Sign-Binary.ps1 for all signing - Publish-Release.ps1: handles download-from-draft OR build-from-source, HTML docs + asset bundling only when building from source (CI already includes them in the release zip), derives InstallerReleaseState from Channel (beta→Beta) unless explicitly overridden - Fix review: separate stderr from gh CLI JSON capture - Fix review: assert exactly one zip match - Fix review: use -Recurse in file count validation - Fix review: AST-based test for GitHub CLI ordering - Updated tests (37 pass) and README.md Agent-Logs-Url: https://github.com/Belphemur/SoundSwitch/sessions/5d94634d-af80-473e-a457-7832e43c9def Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
All review comments addressed in commit Copilot reviewer fixes:
CodeRabbit fixes:
Additional streamlining:
All 37 tests pass. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Replaces the REST API–based
Download-Release.ps1with aghCLI–drivenPublish-Release.ps1that handles the full release lifecycle, and streamlinesBuild-Installer.ps1to focus exclusively on installer compilation and code signing.New:
Publish-Release.ps1gh release list --jsongh release download, asserting exactly one matching zip (throws with file list on multiple)-BuildFromSourceto build from source instead of downloading from a draft releasereusable-build.yml) already includes these in the release zip-InstallerReleaseStateautomatically from-Channel(beta→Beta,release→Release) unless explicitly overriddenBuild-Installer.ps1 -FinalDirfor installer compilation and code signing--clobber(replaces existing assets)CHANGELOG.mdsection as the release body, prompts user for optional prepended notesyconfirmation before publishing (--draft=false)ghCLI stdout only for JSON parsing — stderr passes through to console for diagnosticsStreamlined:
Build-Installer.ps1-FinalDirparameter (defaults to.\Final) — focused exclusively on signing binaries, compiling the installer, and signing the installerISCC.exe) directly via Windows registry lookup — no longer depends on legacyMake-Installer.batSign-Binary.ps1for all code signing (binaries and installer)Install-BuildTools.ps1GitHub.clias the first winget dependencyPS 7.0 enforcement
#Requires -Version 7.0toBuild-Installer.ps1andSign-Binary.ps1— alltools/*.ps1scripts now enforce thisTests
Usage
Summary by CodeRabbit
New Features
Changes
Documentation