fix(polymarket): stage exact raw-ops releases - #483
Conversation
📝 WalkthroughWalkthroughChangesPolymarket raw-ops staging
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant CutoverScript
participant CandidateRoot
participant Gate
Operator->>CutoverScript: Run stage with artifact directory and source revision
CutoverScript->>CutoverScript: Validate manifest, hashes, controls, and trust
CutoverScript->>CandidateRoot: Atomically publish immutable candidate
Gate->>CandidateRoot: Verify release binding
Operator->>Gate: Install, start, and query terminal status
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 14 UNAVAILABLE: read ECONNRESET 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 |
8d71119 to
b96d700
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@deployment/aliyun/polymarket-raw-ops-cutover.sh`:
- Around line 261-263: Update both secure_regular_file call sites in the
artifact validation loop and the stage_script validation path to append failure
handling with die, including the specific asset or path in each diagnostic.
Preserve the existing fail-closed behavior and README workflow while making
insecure or symbolic paths identifiable during manual runs.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: be554c0b-5dd7-43e2-9283-82a19ad6aef0
📒 Files selected for processing (7)
.github/workflows/acr-publish.yml.github/workflows/ci.ymldeployment/aliyun/README.mddeployment/aliyun/polymarket-raw-ops-cutover.shdeployment/aliyun/polymarket-raw-ops-shadow-gate.shdeployment/aliyun/test-polymarket-raw-ops-control-plane.shdeployment/aliyun/test-polymarket-raw-ops-stage.sh
| for asset in "${STAGE_ARTIFACT_ASSETS[@]}"; do | ||
| secure_regular_file "$artifact_dir/$asset" | ||
| done |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | rg 'deployment/aliyun/polymarket-raw-ops-cutover\.sh|README|test|tests?\.sh' || true
echo "== target file size =="
wc -l deployment/aliyun/polymarket-raw-ops-cutover.sh
echo "== relevant lines =="
sed -n '1,130p' deployment/aliyun/polymarket-raw-ops-cutover.sh
sed -n '230,280p' deployment/aliyun/polymarket-raw-ops-cutover.sh
sed -n '1010,1065p' deployment/aliyun/polymarket-raw-ops-cutover.sh
echo "== secure_regular_file occurrences =="
rg -n 'secure_regular_file|die \('\\''|-e|stage_release|STAGE_ARTIFACT_ASSETS' deployment/aliyun/polymarket-raw-ops-cutover.sh
echo "== test occurrences =="
rg -n 'symbolic artifact member|group/world-writable|artifact member|stage_release|STAGE_ARTIFACT_ASSETS|secure_regular_file|polymarket-raw-ops-cutover' -S .Repository: proerror77/monday
Length of output: 1920
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== repository availability =="
pwd
git rev-parse --is-inside-work-tree || true
git remote -v || true
git branch -a || true
echo "== files =="
git ls-files | rg '(^|/)deployment/aliyun/polymarket-raw-ops-cutover\.sh$|README|test|tests?\.sh' || true
echo "== target file size =="
wc -l deployment/aliyun/polymarket-raw-ops-cutover.sh
echo "== relevant lines =="
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
sed -n '1,130p' deployment/aliyun/polymarket-raw-ops-cutover.sh
sed -n '230,280p' deployment/aliyun/polymarket-raw-ops-cutover.sh
sed -n '1010,1065p' deployment/aliyun/polymarket-raw-ops-cutover.sh
fi
echo "== secure_regular_file occurrences =="
rg -n 'secure_regular_file|die \('\\''|-e|stage_release|STAGE_ARTIFACT_ASSETS' deployment/aliyun/polymarket-raw-ops-cutover.sh || true
echo "== test occurrences =="
rg -n 'symbolic artifact member|group/world-writable|artifact member|stage_release|STAGE_ARTIFACT_ASSETS|secure_regular_file|polymarket-raw-ops-cutover' -S . || trueRepository: proerror77/monday
Length of output: 1920
Require secure_regular_file to emit a diagnostic on failure.
secure_regular_file "$artifact_dir/$asset" and secure_regular_file "$stage_script" fail closed via errexit, but they do not report which artifact member or path was insecure or symbolic. Add || die '...' to both failure paths so manual runs preserve the existing README workflow with a clear error message.
🤖 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 `@deployment/aliyun/polymarket-raw-ops-cutover.sh` around lines 261 - 263,
Update both secure_regular_file call sites in the artifact validation loop and
the stage_script validation path to append failure handling with die, including
the specific asset or path in each diagnostic. Preserve the existing fail-closed
behavior and README workflow while making insecure or symbolic paths
identifiable during manual runs.
Change contract
Atomically stage one exact, manifest-addressed Polymarket raw-ops candidate from a root-owned artifact and exact source checkout, rejecting partial, mixed, mutable, or overwriting publication before any Gate or production mutation.
Closes #449
Out of scope
Dependency or merge order
Depends on #448 / PR #469, already merged at
3aae5ddc7c2a699c3d1b6ff95b1f322f6b8bd7e9. The separate cutover-receipt contract must follow this PR.Focused validation
bash deployment/aliyun/test-polymarket-raw-ops-stage.shbash deployment/aliyun/test-polymarket-raw-ops-control-plane.shbash -non all changed shell scriptsshellcheckon all changed shell scriptsgit diff --checkRollout / rollback impact
The new
stageaction writes only a new non-overwriting directory below/opt/monday/candidates/polymarket-raw-ops; it does not install global controls, start Gate/shadow, or mutate production. Failure removes only its private staging directory. Existing immutable releases remain untouched.Summary by CodeRabbit
New Features
Documentation
Tests