feat(config): docs.excludeModules — doc-only module exclusion independent of activation#3924
Conversation
…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
|
Warning Review limit reached
Next review available in: 53 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: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughAdds a docs.excludeModules filtering
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels
🚥 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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)inlib/helpers/config.jsand exports it via the config helper. - Applies
filterByDocExclusioninconfig/index.jsonly forconfig.files.openapiandconfig.files.guides, after the existing activation filter. - Adds default
docs.excludeModules: [], unit tests for the helper, and aMIGRATIONS.mdentry 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. |
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
MIGRATIONS.mdconfig/defaults/development.config.jsconfig/index.jslib/helpers/config.jslib/helpers/tests/config.filterByDocExclusion.unit.tests.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
Summary
Adds
config.docs.excludeModules(default[]) — a doc-only filter that drops a module'sdoc/*.yml(OpenAPI) +doc/guides/*.mdfrom 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), whichfilterByActivationnever filters.This lets a project keep a module runtime-active (e.g.
homeserves/api/health) while dropping only its sample docs/guides — avoiding a guide-slug collision with the project's own guides. Previously a module'sactivatedflag 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— newfilterByDocExclusion(files, config)next tofilterByActivation(noCORE_MODULESbypass; missing/empty/non-array list = no-op) + default export.config/index.js— second filter pass over theopenapi+guidesfile keys, afterfilterByActivation. Runtime file keys (routes/models/policies/...) are unaffected.config/defaults/development.config.js—docs.excludeModules: [](no behavior change).MIGRATIONS.mdentry.Testing
npm run lint— 0 issues.[]= no-op → zero behavior change for existing deployments.Closes #3923
https://claude.ai/code/session_018zwvrFqZM1y68TWA8oVW3n
Summary by CodeRabbit
New Features
Tests