fix: validate Codex action runtime contract - #13
Conversation
📝 WalkthroughWalkthroughThe change adds an offline Codex Action contract, aligns three maintenance workflow invocations with it, validates all pinned invocations before tests, and protects and documents the new contract and validator paths. ChangesCodex Action contract validation
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant TestScript
participant Validator
participant Contract
participant WorkflowFiles
participant RubyYAMLParser
TestScript->>Validator: run validation
Validator->>Contract: load contract
Validator->>WorkflowFiles: scan Codex Action invocations
Validator->>RubyYAMLParser: parse workflow YAML
RubyYAMLParser-->>Validator: return workflow data
Validator-->>TestScript: return success or failure
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (1)
scripts/validate-codex-action-inputs (1)
94-95: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win
--profilecheck misses compact flag form.
"--profile" in parsed_argsonly catches the flag as a separate list item. A single joined arg like"--profile=repair"would bypass this and reintroduce the named-profile drift the canonical config-copy convention is meant to prevent.♻️ Proposed fix to catch compact profile flags
- if "--profile" in parsed_args: + if any(item == "--profile" or item.startswith("--profile=") for item in parsed_args): raise ValueError(f"{location} selects an undefined named profile")🤖 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/validate-codex-action-inputs` around lines 94 - 95, Update the profile validation around the parsed_args check to reject both the standalone "--profile" argument and compact "--profile=<name>" arguments. Preserve the existing ValueError message and location context for either form.
🤖 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.
Nitpick comments:
In `@scripts/validate-codex-action-inputs`:
- Around line 94-95: Update the profile validation around the parsed_args check
to reject both the standalone "--profile" argument and compact
"--profile=<name>" arguments. Preserve the existing ValueError message and
location context for either form.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 67c2d8c6-50ff-46e4-b475-c6997992ae64
📒 Files selected for processing (8)
.github/CODEOWNERS.github/codex-action-contract.json.github/workflows/maintenance-consumer.ymlREADME.mdmaintenance/protected-paths.jsonscripts/test.shscripts/validate-codex-action-inputstest/test_maintenance.py
Summary
config.toml.Verification
scripts/test.shphp-binrelease contract remains compatiblesha256:607d0384bfabc339d50f419ee15b40331f14acb54ee8d398690b8cd78f7199f213979e6999f05895afd1d7181bc0c54fa141297fSecurity