Skip to content

Codex/raycast suggestion integration - #143

Open
tonythethompson wants to merge 13 commits into
masterfrom
codex/raycast-suggestion-integration
Open

Codex/raycast suggestion integration#143
tonythethompson wants to merge 13 commits into
masterfrom
codex/raycast-suggestion-integration

Conversation

@tonythethompson

@tonythethompson tonythethompson commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary by cubic

Integrates Raycast command suggestions into Quick Shell and includes Suggest.exe in Windows builds so Store installs have suggestions out of the box. Also refreshes install docs and gallery metadata to use tonythethompson.QuickShell (bundled) and tonythethompson.QuickShellforCmdPal (CmdPal-only), and adds a safer gallery submit script.

  • New Features

    • Show Raycast suggestions during manual workspace creation; hide the dropdown when empty and keep local options selectable.
    • Build Suggest.exe on Windows prebuild/prepublish and include it in Store packages.
    • Add ensure-raycast-suggest.ps1 to build/test/deploy Suggest with smoke checks.
  • Bug Fixes

    • Validate Suggest CLI payloads and JSON key casing, parse --generation as long, and avoid logging local paths.
    • Catch Suggest failures and fall back to local heuristics to keep flows working.
    • Align deploy config and tighten smoke tests, path handling, and BuildOnly/SkipDeploy behavior.

Written for commit 6d1534d. Summary will update on new commits.

Review in cubic

tonythethompson and others added 13 commits July 29, 2026 06:34
Generate Suggest.exe on Windows prebuild/prepublish so Store packages include it, hide the empty disabled dropdown, and leave local-heuristic leftovers selectable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Ensure Store publish builds Suggest.exe, validate CLI payloads before use, and avoid logging local paths on Suggest failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
Parse --generation as long so Date.now() values echo correctly, pass the form request counter into Suggest, and add ensure-raycast-suggest.ps1 for Suggest publish plus Raycast deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Validate each suggestion pill shape before use, and make the ensure helper safer for smoke-test JSON and SkipDeploy/stop paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
Catch unexpected Suggest failures so form flows fall back locally, and tighten ensure-raycast-suggest smoke-test and BuildOnly/SkipDeploy behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
Require absolute SkipDeploy paths, numeric generation without string coercion, valid pill shapes, and BuildOnly-specific completion output.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pass Configuration through Deploy-RaycastExtension and require exact lowercase smoke-test JSON property names.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tonythethompson
tonythethompson marked this pull request as ready for review July 30, 2026 23:02
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai sourcery-ai 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.

Sorry @tonythethompson, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The changes update WinGet package identifiers and publication guidance, add installation commands to the documentation website, and revise the gallery submission script with configurable PR content, timestamped branches, safer cleanup, and normal push handling.

Changes

WinGet installation and publishing

Layer / File(s) Summary
Package identifiers and publication status
.gitignore, cmdpal-gallery/..., README.md, docs/release-packages.md, winget/README.md
Updated the CmdPal WinGet identifier, documented published and pending packages, clarified update workflows, and ignored generated WinGet output.
Installation guidance and website controls
docs/install.md, docs/index.md, docs/assets/css/main.scss
Distinguished bundled and CmdPal-only installation options and added styled WinGet commands, a hero button, and links to additional installation options.
Gallery submission workflow
scripts/submit-cmdpal-gallery.ps1
Added timestamped branches and configurable PR content, improved dry-run output, guaranteed directory restoration, skipped empty commits, and replaced force-pushing with normal push handling.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 6 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes Raycast suggestion integration, but the changes concern WinGet packages, documentation, styling, and gallery submission automation. Rename the pull request to accurately summarize the WinGet packaging, documentation, and gallery workflow updates.
Description check ❓ Inconclusive No pull request description was provided, so the intent and scope of the WinGet and workflow changes are not documented. Add a brief description explaining the WinGet package updates, installation documentation changes, and submission script improvements.
✅ Passed checks (6 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.
Pipeline Stage Enum Ordering ✅ Passed PASS: The PR changes only docs, metadata, ignore rules, and a PowerShell script; no SessionWorkflowStage enum, members, or comparisons exist in the diff or tracked solution.
Gpu/Cpu Runtime Boundary ✅ Passed PR changes only documentation, gallery metadata, CSS, .gitignore, and a PowerShell script; no inference/, managed requirements, main.py, or diarization C# files changed.
Managed Host Restart Safety ✅ Passed Not applicable: the PR changes only docs, metadata, gallery config, and a submission script; none of the managed-host or provider-readiness implementations are modified.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/raycast-suggestion-integration
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/raycast-suggestion-integration

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

@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: 4

Caution

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

⚠️ Outside diff range comments (1)
scripts/submit-cmdpal-gallery.ps1 (1)

38-54: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Handle fork/sync/clone failures explicitly.

$ErrorActionPreference = 'Stop' does not terminate on non-zero native-command exit codes. Check $LASTEXITCODE after gh repo fork, gh repo sync, and gh repo clone; also avoid discarding sync diagnostics. Otherwise the script can continue with an invalid or partial workspace and fail misleadingly later.

🤖 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 `@scripts/submit-cmdpal-gallery.ps1` around lines 38 - 54, Update the fork,
sync, and clone flow around gh repo fork, gh repo sync, and gh repo clone to
check $LASTEXITCODE immediately after each command and terminate with a clear
error when it is nonzero. Stop suppressing gh repo sync diagnostics so failures
remain visible, and prevent subsequent workspace operations after any failed
command.
🤖 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 `@docs/release-packages.md`:
- Line 59: Remove the stale CmdPal soft-skip wording from
docs/release-packages.md:59, while retaining the note that QuickShellforRun
awaits its initial package merge. Also update winget/README.md:20-24,
docs/install.md:37-44, and docs/index.md:23-27 to remove any equivalent CmdPal
soft-skip references; no other workflow behavior changes are needed.

In `@scripts/submit-cmdpal-gallery.ps1`:
- Around line 60-62: Update the cleanup command in the replacement flow around
Get-ChildItem and Remove-Item so removal failures are not silently ignored;
remove or replace ErrorAction SilentlyContinue with failure behavior that stops
the operation before Copy-Item runs, ensuring stale files cannot remain.
- Around line 77-88: Update the PowerShell here-string assigned to $Body to
avoid the non-ASCII ≤ character by expressing the same constraint with ASCII
characters, or save the script with an explicit UTF-8 BOM; ensure the generated
PR body remains readable in Windows PowerShell 5.1.
- Around line 91-95: Check the exit status of the gh pr create invocation before
printing success in the surrounding submission flow. Only write “PR opened” when
the command succeeds and returns a valid URL; otherwise propagate or report the
failure and avoid the misleading success message, while preserving cleanup of
$bodyFile.

---

Outside diff comments:
In `@scripts/submit-cmdpal-gallery.ps1`:
- Around line 38-54: Update the fork, sync, and clone flow around gh repo fork,
gh repo sync, and gh repo clone to check $LASTEXITCODE immediately after each
command and terminate with a clear error when it is nonzero. Stop suppressing gh
repo sync diagnostics so failures remain visible, and prevent subsequent
workspace operations after any failed command.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: cb55e629-acf9-4afd-9a97-dd82084cc806

📥 Commits

Reviewing files that changed from the base of the PR and between 9eba43d and 6d1534d.

📒 Files selected for processing (10)
  • .gitignore
  • README.md
  • cmdpal-gallery/README.md
  • cmdpal-gallery/extensions/tonythethompson/quickshell/extension.json
  • docs/assets/css/main.scss
  • docs/index.md
  • docs/install.md
  • docs/release-packages.md
  • scripts/submit-cmdpal-gallery.ps1
  • winget/README.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Trackdubllc/Trackdub (manual)
  • tonythethompson/QuickShell (manual)
  • tonythethompson/numan (manual)
  • tonythethompson/dependency-chain-substrate (manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: .NET build and test
  • GitHub Check: Performance harness (artifacts)
  • GitHub Check: Raycast lint, test, and build
🧰 Additional context used
📓 Path-based instructions (2)
.gitignore

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

If using git, do not ignore **/Properties/launchSettings.json or *.pubxml, because these files are required for deployment.

Files:

  • .gitignore
scripts/*.ps1

📄 CodeRabbit inference engine (AGENTS.md)

Use the required x64 or ARM64 platform when invoking .NET build and test commands; deploy the MSIX rather than merely building it when validating CmdPal changes.

Files:

  • scripts/submit-cmdpal-gallery.ps1
🪛 LanguageTool
winget/README.md

[grammar] ~24-~24: Ensure spelling is correct
Context: ...package exists in microsoft/winget-pkgs. Subsequent releases for published IDs a...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[uncategorized] ~24-~24: The official name of this software platform is spelled with a capital “H”.
Context: ...ases for published IDs are submitted by .github/workflows/release-extension.yml.

(GITHUB)

🪛 PSScriptAnalyzer (1.25.0)
scripts/submit-cmdpal-gallery.ps1

[warning] Missing BOM encoding for non-ASCII encoded file 'submit-cmdpal-gallery.ps1'

(PSUseBOMForUnicodeEncodedFile)


[warning] Missing BOM encoding for non-ASCII encoded file 'submit-cmdpal-gallery.ps1'

(PSUseBOMForUnicodeEncodedFile)


[warning] Missing BOM encoding for non-ASCII encoded file 'submit-cmdpal-gallery.ps1'

(PSUseBOMForUnicodeEncodedFile)

🔍 Remote MCP GitHub Copilot

Relevant review context

  • Scope mismatch: PR #143 is titled “Codex/raycast suggestion integration,” but its 10 changed files are limited to WinGet/docs, CmdPal gallery metadata, CSS, and a PowerShell submission script; no Raycast source files are changed.

  • WinGet ignore entry is used: scripts/submit-winget-package.ps1 generates winget-out/<PackageId> before patching manifests and submitting them. Related PR #122 introduced this local-output submission flow, so the new .gitignore entry aligns with existing automation.,

  • Package-status inconsistency: The PR documentation says QuickShellforCmdPal was initially published at 0.2.3.0, while the repository’s corresponding template manifests remain at 0.2.0.0 with placeholder hashes. The release workflow also retains a comment saying the package is soft-skipped until initial publication.

  • Gallery mapping is internally consistent: extension.json now points to tonythethompson.QuickShellforCmdPal, matching the repository documentation’s CmdPal-only/Store-equivalent description. The README also states both installers share an AppId and replace one another when installed.

  • Script wording versus command: The gallery script describes normal pushing with “no force,” but still runs gh repo sync ... --force for fork synchronization. Review whether force-syncing the fork’s default branch is intentional.

  • CI is not final: Raycast macOS passed and NuGet passed, but .NET build/test, performance, and another Raycast job were still in progress; the commit status remained pending.

🔇 Additional comments (6)
.gitignore (1)

13-13: LGTM!

cmdpal-gallery/extensions/tonythethompson/quickshell/extension.json (1)

32-32: LGTM!

cmdpal-gallery/README.md (1)

14-18: LGTM!

Also applies to: 29-30

README.md (1)

284-284: LGTM!

Also applies to: 295-295

docs/assets/css/main.scss (1)

324-337: LGTM!

scripts/submit-cmdpal-gallery.ps1 (1)

3-9: LGTM!

Also applies to: 22-27, 56-59, 63-76, 96-99

Comment thread docs/release-packages.md
```

Initial manifests for `QuickShellforCmdPal` and `QuickShellforRun` must be created in [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs) before CI can auto-submit updates for those IDs. Until then, release CI updates **`tonythethompson.QuickShell`** (bundled) and soft-skips the missing packages. The release workflow submits updates when `WINGET_PAT` is configured.
`tonythethompson.QuickShell` (bundled) and `tonythethompson.QuickShellforCmdPal` are published in [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs); release CI submits version bumps for both when `WINGET_PAT` is configured. `tonythethompson.QuickShellforRun` still needs its initial package merge before CI can auto-update that ID (soft-skip until then).

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.

🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
printf '%s\n' '--- workflow references ---'
rg -n -C 8 'QuickShellforCmdPal|QuickShellforRun|wingetcreate|soft.skip|soft-skip|WINGET_PAT' .github/workflows/release-extension.yml || true
printf '%s\n' '--- documented claims ---'
rg -n -C 3 'QuickShellforCmdPal|QuickShellforRun|winget install|WinGet|wingetcreate' docs/release-packages.md winget/README.md docs/install.md docs/index.md || true
printf '%s\n' '--- repository metadata ---'
git remote -v | head -4

Repository: tonythethompson/QuickShell

Length of output: 19455


🏁 Script executed (no clone):

#!/bin/bash
set -o pipefail
for id in tonythethompson.QuickShell tonythethompson.QuickShellforCmdPal tonythethompson.QuickShellforRun; do
  printf '\n--- %s ---\n' "$id"
  curl -sS -L --max-time 20 \
    -H 'Accept: application/vnd.github+json' \
    "https://api.github.com/repos/microsoft/winget-pkgs/contents/manifests/t/tonythethompson/$id" |
    jq -r 'if type=="array" then .[] | [.name,.type,.html_url] | `@tsv` elif .message then .message else . end' || true
done

Length of output: 746


🏁 Script executed:

#!/bin/bash
printf '%s\n' '--- submit script structure ---'
fd -i 'submit-winget-package.ps1' .
printf '%s\n' '--- script references and logic ---'
rg -n -C 8 'PackageId|wingetcreate|soft|skip|WINGET_PAT|manifest|search|update|throw' scripts/submit-winget-package.ps1
printf '%s\n' '--- local winget manifests ---'
find winget -maxdepth 4 -type f -print | sort

Repository: tonythethompson/QuickShell

Length of output: 5067


🌐 Web query:

Search the public web for the exact WinGet package IDs "tonythethompson.QuickShellforCmdPal", "tonythethompson.QuickShell", and "tonythethompson.QuickShellforRun"; determine which IDs currently have manifests/listings in microsoft/winget-pkgs or a public WinGet package index.

💡 Result:

As of July 30, 2026, all three requested WinGet package IDs have manifests/listings in the microsoft/winget-pkgs public repository [1][2]. The developer, tonythethompson, maintains an automated release workflow that submits updates for these three distinct packages [1][3][2]: 1. tonythethompson.QuickShell: This is the bundled package, which installs both the PowerToys Command Palette extension and the PowerToys Run plugin [4][5]. 2. tonythethompson.QuickShellforCmdPal: This package installs only the PowerToys Command Palette extension [4][5]. 3. tonythethompson.QuickShellforRun: This package installs only the PowerToys Run plugin [1][2]. These packages are explicitly managed and submitted by the developer via the official WinGet submission process [3][2], and documentation within the project repository confirms their availability for installation via the winget command-line tool [4][5].

Citations:


🏁 Script executed:

#!/bin/bash
printf '%s\n' '--- local manifest identities ---'
for f in winget/*.yaml; do
  printf '\n--- %s ---\n' "$f"
  rg -n '^(PackageIdentifier|PackageVersion|ManifestType|ManifestVersion):' "$f" || true
done

Repository: tonythethompson/QuickShell

Length of output: 1348


🏁 Script executed (no clone):

#!/bin/bash
set -o pipefail
base='https://raw.githubusercontent.com/microsoft/winget-pkgs/master/manifests/t/tonythethompson'
for id in QuickShell QuickShellforCmdPal QuickShellforRun; do
  printf '\n--- %s directory probe ---\n' "$id"
  for version in 0.2.3.0 0.2.4.0 0.2.5.0; do
    url="$base/$id/$version/$id.yaml"
    code=$(curl -sS -L --max-time 20 -o /tmp/winget-probe.yaml -w '%{http_code}' "$url")
    printf '%s %s\n' "$version" "$code"
    if [ "$code" = 200 ]; then
      sed -n '1,12p' /tmp/winget-probe.yaml
    fi
  done
done

Length of output: 356


🏁 Script executed (no clone):

#!/bin/bash
set -o pipefail
ids='tonythethompson.QuickShell tonythethompson.QuickShellforCmdPal tonythethompson.QuickShellforRun'
for id in $ids; do
  printf '\n=== %s ===\n' "$id"
  for url in \
    "https://winget.run/pkg/$id" \
    "https://winstall.app/apps/$id" \
    "https://github.com/microsoft/winget-pkgs/tree/master/manifests/t/tonythethompson/${id#tonythethompson.}"; do
    printf '%s\n' "$url"
    curl -sS -L --max-time 20 -o /tmp/index-probe.html -w 'HTTP %{http_code}, bytes %{size_download}\n' "$url"
    rg -o -i '.{0,100}(PackageVersion|not found|404|QuickShellforCmdPal|QuickShellforRun|QuickShell).{0,160}' /tmp/index-probe.html | head -8 || true
  done
done

Length of output: 12258


🌐 Web query:

Search specifically for the current microsoft/winget-pkgs manifest directory or package-index entry for tonythethompson.QuickShellforCmdPal, including its published PackageVersion and direct manifest URL. Do not infer publication solely from QuickShell repository documentation or workflow files.

💡 Result:

There is no package with the identifier tonythethompson.QuickShellforCmdPal in the official microsoft/winget-pkgs repository. While Anthony Thompson (tonythethompson) is the developer of a project called Quick Shell, which is a PowerToys Command Palette extension, there is no evidence that this specific software has been submitted to or published in the Microsoft Windows Package Manager community repository under the specified ID. Available search results confirm the existence of the developer's project and their use of automation workflows for winget, but they do not substantiate the existence of a manifest entry for this package in the microsoft/winget-pkgs directory.

Citations:


Remove the stale CmdPal soft-skip comment.

tonythethompson.QuickShellforCmdPal is published, and the script already updates existing packages; soft-skip applies only when an ID is missing. Documentation and workflow behavior otherwise agree.

📍 Affects 4 files
  • docs/release-packages.md#L59-L59 (this comment)
  • winget/README.md#L20-L24
  • docs/install.md#L37-L44
  • docs/index.md#L23-L27
🤖 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 `@docs/release-packages.md` at line 59, Remove the stale CmdPal soft-skip
wording from docs/release-packages.md:59, while retaining the note that
QuickShellforRun awaits its initial package merge. Also update
winget/README.md:20-24, docs/install.md:37-44, and docs/index.md:23-27 to remove
any equivalent CmdPal soft-skip references; no other workflow behavior changes
are needed.

Comment on lines +60 to +62
# Replace listing contents so renamed/removed screenshots do not linger.
Get-ChildItem -Force $dest | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
Copy-Item -Recurse -Force (Join-Path $source '*') $dest

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.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

-ErrorAction SilentlyContinue can defeat the stated purpose of the cleanup.

The comment says this replace-before-copy step exists so "renamed/removed screenshots do not linger", but a failed Remove-Item (e.g. a locked/read-only file) is silently ignored, so the stale file would linger and get merged with the freshly copied content — the opposite of the intent.

🧰 Tools
🪛 PSScriptAnalyzer (1.25.0)

[warning] Missing BOM encoding for non-ASCII encoded file 'submit-cmdpal-gallery.ps1'

(PSUseBOMForUnicodeEncodedFile)

🤖 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 `@scripts/submit-cmdpal-gallery.ps1` around lines 60 - 62, Update the cleanup
command in the replacement flow around Get-ChildItem and Remove-Item so removal
failures are not silently ignored; remove or replace ErrorAction
SilentlyContinue with failure behavior that stops the operation before Copy-Item
runs, ensuring stale files cannot remain.

Comment on lines +77 to +88
$Body = @"
## Summary
Updates the **Quick Shell** Command Palette Extension Gallery listing.

- New product logo (`icon.png`, Store AppTile)
- Screenshots refreshed for current workspace UI (list, create, settings, detail)
- Description/tags aligned with current product language
- Install sources unchanged: Microsoft Store `9PC8S6LNRT3R`, WinGet `tonythethompson.QuickShell`
Describe only what this PR changes (for example logo, screenshots, copy, or install sources). Do not reuse stale bullets from a prior submission.

## Test plan
- [ ] CI schema validation passes
- [ ] Store product ID resolves
- [ ] Icon under 100 KB; screenshots under 1 MB each
- [ ] Store / WinGet install source IDs resolve
- [ ] Icon under 100 KB; screenshots under 1 MB each (when media changed)
- [ ] Tags ≤ 5
'@ | Set-Content -Path $bodyFile -Encoding utf8
$prUrl = gh pr create --repo $upstream --head "${login}:$Branch" --title 'Update tonythethompson.quickshell gallery listing' --body-file $bodyFile
Remove-Item $bodyFile -Force -ErrorAction SilentlyContinue
Pop-Location
Write-Host "PR opened: $prUrl"
"@

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Non-ASCII plus missing BOM risks garbled PR-body text.

Static analysis flags this file as missing a BOM for its non-ASCII content; the on Line 87 is that content. On Windows PowerShell 5.1 (non-Core), a script file without a BOM is read using the system codepage, so this literal can render as mojibake in the generated PR body. Saving with a UTF-8 BOM, or just using <=, sidesteps the issue.

🧰 Tools
🪛 PSScriptAnalyzer (1.25.0)

[warning] Missing BOM encoding for non-ASCII encoded file 'submit-cmdpal-gallery.ps1'

(PSUseBOMForUnicodeEncodedFile)

🤖 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 `@scripts/submit-cmdpal-gallery.ps1` around lines 77 - 88, Update the
PowerShell here-string assigned to $Body to avoid the non-ASCII ≤ character by
expressing the same constraint with ASCII characters, or save the script with an
explicit UTF-8 BOM; ensure the generated PR body remains readable in Windows
PowerShell 5.1.

Source: Linters/SAST tools

Comment on lines +91 to +95
$bodyFile = Join-Path $env:TEMP 'cmdpal-gallery-pr-body.md'
Set-Content -Path $bodyFile -Value $Body -Encoding utf8
$prUrl = gh pr create --repo $upstream --head "${login}:$Branch" --title $Title --body-file $bodyFile
Remove-Item $bodyFile -Force -ErrorAction SilentlyContinue
Write-Host "PR opened: $prUrl"

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

gh pr create failure is not detected, so a failed run can still print "PR opened".

$prUrl = gh pr create ... has no exit-code check. If PR creation fails (auth scope issue, existing PR for the branch, network blip), $prUrl will be empty or contain error text, yet Line 95 unconditionally prints "PR opened: $prUrl", misleading whoever runs the script into believing the submission succeeded.

🛠️ Proposed fix
     $prUrl = gh pr create --repo $upstream --head "${login}:$Branch" --title $Title --body-file $bodyFile
+    if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($prUrl)) {
+        Remove-Item $bodyFile -Force -ErrorAction SilentlyContinue
+        throw 'gh pr create failed; no PR was opened.'
+    }
     Remove-Item $bodyFile -Force -ErrorAction SilentlyContinue
     Write-Host "PR opened: $prUrl"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$bodyFile = Join-Path $env:TEMP 'cmdpal-gallery-pr-body.md'
Set-Content -Path $bodyFile -Value $Body -Encoding utf8
$prUrl = gh pr create --repo $upstream --head "${login}:$Branch" --title $Title --body-file $bodyFile
Remove-Item $bodyFile -Force -ErrorAction SilentlyContinue
Write-Host "PR opened: $prUrl"
$bodyFile = Join-Path $env:TEMP 'cmdpal-gallery-pr-body.md'
Set-Content -Path $bodyFile -Value $Body -Encoding utf8
$prUrl = gh pr create --repo $upstream --head "${login}:$Branch" --title $Title --body-file $bodyFile
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($prUrl)) {
Remove-Item $bodyFile -Force -ErrorAction SilentlyContinue
throw 'gh pr create failed; no PR was opened.'
}
Remove-Item $bodyFile -Force -ErrorAction SilentlyContinue
Write-Host "PR opened: $prUrl"
🧰 Tools
🪛 PSScriptAnalyzer (1.25.0)

[warning] Missing BOM encoding for non-ASCII encoded file 'submit-cmdpal-gallery.ps1'

(PSUseBOMForUnicodeEncodedFile)

🤖 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 `@scripts/submit-cmdpal-gallery.ps1` around lines 91 - 95, Check the exit
status of the gh pr create invocation before printing success in the surrounding
submission flow. Only write “PR opened” when the command succeeds and returns a
valid URL; otherwise propagate or report the failure and avoid the misleading
success message, while preserving cleanup of $bodyFile.

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