fix: tolerate multi-document YAML and multiple << merge keys - #68
Conversation
…kends) Real GitLab configs exposed three parsing gaps that made the gitlab backend unusable on them: - multi-document YAML (gitlab-org/cli): GitLab merges documents in order, later keys winning; serde_yaml::from_str rejects the file outright - several << merge keys in one mapping (fdroid/fdroidserver): YAML 1.1 allows it; serde_yaml rejects the duplicate key - !reference custom tags: unknown tags deserialize as enum variants New src/yamlx.rs provides a shared tolerant loader (multi-doc merge, merge-key resolution with YAML 1.1 semantics, unknown tags preserved) and all four backends parse through it. Also: top-level release: is a job name in GitLab, not a keyword — it was silently dropped from scans. Verified against the real files: glab and fdroid .gitlab-ci.yml now scan cleanly (previously hard errors). 132 tests green; validation script extended with GitLab-hosted repo coverage.
|
Warning Review limit reached
Next review available in: 31 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
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 |
What
Real GitLab configs exposed three parsing gaps that made the gitlab backend hard-error on them:
spec:+ pipeline documents; GitLab merges documents in order, later keys win.serde_yaml::from_strrejects the file outright.<<merge keys in one mapping (fdroid/fdroidserver): YAML 1.1 allows it; serde_yaml rejects the duplicate key.!referencecustom tags: unknown tags surface as enum variants.How
New
src/yamlx.rs— shared tolerant loader: parses every document (folding duplicate<<keys into a sequence, preserving order), merges documents recursively, resolves merge keys with YAML 1.1 semantics (explicit keys > earlier merges > later merges), and preserves unknown-tag values. All four backends (Compose/Actions/GitLab/CircleCI) parse through it.Bonus: GitLab top-level
release:is a job name, not a keyword — it was silently dropped; removed from the non-job list.Verification
!reference)validate-real-repos.shextended with GitLab-hosted coverage