Skip to content

Add authctl docs#1179

Merged
adombeck merged 16 commits intomainfrom
authctl-docs
Feb 10, 2026
Merged

Add authctl docs#1179
adombeck merged 16 commits intomainfrom
authctl-docs

Conversation

@adombeck
Copy link
Copy Markdown
Contributor

@adombeck adombeck commented Jan 5, 2026

Important

This is based on #1087

Generate authctl docs via cobra.

UDENG-8760

@adombeck
Copy link
Copy Markdown
Contributor Author

adombeck commented Jan 6, 2026

@edibotopic do you understand why the build of the docs fails in the CI but not when I build it locally via make html? The command-line options passed to sphinx seem to be about the same.

In the CI I these warnings which I assume are the reason the build fails:

/home/docs/checkouts/readthedocs.org/user_builds/canonical-authd/checkouts/1179/docs/reference/cli/authctl.md.rst:1: WARNING: Document headings start at H2, not H1
/home/docs/checkouts/readthedocs.org/user_builds/canonical-authd/checkouts/1179/docs/reference/cli/authctl_group.md.rst:1: WARNING: Document headings start at H2, not H1
/home/docs/checkouts/readthedocs.org/user_builds/canonical-authd/checkouts/1179/docs/reference/cli/authctl_group_set-gid.md.rst:1: WARNING: Document headings start at H2, not H1
/home/docs/checkouts/readthedocs.org/user_builds/canonical-authd/checkouts/1179/docs/reference/cli/authctl_user.md.rst:1: WARNING: Document headings start at H2, not H1
/home/docs/checkouts/readthedocs.org/user_builds/canonical-authd/checkouts/1179/docs/reference/cli/authctl_user_lock.md.rst:1: WARNING: Document headings start at H2, not H1
looking for now-outdated files... /home/docs/checkouts/readthedocs.org/user_builds/canonical-authd/checkouts/1179/docs/reference/cli/authctl_user_set-uid.md.rst:1: WARNING: Document headings start at H2, not H1
/home/docs/checkouts/readthedocs.org/user_builds/canonical-authd/checkouts/1179/docs/reference/cli/authctl_user_unlock.md.rst:1: WARNING: Document headings start at H2, not H1

I don't see those locally.

@adombeck
Copy link
Copy Markdown
Contributor Author

adombeck commented Jan 6, 2026

In the CI I these warnings which I assume are the reason the build fails:

FTR, we were able to resolve that - @edibotopic figured out how to ignore these warnings

@adombeck adombeck marked this pull request as ready for review January 6, 2026 16:34
@adombeck adombeck requested a review from a team as a code owner January 6, 2026 16:34
@adombeck adombeck requested a review from edibotopic January 6, 2026 16:34
@edibotopic
Copy link
Copy Markdown
Contributor

edibotopic commented Jan 6, 2026

FTR, we were able to resolve that - @edibotopic figured out how to ignore these warnings

Thanks @adombeck .

I think it's OK to ignore these warnings for now so that we are better able to support users with these docs. In the long run, we should fix the header levels so that they conform with the rest of the docs.

In future, we can work on improving the doc generation and formatting of the rendered output, depending on capacity, etc.

@adombeck
Copy link
Copy Markdown
Contributor Author

adombeck commented Jan 6, 2026

@edibotopic I think this is now ready for an initial review. Please ignore all the commits which are not touching the documentation, those are from #1087.

The documentation is very rudimentary for now, we might want to write a more extensive overview of authctl and maybe inline the documentation of the separate commands in the index.md. As discussed on MM, we might also want to use gencodo to improve the generated markdown.

@adombeck
Copy link
Copy Markdown
Contributor Author

adombeck commented Jan 6, 2026

we might also want to use gencodo to improve the generated markdown.

For later reference, I pushed a WIP commit which uses gencodo to https://github.com/adombeck/authd/tree/authctl-docs-gencodo

Copy link
Copy Markdown
Contributor

@edibotopic edibotopic left a comment

Choose a reason for hiding this comment

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

Excellent work @adombeck .

I've left a few minor suggestions and comments.

Some of the more elaborate synopses tend to push the basic usage example (Use) quite far down, and visually pair it with a separate command, example:

Image

I think that's probably just a limitation of the native Cobra docgen, but it's something we can look at in future.

@adombeck
Copy link
Copy Markdown
Contributor Author

adombeck commented Jan 7, 2026

Some of the more elaborate synopses tend to push the basic usage example (Use) quite far down, and visually pair it with a separate command

Yeah, that also annoyed me. I think the description just doesn't belong in the "Synopsis" section. My understanding of a "Synopsis" is that it's only the formal description of how to run the command what command line options it takes (like authctl user lock <user> [flags]). In my opinion the description should go in a separate section, like in man pages. I already opened a PR upstream to change that: spf13/cobra#2344

This is an issue which we could fix with gencodo.

@edibotopic
Copy link
Copy Markdown
Contributor

Some of the more elaborate synopses tend to push the basic usage example (Use) quite far down, and visually pair it with a separate command

Yeah, that also annoyed me.
[...]
This is an issue which we could fix with gencodo.

Thanks for the context @adombeck . I agree, let's wait for gencodo. It's OK for now.

@adombeck adombeck force-pushed the authctl-docs branch 2 times, most recently from e52807e to 62920d5 Compare January 12, 2026 14:03
@adombeck adombeck requested a review from edibotopic January 12, 2026 14:08
Copy link
Copy Markdown
Contributor

@edibotopic edibotopic left a comment

Choose a reason for hiding this comment

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

Great work! Nice to have this in the docs.

adombeck and others added 12 commits February 10, 2026 15:05
Produces prettier docs
So that it can be imported by the docgen tool we're about to add.
Having the "This command requires root privileges." sentence after the
`chown -R` command was confusing, it sounded like it was referring to
that command instead of the authctl command.
To generate the CLI docs
The auto-generated Cobra markdown docs use headings starting at H2, not
H1. That results in Sphinx printing warnings, which causes the build to
fail in the CI (but not locally).

Let's ignore these kind of warnings for now.
Co-authored-by: Shane Crowley <66971213+edibotopic@users.noreply.github.com>
Co-authored-by: Shane Crowley <66971213+edibotopic@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.86%. Comparing base (7dd4884) to head (0f1e87b).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
cmd/authctl/root/root.go 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1179      +/-   ##
==========================================
- Coverage   85.99%   85.86%   -0.14%     
==========================================
  Files          98       99       +1     
  Lines        6685     6685              
  Branches      111      111              
==========================================
- Hits         5749     5740       -9     
- Misses        880      888       +8     
- Partials       56       57       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The cmd/authctl/internal/docgen tool is an internal build-time tool used
to generate the authctl documentation and man page.

This change adds it to DH_GOLANG_EXCLUDES to prevent it from being built
during package builds, which was causing a dh_missing error since the
binary was being built but not installed.
@adombeck adombeck merged commit 275a3a7 into main Feb 10, 2026
10 of 23 checks passed
@adombeck adombeck deleted the authctl-docs branch February 10, 2026 23:06
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.

2 participants