Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gencomponentdocs support module all to generate all karmada components docs #6184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhzhuang-zju
Copy link
Contributor

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
When releasing documents, it is necessary to generate reference documents for different components through gencomponentdocs. Currently, only the generation of individual components one by one is supported, which is inefficient and prone to omissions. In actual usage scenarios, a more common situation is to generate reference documents for all components at once. Therefore, I hope to introduce the "module all" to support the full-scale generation of component reference documents.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
Before:

./gencomponentdocs ../website/docs/reference/components/ karmada-webhook
./gencomponentdocs ../website/i18n/zh/docusaurus-plugin-content-docs/current/reference/components/ karmada-webhook
./gencomponentdocs ../website/docs/reference/components/ karmada-controller-manager
./gencomponentdocs ../website/i18n/zh/docusaurus-plugin-content-docs/current/reference/components/karmada-controller-manager
./gencomponentdocs ../website/docs/reference/components/ karmada-scheduler
./gencomponentdocs ../website/i18n/zh/docusaurus-plugin-content-docs/current/reference/components/ karmada-scheduler
...
./gencomponentdocs ../website/docs/reference/components/ karmada-agent
./gencomponentdocs ../website/i18n/zh/docusaurus-plugin-content-docs/current/reference/components/ karmada-agent

After:

./gencomponentdocs ../website/docs/reference/components/ all
./gencomponentdocs ../website/i18n/zh/docusaurus-plugin-content-docs/current/reference/components/ all

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Mar 4, 2025
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from zhzhuang-zju. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 4, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 4, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.97%. Comparing base (824bd8d) to head (6654fee).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6184      +/-   ##
==========================================
- Coverage   47.97%   47.97%   -0.01%     
==========================================
  Files         674      674              
  Lines       55841    55841              
==========================================
- Hits        26788    26787       -1     
- Misses      27305    27306       +1     
  Partials     1748     1748              
Flag Coverage Δ
unittests 47.97% <ø> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Choose a reason for hiding this comment

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

PR Overview

This PR refactors the gencomponentdocs tool to support generating documentation for all components at once rather than one by one.

  • Refactored the main function to handle multiple commands.
  • Added a new "all" module case that generates documentation for all karmada components.

Reviewed Changes

File Description
hack/tools/gencomponentdocs/gen_component_docs.go Refactored command generation to support the "all" module and improved error handling

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

hack/tools/gencomponentdocs/gen_component_docs.go:87

  • [nitpick] Consider using context.TODO() instead of nil for the scheduler command to maintain consistency with the other commands that use context.TODO().
cmds = append(cmds, schapp.NewSchedulerCommand(nil))

hack/tools/gencomponentdocs/gen_component_docs.go:109

  • Ensure that the new 'all' module functionality is covered by corresponding tests to verify that all commands are generated correctly.
case "all":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants