fix(ci): enforce provenance for non-metadata external edits#540
Conversation
|
Warning Review limit reached
More reviews will be available in 21 minutes and 38 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches✨ Simplify code
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 |
Motivation
baseContentas an existing entry and exempted it from full direct-PR provenance checks, which allowed external contributors to modify executable fields (e.g.installCommand,usageSnippet,downloadUrl, repo links, or MDX body) while preserving a trustedsubmittedByand bypassing provenance validation.safetyNotes/privacyNotes) with an unchanged MDX body may skip full provenance validation.Description
existingEntryHasOnlyMetadataUpdates(entry)to comparefieldsvsbaseFieldsand require unchanged MDX body before granting the existing-entry provenance exemption invalidatePrProvenanceinscripts/ci/validate-content-policy.mjs.baseFields,contentBody, andbaseContentBodyfor each entry when building the report so comparisons are reliable during validation inscripts/ci/validate-content-policy.mjs.existingEntryHasOnlyMetadataUpdatesreturns true; otherwise full direct-PR submitter checks are enforced.blocks external executable content updates on existing entries with stale provenancetotests/submission-workflows.test.tsthat verifies executable instructions cannot be changed by external PRs while preserving stalesubmittedByprovenance.Testing
pnpm exec vitest run tests/submission-workflows.test.tsand all tests passed (44 tests).Codex Task