Skip to content

feat(pluginkit): read the version, requirements, hooks, jobs and settings of a manifest - #132

Merged
SirLouen merged 3 commits into
mainfrom
feat/131
Nov 5, 2026
Merged

SirLouen merged 3 commits into
mainfrom
feat/131

Conversation

@SirLouen

@SirLouen SirLouen commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Closes #131

What

  • wire.Manifest holds one plugin.json as data. It reads version, license, did, requires, tested, engines, uninstall, hooks, defines, jobs and settings, and keeps every other key raw in Extra.
  • wire.Read reads one plugin from its own file system. wire.Load reads every plugin under the roots with the checks wire.Run applies.
  • wire.Config gains an optional ManifestIndexPath, a JSON list of every manifest in wiring order that reads back into []wire.Manifest.
  • wire.Run refuses a manifest whose new keys have the wrong shape and names the entry, such as jobs[0]: every is required.

Why

A server binary ships without the plugin folders, so it cannot read a plugin.json when it boots. Today only the generator reads a manifest, and only four of its keys. A downstream application needs a plugin's version, requirements, jobs and settings at runtime, and its generator needs them to check a plugin before it wires it in.

wire checks the shape of these keys and leaves their meaning to the application. An application checks keys of its own by calling wire.Load before wire.Run.

Testing

  • A manifest with only today's keys keeps its output bytes and its error texts. Those tests passed against the old code before any change.
  • Comparing v0.8.0 with this branch over 126,401 generated scenarios gave 100,067 of 100,067 byte-identical results for manifests with only today's keys.
  • Real downstream manifests gave the same files and the same 59 error texts on both versions.
  • go test -race -shuffle=on passes with 96 tests in wire, 371 with subtests. Coverage is 99.7%, and the one missed statement is old code in packagejson.go.
  • Mutation testing killed 27 of 27 mutants in manifest.go. The 9 others that lived or were not covered are in old lines of wire.go that this change does not touch.
  • A table of hand-written hostile manifests found one panic, on a manifest nested too deep for the index. wire.Run now returns an error for it, and a test pins that. Fuzzing the reader, the index writer and the key matching found no crash.
  • CodeScene scores 10.0 on the four new files. wire.go stays at 8.74, the same as before this change.

@greptile-apps

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The wire package adds exported APIs to read one plugin manifest or load manifests from roots. It validates manifest shapes during wiring and can optionally write an ordered JSON manifest index. Tests cover parsing, validation, generated output compatibility, and index behavior.

Changes: Manifest APIs and index

Layer / File(s) Summary
Manifest model, parsing, and loading
pluginkit/wire/manifest.go, pluginkit/wire/manifest_test.go
Adds typed manifest data, parsing of known fields, retention of unknown fields in Extra, shape validation, and the Read and Load APIs. Tests cover parsing, validation, ordering, and errors.
Wiring validation and compatibility
pluginkit/wire/wire.go, pluginkit/wire/manifest_identity_test.go, pluginkit/CHANGELOG.md
Wiring now uses shared manifest parsing and shape validation. Tests check generated-file compatibility and error text, including validation failures. The changelog describes the new APIs and stated compatibility behavior.
Optional manifest index output
pluginkit/wire/wire.go, pluginkit/wire/manifest.go, pluginkit/wire/manifest_index_test.go
Config.ManifestIndexPath enables a JSON index of manifests in wiring order. Tests cover serialization, optional fields, output errors, and preservation of other generated files.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature · Severity of issue fixed: Medium

Suggested reviewers: codescene-access

Merge Risk: Minimal · up to b3233

No actionable issue is established; the change is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat(pluginkit): read the version, requirements, hooks, jobs and settings of a manifest" matches the main change. The PR adds wire.Manifest, which parses plugin.json fields including versio…
Linked Issues check Passed Issue #131 coding requirements are implemented. Manifest reads the shared fields and preserves unknown keys in Extra; Read and Load share manifest parsing; and Config.ManifestIndexPath write…
Out of Scope Changes check Passed The changes stay within issue #131. The implementation adds manifest parsing, validation, loading, index generation, and the required configuration field. The changelog and tests document and verify t…
Full details: Title check

Explanation

The title "feat(pluginkit): read the version, requirements, hooks, jobs and settings of a manifest" matches the main change. The PR adds wire.Manifest, which parses plugin.json fields including version, requires, hooks, jobs and settings. It also adds wire.Read and wire.Load and the optional Config.ManifestIndexPath. The title does not mention these loaders, the index output, or the new strict shape checks in wire.Run. That omission is acceptable because the title does not need to cover every detail. The title is specific and describes a real, central part of the change.

Full details: Linked Issues check

Explanation

Issue #131 coding requirements are implemented. Manifest reads the shared fields and preserves unknown keys in Extra; Read and Load share manifest parsing; and Config.ManifestIndexPath writes manifests in wiring order. checkShape rejects empty list entries and missing required fields, while JSON decoding rejects wrong types. wire.Run applies the checks and retains existing output behavior when indexing is disabled. The added tests cover parsing, validation, index output, ordering, round-trip loading, compatibility, and error text.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #131. The implementation adds manifest parsing, validation, loading, index generation, and the required configuration field. The changelog and tests document and verify these behaviors. No unrelated product behavior or unrelated files are changed.

Full details: Docstring Coverage

Explanation

Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 49 functions across 5 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: ddb34e14-469c-4a0e-9a00-c40fe9fad5e2
Commits

Reviewing files that changed from the base of the PR and between e9afdd4 and b3233b9.

Files selected for processing: 6
  • pluginkit/CHANGELOG.md
  • pluginkit/wire/manifest.go
  • pluginkit/wire/manifest_identity_test.go
  • pluginkit/wire/manifest_index_test.go
  • pluginkit/wire/manifest_test.go
  • pluginkit/wire/wire.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

codescene-access[bot]

This comment was marked as outdated.

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous finding is fixed and no new actionable issues were found.

Summary

This PR makes plugin manifest data available through wire.Manifest, wire.Read, and wire.Load.

  • Apps can read plugin metadata beyond the wiring fields.
  • The generator can write an ordered manifest index.

No new actionable issues were found in the changes since the previous review.

Reviews (2) · Last reviewed commit: "docs(pluginkit): correct the comments on..." · Reviewed by Greptile

Comment thread pluginkit/wire/manifest.go Resolved

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates Passed
4 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@SirLouen
SirLouen merged commit 5580b3c into main Nov 5, 2026
47 checks passed
@SirLouen
SirLouen deleted the feat/131 branch November 5, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read a plugin's version, requirements, hooks, jobs and settings from its manifest

1 participant