Skip to content

docs: register plugin kind before activating it in the plugin guide#200

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
zhongxuanwang-nv:docs/plugin-register-before-activate
Jun 2, 2026
Merged

docs: register plugin kind before activating it in the plugin guide#200
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
zhongxuanwang-nv:docs/plugin-register-before-activate

Conversation

@zhongxuanwang-nv
Copy link
Copy Markdown
Member

@zhongxuanwang-nv zhongxuanwang-nv commented Jun 2, 2026

Overview

Reorder the "Register Plugin Behavior" guide so a plugin kind is registered before it is activated, and document the validate()-warns / initialize()-raises behavior. Run on its own, the Activation APIs example previously failed with RuntimeError: ... 'header-plugin' is not registered, because the kind it activates is only registered later on the page in the Header Plugin Example.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • docs/build-plugins/register-behavior.mdx: move the Header Plugin Example (which calls plugin.register("header-plugin", ...)) above the Activation APIs lifecycle so the page reads and runs top to bottom. Drop the now-redundant "Register the plugin kind" item from the activation list, and note that an unregistered kind is reported by validate() only as a warning under the default unknown_component="warn" policy, while initialize() raises. The reorder moves whole sections only; no code-block content changed (verified by an order-independent line diff).
  • docs/build-plugins/validate-configuration.mdx: add the same clarification to Validate Before Initialization — the error-only has_errors check does not catch an unknown/unregistered kind; register kinds first, or set unknown_component="error".

Heads-up: this edits the same register-behavior.mdx Activation APIs section as #199 (which adds plugin.layer(...) to that example but does not change the registration ordering). The two overlap, so whichever lands second will need a small conflict resolution.

Where should the reviewer start?

docs/build-plugins/register-behavior.mdx — confirm the section reorder preserved every code block (an order-independent line diff shows only the numbered list and intro changed) and that the Activation APIs example now follows the Header Plugin Example that registers the kind.

Verified locally: running the Header Plugin Example block and then the Activation APIs block in one process registers header-plugin, after which validate() / initialize() / clear() succeed with empty diagnostics and no RuntimeError. Targeted pre-commit (trailing whitespace, end-of-files, docs markdown linkcheck) passes on both files.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • Documentation
    • Clarified that plugin kinds must be registered before calling initialize()
    • Explained that unknown/unregistered component kinds are reported as warnings by default during validation and may still cause errors at initialization unless policy is changed
    • Reorganized and updated the activation guide and language across Python/Node/Rust examples for clearer ordering and guidance

@zhongxuanwang-nv zhongxuanwang-nv requested a review from a team as a code owner June 2, 2026 19:37
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 5b6200c8-6691-4862-82f4-f3ade5964321

📥 Commits

Reviewing files that changed from the base of the PR and between 04a1c79 and e742610.

📒 Files selected for processing (2)
  • docs/build-plugins/register-behavior.mdx
  • docs/build-plugins/validate-configuration.mdx
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (11)
{docs/**,README.md,CONTRIBUTING.md}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

{docs/**,README.md,CONTRIBUTING.md}: For docs-only changes, run targeted checks only if commands, package names, or examples changed. Use just docs for docs-site builds and just docs-linkcheck when links changed
Run docs site build with just docs

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
{docs/**,README.md,CONTRIBUTING.md,**/*.md}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

Run docs link validation with just docs-linkcheck when links change

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
{docs/**,README.md}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

Verify README and docs entry points still match current package names and paths for large or public-facing changes

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
{docs/**,examples/**,README.md}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

Verify examples still run with documented commands for large or public-facing changes

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
{docs/**,README.md,**/Cargo.toml,**/package.json,**/*.md}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

Ensure renamed public surfaces are reflected consistently in manifests and docs for large or public-facing changes

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
**/*.{md,mdx,py,sh,yaml,yml,toml,json}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repo references, and build commands current

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
**/*.mdx

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

In MDX files, top-of-file comments must use JSX comment delimiters: {/* to open and */} to close. Do not use HTML comments for MDX SPDX headers.

MDX top-of-file SPDX comments must use {/* ... */} delimiters instead of HTML comment delimiters (Must-Fix)

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
**/*.{html,md,mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include SPDX license header in HTML and Markdown files using HTML comment syntax

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update embedded documentation snippets, patch docs, and binding-support notes if examples or supported bindings changed

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
docs/**

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run just docs or ./scripts/build-docs.sh html to regenerate ignored Fern API reference pages before validation for documentation site changes

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.
Flag stale examples, missing SPDX headers where required, and instructions that no longer match CI or pre-commit behavior.

Files:

  • docs/build-plugins/validate-configuration.mdx
  • docs/build-plugins/register-behavior.mdx
🔇 Additional comments (2)
docs/build-plugins/register-behavior.mdx (1)

184-260: LGTM!

docs/build-plugins/validate-configuration.mdx (1)

129-135: LGTM!


Walkthrough

This PR updates plugin initialization documentation to clarify that component kinds must be registered before calling initialize(). It explains that validate() only warns for unregistered kinds under the default unknown_component="warn" policy, while initialize() raises an error, and provides updated activation examples.

Changes

Plugin Initialization Validation Documentation

Layer / File(s) Summary
Validation vs initialization behavior for unregistered component kinds
docs/build-plugins/register-behavior.mdx, docs/build-plugins/validate-configuration.mdx
New "Activation APIs" section documents the requirement to register plugin kinds before initialize() with tabbed Python/Node.js/Rust examples. Validation section clarified to explain the default unknown_component="warn" policy allows validation to pass (with warnings only) while initialize() still raises unless kinds are pre-registered or the policy is set to error on unknown components.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title follows Conventional Commits format with 'docs' type and concise imperative summary under 72 characters.
Description check ✅ Passed Description includes all required sections: Overview with confirmation checkboxes, detailed changes, reviewer guidance, and related issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:M PR is medium Documentation documentation-related labels Jun 2, 2026
willkill07
willkill07 previously approved these changes Jun 2, 2026
Comment thread docs/build-plugins/validate-configuration.mdx Outdated
@willkill07 willkill07 added this to the 0.4 milestone Jun 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

The "Register Plugin Behavior" guide showed the Activation APIs example
(build, validate, initialize) ahead of the Header Plugin Example that
registers the `header-plugin` kind. Run on its own, the activation snippet
failed with `RuntimeError: ... 'header-plugin' is not registered`, and the
"Validate Plugin Configuration" pre-flight did not catch it: an unregistered
kind is only a warning under the default `unknown_component="warn"` policy, so
the error-only `has_errors` check passed while `initialize()` raised.

Reorder register-behavior.mdx so the Header Plugin Example (which registers the
kind) precedes the Activation APIs lifecycle, drop the now-redundant "register
the plugin kind" list item, and document the validate-warns / initialize-raises
behavior in both the register-behavior and validate-configuration guides. The
reorder moves whole sections only; no code-block content changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
@zhongxuanwang-nv
Copy link
Copy Markdown
Member Author

/merge

@willkill07
Copy link
Copy Markdown
Member

/merge

@rapids-bot rapids-bot Bot merged commit 603d337 into NVIDIA:main Jun 2, 2026
25 checks passed
yczhang-nv pushed a commit to yczhang-nv/NeMo-Flow that referenced this pull request Jun 3, 2026
…VIDIA#200)

#### Overview

Reorder the "Register Plugin Behavior" guide so a plugin kind is registered before it is activated, and document the `validate()`-warns / `initialize()`-raises behavior. Run on its own, the **Activation APIs** example previously failed with `RuntimeError: ... 'header-plugin' is not registered`, because the kind it activates is only registered later on the page in the **Header Plugin Example**.

- [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license.
- [x] I searched existing issues and open pull requests, and this does not duplicate existing work.

#### Details

- `docs/build-plugins/register-behavior.mdx`: move the **Header Plugin Example** (which calls `plugin.register("header-plugin", ...)`) above the **Activation APIs** lifecycle so the page reads and runs top to bottom. Drop the now-redundant "Register the plugin kind" item from the activation list, and note that an unregistered kind is reported by `validate()` only as a warning under the default `unknown_component="warn"` policy, while `initialize()` raises. The reorder moves whole sections only; no code-block content changed (verified by an order-independent line diff).
- `docs/build-plugins/validate-configuration.mdx`: add the same clarification to **Validate Before Initialization** — the error-only `has_errors` check does not catch an unknown/unregistered kind; register kinds first, or set `unknown_component="error"`.

Heads-up: this edits the same `register-behavior.mdx` **Activation APIs** section as NVIDIA#199 (which adds `plugin.layer(...)` to that example but does not change the registration ordering). The two overlap, so whichever lands second will need a small conflict resolution.

#### Where should the reviewer start?

`docs/build-plugins/register-behavior.mdx` — confirm the section reorder preserved every code block (an order-independent line diff shows only the numbered list and intro changed) and that the Activation APIs example now follows the Header Plugin Example that registers the kind.

Verified locally: running the Header Plugin Example block and then the Activation APIs block in one process registers `header-plugin`, after which `validate()` / `initialize()` / `clear()` succeed with empty diagnostics and no `RuntimeError`. Targeted `pre-commit` (trailing whitespace, end-of-files, docs markdown linkcheck) passes on both files.

#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

- Relates to: NVIDIA#199 (edits the same `register-behavior.mdx` section)

## Summary by CodeRabbit

* **Documentation**
  * Clarified that plugin kinds must be registered before calling initialize()
  * Explained that unknown/unregistered component kinds are reported as warnings by default during validation and may still cause errors at initialization unless policy is changed
  * Reorganized and updated the activation guide and language across Python/Node/Rust examples for clearer ordering and guidance

Authors:
  - Zhongxuan (Daniel) Wang (https://github.com/zhongxuanwang-nv)

Approvers:
  - Will Killian (https://github.com/willkill07)

URL: NVIDIA#200
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation documentation-related size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants