Skip to content

feat(config): docs.excludeModules — doc-only module exclusion independent of activation#3924

Merged
PierreBrisorgueil merged 2 commits into
masterfrom
feat/docs-exclude-modules
Jun 29, 2026
Merged

feat(config): docs.excludeModules — doc-only module exclusion independent of activation#3924
PierreBrisorgueil merged 2 commits into
masterfrom
feat/docs-exclude-modules

Conversation

@PierreBrisorgueil

@PierreBrisorgueil PierreBrisorgueil commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds config.docs.excludeModules (default []) — a doc-only filter that drops a module's doc/*.yml (OpenAPI) + doc/guides/*.md from the public spec (/api/spec.json) and guide tree (/api/public/docs), independent of module runtime activation. It works even for core modules (core/auth/users/home), which filterByActivation never filters.

This lets a project keep a module runtime-active (e.g. home serves /api/health) while dropping only its sample docs/guides — avoiding a guide-slug collision with the project's own guides. Previously a module's activated flag gated both runtime and docs, and core modules bypassed the filter entirely, so their sample docs/guides were always served with no opt-out.

Changes

  • lib/helpers/config.js — new filterByDocExclusion(files, config) next to filterByActivation (no CORE_MODULES bypass; missing/empty/non-array list = no-op) + default export.
  • config/index.js — second filter pass over the openapi + guides file keys, after filterByActivation. Runtime file keys (routes/models/policies/...) are unaffected.
  • config/defaults/development.config.jsdocs.excludeModules: [] (no behavior change).
  • Unit tests (9, incl. core-module + no-op + exact-match cases) + MIGRATIONS.md entry.

Testing

  • npm run lint — 0 issues.
  • Unit suite green — 2102 tests (incl. 9 new).
  • Default [] = no-op → zero behavior change for existing deployments.

Closes #3923

https://claude.ai/code/session_018zwvrFqZM1y68TWA8oVW3n

Summary by CodeRabbit

  • New Features

    • Added an optional setting to exclude selected modules’ documentation from public API docs and the OpenAPI spec.
    • Documentation files for excluded modules are now hidden even when the module itself is still active.
    • Updated the migration notes with setup guidance and an example configuration.
  • Tests

    • Added coverage for module-based documentation exclusion behavior and edge cases.

…dent of activation

Add config.docs.excludeModules (default []): a doc-only filter that drops a
module's doc/*.yml (OpenAPI) + doc/guides/*.md from the public spec
(/api/spec.json) and guide tree (/api/public/docs), independent of runtime
module activation — so it works even for core modules (core/auth/users/home),
which filterByActivation never filters. Lets a project keep a module
runtime-active (e.g. home serves /api/health) while dropping only its sample
docs/guides, avoiding a guide-slug collision with the project's own guides.

- new filterByDocExclusion(files, config) helper (no CORE_MODULES bypass;
  missing/empty/non-array excludeModules = no-op)
- second filter pass over the openapi + guides file keys in config/index.js,
  after filterByActivation; runtime file keys unaffected
- default [] in config/defaults/development.config.js (no behavior change)
- unit tests + MIGRATIONS.md entry

Closes #3923

Claude-Session: https://claude.ai/code/session_018zwvrFqZM1y68TWA8oVW3n
Copilot AI review requested due to automatic review settings June 29, 2026 15:00
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@PierreBrisorgueil, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4703c25f-447a-445a-baba-0d05dbba881f

📥 Commits

Reviewing files that changed from the base of the PR and between 365af1a and bddff91.

📒 Files selected for processing (2)
  • lib/helpers/config.js
  • lib/helpers/tests/config.filterByDocExclusion.unit.tests.js

Walkthrough

Adds a config.docs.excludeModules setting (default []) and a filterByDocExclusion helper that drops doc/*.yml and doc/guides/*.md files for listed modules from config.files.openapi and config.files.guides during initGlobalConfig, independent of module activation or core status.

docs.excludeModules filtering

Layer / File(s) Summary
filterByDocExclusion helper, config wiring, default, tests, and migration
lib/helpers/config.js, config/index.js, config/defaults/development.config.js, lib/helpers/tests/config.filterByDocExclusion.unit.tests.js, MIGRATIONS.md
filterByDocExclusion(files, config) reads config.docs.excludeModules, extracts module names from file paths, and drops matching entries; initGlobalConfig applies it over openapi and guides file keys after existing activation filtering; docs.excludeModules: [] is added as a documented default; unit tests cover no-op, invalid input, single/multi-module exclusion, core module exclusion, and prefix non-match; MIGRATIONS.md documents the knob and /update-stack steps.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

  • pierreb-devkit/Node#3384: Both PRs add a post-merge module-file filtering step in initGlobalConfig via a new helper exported from lib/helpers/config.js, following the same integration pattern.
  • pierreb-devkit/Node#3453: Both PRs operate on config.files.guides populated from modules/*/doc/guides/*.md; this PR adds exclusion filtering over that same file list.

Suggested labels

Feat

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: doc-only module exclusion independent of activation.
Description check ✅ Passed The description covers the summary, implementation changes, and testing, though some template sections are omitted.
Linked Issues check ✅ Passed The changes implement the requested doc-only exclusion mechanism, including core-module handling, default empty behavior, tests, and migration notes.
Out of Scope Changes check ✅ Passed The PR appears scoped to the documented feature and related tests/docs, with no clear unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/docs-exclude-modules

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

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

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.67%. Comparing base (039f553) to head (bddff91).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3924      +/-   ##
==========================================
+ Coverage   92.66%   92.67%   +0.01%     
==========================================
  Files         169      169              
  Lines        5537     5546       +9     
  Branches     1779     1782       +3     
==========================================
+ Hits         5131     5140       +9     
  Misses        326      326              
  Partials       80       80              
Flag Coverage Δ
integration 61.07% <33.33%> (-0.05%) ⬇️
unit 74.28% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 039f553...bddff91. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI 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.

Pull request overview

Adds a new configuration knob config.docs.excludeModules to exclude specific modules’ documentation contributions (OpenAPI YAML + guide markdown) from the public spec and docs tree, without affecting whether the module is runtime-active (including core modules).

Changes:

  • Introduces filterByDocExclusion(files, config) in lib/helpers/config.js and exports it via the config helper.
  • Applies filterByDocExclusion in config/index.js only for config.files.openapi and config.files.guides, after the existing activation filter.
  • Adds default docs.excludeModules: [], unit tests for the helper, and a MIGRATIONS.md entry documenting the new knob.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
MIGRATIONS.md Documents the new docs.excludeModules knob, rationale, and downstream usage.
lib/helpers/tests/config.filterByDocExclusion.unit.tests.js Adds unit coverage for doc-only module exclusion behavior (including core-module cases).
lib/helpers/config.js Adds filterByDocExclusion helper alongside filterByActivation and exports it.
config/index.js Applies the new doc-only exclusion filter to openapi and guides file lists only.
config/defaults/development.config.js Defines default docs.excludeModules: [] and documents intended use.

Comment thread lib/helpers/config.js

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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 `@config/index.js`:
- Around line 167-175: The modified initGlobalConfig function is missing the
required JSDoc header. Add documentation for initGlobalConfig with a one-line
summary, `@param` entries for its arguments, and an async `@returns` entry
describing the resolved value so it matches the JS doc guidelines and stays easy
to locate by the initGlobalConfig symbol.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d8a3ac5e-0dc6-4892-a225-a055733a1e4b

📥 Commits

Reviewing files that changed from the base of the PR and between 039f553 and 365af1a.

📒 Files selected for processing (5)
  • MIGRATIONS.md
  • config/defaults/development.config.js
  • config/index.js
  • lib/helpers/config.js
  • lib/helpers/tests/config.filterByDocExclusion.unit.tests.js

Comment thread config/index.js
Add a `/doc/` path guard so the helper only removes files under a module's
doc/ directory — matching its doc-only contract and never touching runtime
files even if called with a broader list than the openapi+guides keys it is
wired on. Addresses PR review.

Claude-Session: https://claude.ai/code/session_018zwvrFqZM1y68TWA8oVW3n
@PierreBrisorgueil PierreBrisorgueil merged commit 7916876 into master Jun 29, 2026
8 checks passed
@PierreBrisorgueil PierreBrisorgueil deleted the feat/docs-exclude-modules branch June 29, 2026 15:40
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.

🔧 config.docs.excludeModules — decouple doc contribution from module runtime activation

2 participants