Repository navigation
Conversation
Validate that top-level YAML documents in workflows and Dependabot configuration are mappings before accessing keys. Emit a structured yaml-parse finding when top-level values are non-mapping (e.g. sequence or scalar), avoiding AttributeErrors/TypeErrors and honoring warn-only (exit 0) vs --enforce (exit 1) behavior. Co-authored-by: 4444J99 <24796448+4444J99@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
Reviewer's GuidePhase 1 now safely handles non-mapping or structurally malformed workflow and Dependabot YAML by reporting yaml-parse findings instead of crashing, while preserving enforcement semantics; regression tests cover sequence/scalar workflows and CLI exit behavior. Flow diagram for safe Phase 1 YAML validationflowchart TD
A[Load workflow or Dependabot YAML] --> B{Top-level document is a mapping?}
B -- No --> C[add yaml-parse finding]
B -- Yes --> D{Nested structures have expected types?}
D -- No --> E[Use safe empty defaults or skip malformed entries]
D -- Yes --> F[Run existing Phase 1 checks]
E --> F
F --> G[Return findings without crashing]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Phase 1 check now validates that top-level workflow and Dependabot YAML documents are mappings. When encountering non-mapping documents (e.g. sequences or scalars), it emits a structured
yaml-parsefinding without crashing.Exact test results:
python3 -m unittest discover -s tests -v: Ran 687 tests in ~33s, 0 failures/errors.python3 -m ges validate: {"valid": true, "controls": 95}python3 -m ges compile: exited 0.Fixes #508
PR created automatically by Jules for task 7136504953090155234 started by @4444J99
Summary by Sourcery
Handle non-mapping YAML documents safely during Phase 1 validation and report them as parse findings.
Bug Fixes:
yaml-parsefindings in both warn-only and enforce modes.Enhancements:
Tests: