Skip to content

Ensure default module is always documented#44480

Open
amika-d wants to merge 1 commit into
ballerina-platform:masterfrom
amika-d:fix/docerina-default-module-docs
Open

Ensure default module is always documented#44480
amika-d wants to merge 1 commit into
ballerina-platform:masterfrom
amika-d:fix/docerina-default-module-docs

Conversation

@amika-d
Copy link
Copy Markdown

@amika-d amika-d commented Feb 10, 2026

Purpose

Currently, bal doc generates a blank screen for the default module of certain libraries (like ballerinax/mysql) because the docerina generator skips modules that are not explicitly listed in the exportedModules list.

This PR fixes the issue by ensuring that Default Modules are always processed, regardless of the export list configuration.

Approach

Updated BallerinaDocGenerator.java to bypass the exportedModules check if module.isDefaultModule() is true. This ensures the main module of a package is never hidden by the documentation tool.

Automation Tests

  • Unit tests added
  • Manual verification

Verification Details:
Verified locally by running the patched tool against a reproduction of the ballerinax/mysql project. The API documentation for the default module, which previously resulted in a blank screen, now generates correctly.

Fixes #44476

ballerina-fix.mp4

The docerina tool currently skips modules that are not explicitly
listed in the exportedModules list. This causes valid default
modules in complex projects (e.g., ballerinax/mysql) to be ignored,
resulting in a blank screen in the generated API docs.

This commit updates the generator logic to bypass the export check
for default modules, ensuring they are always documented.

Fixes ballerina-platform#44476
@amika-d amika-d requested a review from keizer619 as a code owner February 10, 2026 17:15
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 10, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

The change modifies the module documentation generation logic to allow the default module to bypass export filtering, while maintaining restrictions on non-default modules. This targets a specific behavioral exception during module documentation map generation.

Changes

Cohort / File(s) Summary
Module Documentation Generation
misc/docerina/src/main/java/org/ballerinalang/docgen/docs/BallerinaDocGenerator.java
Modified skip condition in generateModuleDocMap to treat default module specially, allowing it inclusion regardless of exportedModules membership while preserving filtering for non-default modules.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Hop, hop—the docs now dance with glee,
Default modules finally free!
No more blank pages, just API delight,
The rabbit's fix made the packages bright! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: ensuring default modules are always documented, which directly addresses the core issue.
Linked Issues check ✅ Passed The code changes directly address the linked issue #44476 by modifying the module skip logic to always include default modules, fixing the blank documentation view for default packages.
Out of Scope Changes check ✅ Passed The changes are tightly focused on the documented objective: modifying the skip condition for modules in BallerinaDocGenerator.java to ensure default modules are processed.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description check ✅ Passed The PR description covers Purpose, Approach, and verification details, aligning well with the template structure, though some optional sections differ slightly from the template format.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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.

[Bug]: bal doc generates index.html but clicking on bal package yields blank API docs view

3 participants