Skip to content

Fix Chocolatey OData query encoding - #34

Merged
rianjs merged 2 commits into
mainfrom
fix/chocolatey-odata-query-encoding
Jun 4, 2026
Merged

Fix Chocolatey OData query encoding#34
rianjs merged 2 commits into
mainfrom
fix/chocolatey-odata-query-encoding

Conversation

@rianjs

@rianjs rianjs commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary\n- encode Chocolatey OData listing query spaces as %20 instead of +\n- assert the exact moderation-probe listing URL for normal and quote-containing package IDs\n\n## Tests\n- uv run --with 'pytest>=8,<9' --with defusedxml==0.7.1 python -m pytest -q actions/chocolatey-push\n- uv run --with 'pytest>=8,<9' --with PyYAML==6.0.2 --with defusedxml==0.7.1 python -m pytest -q actions\n- actionlint\n\nCloses #33

@rianjs

rianjs commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Findings

No issues found.

The diff is tightly scoped to the actual failure: it switches urlencode to quote_via=quote, preserving existing OData string escaping while changing spaces from + to %20. The tests now assert the full listing URL for both normal and quote-containing IDs, which directly guards the v0.3.60 regression. No unrelated behavior changes or error-path broadening.

Operational follow-up remains outside the PR: after merge, advance shared .github@v1 and verify it resolves to the merge commit before retrying codereview-cli.

@rianjs

rianjs commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author
  • Minor: The new exact-URL assertions in actions/chocolatey-push/test_chocolatey_push.py do cover the original +-vs-%20 regression and the doubled-quote escape case, but the higher-level 403-path tests still go through _http_get, which matches only on path substrings. That means the full retry flow would still pass if the query-string builder regressed, as long as the helper-level tests stayed in place. I’d treat that as acceptable for this fix, but it is the remaining coverage gap.

@monit-reviewer monit-reviewer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated PR Review

Reviewed commit: b94a77e

Summary

Reviewer Findings
security:security-code-auditor 1
security:security-code-auditor (1 findings)

⚠️ Should Fix - actions/chocolatey-push/chocolatey_push.py:136

Missing import for 'quote' function — the code uses 'quote_via=quote' but the import line must read 'from urllib.parse import urlencode, quote' (or equivalent). A missing import causes a NameError at runtime on the moderation probe path.

2 PR discussion threads considered.


Completed in 44s | $0.33 | sonnet | daemon 0.2.121 | Glorfindel
Field Value
Model sonnet
Reviewers hybrid-synthesis, database:database-reviewer, harness-engineering:harness-architecture-reviewer, harness-engineering:harness-enforcement-reviewer, harness-engineering:harness-knowledge-reviewer, harness-engineering:harness-self-documenting-code-reviewer, security:security-code-auditor
Engine claude · sonnet
Reviewed by pr-review-daemon · monit-pr-reviewer
Duration 44s wall · 1m 43s compute (Reviewers: 29s · Synthesis: 12s)
Cost $0.33
Tokens 212.6k in / 5.8k out
Turns 15

Per-workstream usage

Workstream Model In Out Cache read Cache create Cost
hybrid-synthesis sonnet 28.8k 449 17.4k 11.4k (1h) $0.06
database:database-reviewer sonnet 11.6k 89 4.1k 7.4k (1h) $0.03
harness-engineering:harness-architecture-reviewer sonnet 12.6k 140 4.1k 8.5k (1h) $0.04
harness-engineering:harness-enforcement-reviewer sonnet 39.1k 777 29.9k 9.2k (1h) $0.06
harness-engineering:harness-knowledge-reviewer sonnet 39.3k 1.4k 30.0k 9.3k (1h) $0.07
harness-engineering:harness-self-documenting-code-reviewer sonnet 23.4k 348 15.7k 7.7k (1h) $0.04
security:security-code-auditor haiku 57.7k 2.6k 46.7k 10.9k (1h) $0.03

Re-reviews only run when @monit-reviewer is re-requested as a reviewer — push as many commits as you need, then re-request when ready. PRs targeting branches other than main, master are skipped, even when @monit-reviewer is re-requested.

raise ProbeError(f"Chocolatey package endpoint returned HTTP {package_response.status}")

query = urlencode({"$filter": f"Id eq '{_odata_string(package_id)}'", "$orderby": "Version desc"})
query = urlencode(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium (security:security-code-auditor): Missing import for 'quote' function — the code uses 'quote_via=quote' but the import line must read 'from urllib.parse import urlencode, quote' (or equivalent). A missing import causes a NameError at runtime on the moderation probe path.

Reply to this thread when addressed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already present - quote is imported at module scope and was used before this PR.

@rianjs

rianjs commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

These are low-value, please approve the PR

@monit-reviewer
monit-reviewer dismissed their stale review June 4, 2026 15:09

Superseded by updated review

@monit-reviewer monit-reviewer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated PR Review

Reviewed commit: b94a77e

Human Override

Approved at the request of @rianjs (comment).

These are low-value, please approve the PR

No automated reviewers were run.

@rianjs
rianjs merged commit c3e474a into main Jun 4, 2026
20 checks passed
@rianjs
rianjs deleted the fix/chocolatey-odata-query-encoding branch June 4, 2026 15:10
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.

2 participants