fix(ci): handle initial WinGet submission with wingetcreate new - #64
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe workflow checks microsoft/winget-pkgs for the target manifestPath; if present it runs ChangesConditional WinGet submission
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.yml:
- Around line 66-72: The catch block currently treats all errors as "not found";
update the catch after Invoke-WebRequest to inspect the HTTP status code on the
caught exception (from $_.Exception.Response or
$_.Exception.Response.StatusCode) and only set $packageExists = $false when that
code is 404; for any other status (401, 403, 5xx, network errors) rethrow or
throw the original exception so the workflow fails loudly. Locate the
Invoke-WebRequest call and the catch that sets $packageExists and replace the
blanket assignment with this conditional logic.
- Around line 83-87: The CI currently calls the interactive command
"wingetcreate.exe new" with automation flags (--id, --version, --submit,
--token) which can hang or fail; change the workflow to use a non-interactive
flow by replacing the interactive "wingetcreate.exe new" invocation with
"wingetcreate.exe update" for subsequent runs (or run "wingetcreate new" once
locally to generate the manifest, commit it, then use "wingetcreate.exe update
$installerUrl --id PythoughtsLabs.PythinkerCode --version $env:VERSION --submit
--token $env:WINGET_TOKEN" in the CI) so the job no longer invokes the
interactive wizard (update uses the existing manifest and is non-interactive).
🪄 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: 255f722e-ed4e-41d2-991c-5d03fa344248
📒 Files selected for processing (1)
.github/workflows/winget.yml
|
Addressed both inline findings in ce10b0d: Finding 1 (catch block, lines 66-72) — Fixed. The catch now inspects `$_.Exception.Response`:
Finding 2 (wingetcreate new, lines 83-87) — Fixed. Removed `wingetcreate new` from CI entirely. It is interactive and can hang even with automation flags. The `else` branch now throws a clear error message directing the operator to run `wingetcreate new` manually once for the initial submission. After that PR is merged into `winget-pkgs`, all future releases go through `wingetcreate update` (non-interactive, fully automated). |
* fix(update): improve native update flow (#64) * feat(soul): port blackbox agent-loop observability and session tools Add wire events for todo updates, tool skips, subagent fallback, agent-list deltas, and overflow recovery. Wire opt-in ToolUseSkipped telemetry, AgentList injection, budget nudge, microcompact pruning, ToolSearch discovery, session worktree enter/exit, and opt-in harvest-on-stop memory capture. Update changelog, architecture docs, and tests. * feat(toolset): surface cross-step dedup via ToolUseSkipped wire event Add opt-in emits_tool_use_skipped hook for cross-step duplicate visibility, pin exclusive default for unflagged plugin tools, and document the gate contract. * feat(todo): emit TodoListUpdated wire event on write/read * feat(agent): emit SubagentToolFallback wire event on unknown type * feat(soul): emit ContextOverflowRecovered wire event; assert one-shot reactive retry * feat(soul): add opt-in token-budget nudge (config-gated, one-shot per turn) * docs(agent): add brief hygiene note to Agent tool description * docs: changelog + architecture note for agent-loop best-practice port * test: refresh inline snapshots for agent-loop port * test: refresh default agent snapshot for hygiene note * test: align agent-loop port tests with wire and fail-fast semantics * test(e2e): refresh wire snapshots for TodoListUpdated events * chore(test): fix ruff/pyright and format snapshot refresh files * fix(soul): resolve merge duplicates from blackbox port integration Drop duplicate budget-nudge, ToolUseSkipped emit paths, and conflicting tests introduced when merging feat/blackbox-agent-loop-port into main. * fix(wire): remove duplicate ContextOverflowRecovered class definition * test: refresh snapshots for new worktree/tool_search tools and AgentListDelta wire events * test: fix ruff formatting and refresh wire snapshots for agent-logic-upgrade 4 files were unformatted (ruff would-reformat). 5 e2e snapshot tests were stale after new slash commands (/recap, /accept-edits, /goal, /learn, /best-practices) and skill entries were added to the wire initialize handshake. * fix: address PR #149 review comments from code-quality and security bots - ci-pythinker-host.yml: add workflow-level `permissions: contents: read` - llm.py: use urlparse hostname check instead of substring match for dashscope and workspace endpoint detection (prevents false positives from path segments) - dependencies.py: remove duplicate '=' from _VERSION_PREFIX_RE character class - test_memory_phase_bcd.py: consolidate to single import style for pythinkersoul module - test_toolset.py: replace standalone awaits with gather/assignment forms - test_toolset_concurrency.py: remove always-true redundant assertion - examples/feedback-worker/index.ts: replace .+? with [^<]*? to prevent ReDoS * fix(examples): linear parseMailbox to avoid polynomial ReDoS CodeQL flagged the angle-bracket regex in the feedback-worker example as a polynomial regular expression on uncontrolled header input. Replace it with an indexOf/slice parse that is linear in input length while preserving the "Name <addr>" parsing behavior.
Summary
winget.ymlpreviously always calledwingetcreate update, which fails when the package doesn't exist yet inmicrosoft/winget-pkgsPythoughtsLabs.PythinkerCodeexists via the GitHub API before runningwingetcreate newfor the initial submission,wingetcreate updatefor all subsequent releasesworkflow_dispatchonly)Summary by CodeRabbit