ci: add reusable plugin-validate workflow for plugin repositories#19
Conversation
Lets any plugin repository run the spec's validator as its own CI gate in three lines (uses: .../plugin-validate.yml@main) instead of vendoring the schema or validator, which would drift. The plugin is staged under a directory named from its manifest id before validation, so repository naming conventions (feedBack-plugin-<id>) don't conflict with spec §5.2. Groundwork for an org-owned feedBack-plugin-template starter repo, where community plugins get this gate green from day one. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: gionnibgud <gionnibgud@gmail.com>
|
Warning Review limit reached
Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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 (1)
📝 WalkthroughWalkthroughAdds a reusable GitHub Actions workflow for checking out a plugin and specification ref, staging the plugin by manifest ID, and running shared validation. README documentation provides an example caller workflow. ChangesPlugin validation workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PluginRepository
participant plugin_validate
participant SpecRepository
participant GitHubActionsRunner
PluginRepository->>plugin_validate: Invoke reusable workflow
plugin_validate->>GitHubActionsRunner: Start validation job
GitHubActionsRunner->>PluginRepository: Check out plugin
GitHubActionsRunner->>SpecRepository: Check out selected spec ref
GitHubActionsRunner->>GitHubActionsRunner: Stage plugin by manifest id
GitHubActionsRunner->>SpecRepository: Run validate.py on staged plugin
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
Actionable comments posted: 2
🤖 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-validate.yml:
- Around line 40-51: Update both actions/checkout steps in the plugin validation
workflow, including the “Check out plugin” and “Check out spec” steps, to set
persist-credentials to false while preserving their existing repository, ref,
and path settings.
- Around line 60-69: Harden the staging step around SRC and manifest ID
extraction: pass inputs.plugin-dir through an environment variable instead of
interpolating it in the shell, safely handle missing or invalid plugin.json and
absent id by using a deterministic fallback ID so validate.py can report schema
errors, and reject or sanitize IDs containing path separators or traversal
components before creating staged/$ID. Preserve the existing copy and STAGED
environment setup for valid manifests.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8e74c2a3-6882-4bde-90ae-1e13bd7dcb95
📒 Files selected for processing (2)
.github/workflows/plugin-validate.ymlREADME.md
Addresses review findings on the reusable workflow:
- persist-credentials: false on both checkouts; the workflow only reads
files and never pushes, so the token has no reason to stay in the
runner's git config.
- Pass plugin-dir via env instead of interpolating ${{ }} into the shell,
removing the template-injection surface.
- Sanitise and default the manifest id before it reaches mkdir/cp. This
step runs before validate.py, so the schema's id pattern is not yet
enforced and the manifest is still untrusted: strip path components and
fall back to a placeholder when plugin.json is missing, unparseable, or
has no id.
The fallback also improves diagnostics — a bad manifest now produces
validate.py's own error (missing 'id', invalid JSON, no plugin.json)
instead of an opaque shell traceback from the staging step.
Verified against five fixtures (valid, id-less, traversal id, absent
manifest, malformed JSON): staging always succeeds, traversal stays
contained, and each invalid case fails in validate.py with its specific
message.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: gionnibgud <gionnibgud@gmail.com>
|
Thanks — both findings were valid and are addressed in 98054ff. 1. 2. Staging step — all three sub-points applied:
Verified locally by extracting the step from the parsed YAML and running it against five fixtures:
Staging exits 0 in every case; each invalid one fails in |
What
Adds
.github/workflows/plugin-validate.ymlwithon: workflow_call, plus a short README pointer. Any plugin repository can now run this spec's validator as its own CI gate in three lines:Why
tools/validate.pyresolvesschemas/plugin.schema.jsonrelative to this repo, so plugin repos can't run it without either a second checkout or vendoring the schema — and a vendored copy of the compliance check itself is guaranteed drift. This workflow keeps the schema and validation logic single-sourced here.Before validating, the plugin is staged under a directory named from its manifest
id, so a repo namedfeedBack-plugin-foowith idfoostill gets spec §5.2 (directory name == id) enforced — against the staged copy, matching how the plugin actually sits in a Host'splugins/directory after installation.Context
Groundwork for a proposed org-owned
feedBack-plugin-templatestarter repo (being discussed in the dev channel): a GitHub template repository giving community plugin authors a compliant starting point — AGPL-3.0-only license, DCO notice, schema-valid manifest, tests, and this validation gate green from day one. That shifts compliance from review-time catch-up to a red X the author fixes before anyone looks. This PR is the prerequisite: the template's CI calls this workflow instead of duplicating it.Notes
tools/check_versions.pypasses unchanged).validate.ymlalready covers the examples via direct script invocation.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation