fix: harden Metalink parsing and add plugin CI - #1
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
📝 WalkthroughWalkthroughThe plugin now centralizes XML decoding, enforces Metalink parsing limits, supports fragmented XML content in CCF and DLC files, rejects empty URLs, updates typed errors, and adds release metadata, toolchain, CI, and WASM smoke-test coverage. ChangesXML Parsing Hardening
Release and Build Integration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant MetalinkDecoder
participant XMLHelpers
participant PluginError
Caller->>MetalinkDecoder: submit Metalink XML
MetalinkDecoder->>XMLHelpers: decode text and references
MetalinkDecoder->>MetalinkDecoder: enforce parsing limits
MetalinkDecoder-->>Caller: parsed files or typed error
MetalinkDecoder->>PluginError: construct XML or limit error
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 @.github/workflows/plugin-ci.yml:
- Around line 3-7: Update the workflow trigger and permission configuration so
pull_request runs receive only contents: read, while the tag push release path
retains contents: write. Split the reusable job or otherwise scope write
permissions exclusively to push events, preserving PR validation without write
access.
In `@README.md`:
- Around line 35-38: Align the README Metalink parsing guarantee with the actual
enforcement: either apply the 64 KiB text-node limit globally in the XML parsing
logic, or revise the documentation to state that it applies only to selected
Metalink fields. Ensure the documented behavior matches the implementation and
preserves the existing typed-error handling.
In `@src/ccf.rs`:
- Around line 97-100: Disable reader-level text trimming in the XML reader setup
so whitespace surrounding entity references is preserved across separate Text
events. Keep the existing trim operation applied to the fully assembled
field_text when the active field closes, preserving boundary trimming without
collapsing spaces within values such as “Rock & Roll.zip”.
In `@src/metalink.rs`:
- Around line 67-75: Update the Metalink parser handling for Event::Text,
Event::CData, and Event::GeneralRef in src/metalink.rs:67-75 so decoded content
is counted against the documented 64 KiB limit regardless of text_target,
including fragmented references. Add a regression case covering oversized text
in an ignored element at src/metalink.rs:468-497. At README.md:35-38, retain the
global-limit guarantee only after enforcement is global; otherwise document the
narrower field-only behavior.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5d0f0db3-aab7-47a2-896f-4478552bd846
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (13)
.github/workflows/plugin-ci.ymlCargo.tomlREADME.mdplugin.tomlrust-toolchain.tomlsrc/ccf.rssrc/dlc.rssrc/error.rssrc/lib.rssrc/metalink.rssrc/plugin_api.rssrc/xml.rstests/wasm_smoke.rs
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Summary
Validation
Linear: MAT-129, MAT-130
Summary by cubic
Hardens Metalink parsing with strict limits and safe text/entity handling (also caps text in ignored nodes), and closes CCF/DLC parsing gaps (reject empty URLs, preserve entity refs/whitespace, omit empty filenames). Adds reproducible plugin CI with pinned verify/release workflows and a WASM ABI smoke test. Addresses Linear: MAT-129, MAT-130.
Bug Fixes
quick-xmlto0.41.New Features
extismto=1.30.0; addrust-toolchain.tomlfor reproducible builds; bump crate/plugin to1.0.1.Written for commit c2dbadd. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores