Skip to content

chore(docs): set up RTD documentation project (charmkeeper)#119

Open
erinecon wants to merge 5 commits intomainfrom
charmkeeper/rtd-docs-setup
Open

chore(docs): set up RTD documentation project (charmkeeper)#119
erinecon wants to merge 5 commits intomainfrom
charmkeeper/rtd-docs-setup

Conversation

@erinecon
Copy link
Copy Markdown
Contributor

@erinecon erinecon commented Apr 14, 2026

Summary

This PR sets up a Read the Docs (RTD) documentation project for the Content Cache Operators repository, based on the Canonical sphinx-docs-starter-pack.

Note: This PR was prepared automatically with the help of charmkeeper.

Prep work: consolidate docs

The repository previously had documentation split across two directories:

  • content-cache/docs/ — main charm docs (tutorial, 4 how-to guides)
  • content-cache-backends-config/docs/ — subordinate charm docs (index + contribute)

These have been consolidated into a single top-level docs/ directory covering both charms:

  • docs/index.md — unified home page (Content Cache + Backends Config overview, WIP note preserved)
  • docs/how-to/ — all how-to guides (contribute, enable-cos, enable-https, upgrade)
  • docs/tutorial/ — getting started tutorial
  • Stale references in README.md and CONTRIBUTING.md files updated

RTD infrastructure

  • .readthedocs.yaml added
  • .github/workflows/docs_rtd.yaml added (calls canonical/operator-workflows RTD workflow)
  • docs/conf.py configured: project name, discourse/matrix links, github_url, product_page, juju + starter-pack intersphinx mappings, cookie banner, Mermaid extension
  • All dependencies pinned (myst-parser==4.0.1 as required)
  • Vale wordlist (docs/.custom_wordlist.txt) and mermaid exclusion in .sphinx/vale.ini
  • Subdirectory index pages and MyST anchor targets added
  • docs/how-to/contribute.rst created (replaces contribute.md) with AI usage policy
  • docs/redirects.txt added (empty, satisfies sphinx-rerediraffe)
  • .licenserc.yaml updated to exclude docs/**, .readthedocs.yaml, *.rst
  • Root README.md updated with ## Documentation section

Build verification

All local checks pass on this branch:

  • make html → build succeeded ✅
  • make lint-md → 0 errors ✅
  • make vale → 0 errors, 0 warnings ✅

Note: The "check URLs" workflow is expected to fail as there is no RTD project in the main branch.

Action items for humans

The following require human action outside this repository:

  1. Set up the RTD project at app.readthedocs.com:

    • Organization and team: "Canonical / Platform Engineering"
    • Project name: "Content Cache Operators charm"
    • URL versioning: Single version without translations
    • Set default branch to charmkeeper/rtd-docs-setup initially; switch to main after merge
    • Privacy level: Private during setup, Public when ready
    • Enable "Build pull requests for this project"
    • Add as subproject of "Ubuntu documentation library" (may require a Technical Author)
  2. Update conf.py once the RTD URL is known:

    • Uncomment and set ogp_site_url to the RTD project URL
    • Uncomment and set slug to the RTD project slug
  3. Update metadata.yaml in both charm directories: replace the docs: key with the new RTD URL (once known).

  4. Review TODOs in docs/how-to/contribute.rst (links to CONTRIBUTING.md, RTD URL).

  5. Verify the cookie banner in a browser:

    cd docs && make clean && make install && make run

    Open in an incognito window and confirm the consent banner works.

  6. Run remaining quality checks before merging:

    make spelling   # Fix spelling errors
    make linkcheck  # Fix broken links

    Note: The tutorial contains a link to juju.is/docs/juju/set-up--tear-down-your-test-environment (old URL) marked with a TODO comment — a human should verify the correct intersphinx target.

  7. Post-merge:

    • Switch RTD default branch to main
    • Set Default version to Public
    • Archive and lock old Discourse pages once RTD migration is verified
    • Add to canonical-repo-automation if applicable

erinecon and others added 2 commits April 14, 2026 09:53
Move documentation from content-cache/docs/ and
content-cache-backends-config/docs/ into a unified top-level docs/
directory covering both charms.

- Merge content-cache-backends-config overview into docs/index.md
- Unify contribute.md with updated source link pointing to docs/
- Fix stale references in README and CONTRIBUTING files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add .readthedocs.yaml from sphinx-docs-starter-pack
- Add .github/workflows/docs_rtd.yaml RTD workflow
- Copy docs/.sphinx/, docs/reuse/, docs/_templates/ from starter pack
- Copy docs/Makefile, docs/conf.py, docs/requirements.txt, docs/.gitignore
- Configure conf.py for Content Cache Operators:
  - project = 'Content Cache Operators'
  - discourse, matrix, mattermost team-specific links
  - github_url, product_page, source_edit_link
  - juju + starter-pack intersphinx mappings
  - cookie banner CSS/JS
  - sphinxcontrib.mermaid extension
- Pin all requirements.txt dependencies to exact versions (myst-parser==4.0.1)
- Add docs/.custom_wordlist.txt with AI and classDef entries
- Add mermaid exclusion to docs/.sphinx/vale.ini
- Create subdirectory index pages: how-to/index.md, tutorial/index.md
- Create how-to/contribute.rst replacing contribute.md
- Add MyST anchor targets to all non-index pages
- Convert Discourse admonitions to MyST {note} directives
- Update Juju doc links to intersphinx refs where possible
- Add docs/redirects.txt (empty, satisfies sphinx-rerediraffe)
- Update .licenserc.yaml to exclude docs/**, .readthedocs.yaml, *.rst
- Add ## Documentation section to root README.md

Build: make html → success
Lint: make lint-md → 0 errors
Vale: make vale → 0 errors, 0 warnings

Items requiring human action (documented in PR description):
- Set up RTD project in app.readthedocs.com backend
- Update ogp_site_url and slug in conf.py once URL is known
- Update documentation key in metadata.yaml with RTD URL
- Verify cookie banner in browser
- Review TODO comments in docs/how-to/contribute.rst

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@erinecon erinecon added the documentation Improvements or additions to documentation label Apr 14, 2026
@erinecon erinecon marked this pull request as ready for review April 16, 2026 15:50
@erinecon erinecon requested a review from a team as a code owner April 16, 2026 15:50
@erinecon erinecon requested review from srbouffard and weiiwang01 and removed request for a team April 16, 2026 15:50
@github-actions
Copy link
Copy Markdown
Contributor

Test results for commit 2df0b8d

Test coverage for 2df0b8d

Name            Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------
src/charm.py       47      0      6      0   100%
src/errors.py       1      0      0      0   100%
src/state.py      139      0     32      0   100%
-----------------------------------------------------------
TOTAL             187      0     38      0   100%

Static code analysis report

Run started:2026-04-16 16:46:59.807894+00:00

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 986
  Total lines skipped (#nosec): 0
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@github-actions
Copy link
Copy Markdown
Contributor

Test results for commit 2df0b8d

Test coverage for 2df0b8d

Name                   Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------
src/certificates.py       21      2      6      2    85%   65-68
src/charm.py             106     12      8      0    89%   64-65, 120, 149, 153-156, 211-213, 223-225
src/errors.py             16      0      0      0   100%
src/nginx_manager.py     199     36     16      4    81%   207, 213-219, 224-226, 229, 277-279, 295-297, 337-342, 417-419, 438-442, 461->463, 543-548
src/state.py             163     13     34      1    92%   154-159, 429-439
src/utilities.py          13      0      0      0   100%
------------------------------------------------------------------
TOTAL                    518     63     64      7    88%

Static code analysis report

Run started:2026-04-16 16:01:23.645477+00:00

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 1208
  Total lines skipped (#nosec): 0
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 2

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Libraries: OK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants