Skip to content

🧪🤖 Integrate RTD w/ the tox workflow tool natively#809

Merged
webknjaz merged 3 commits intoansible:develfrom
webknjaz:maintenance/docs-sync-rtd-meta
Apr 1, 2026
Merged

🧪🤖 Integrate RTD w/ the tox workflow tool natively#809
webknjaz merged 3 commits intoansible:develfrom
webknjaz:maintenance/docs-sync-rtd-meta

Conversation

@webknjaz
Copy link
Copy Markdown
Member

@webknjaz webknjaz commented Apr 1, 2026

This change wires all the Sphinx invocations in RTD via tox, making it rely on the same centralized automation that contributors would use locally and GHA may run as CI.

To achieve that, the PR includes a few additional behind-the-scenes improvements borrowed from other projects I co-maintain and occasionally sync infra across (like ansible/awx-plugins et al).

The installed package metadata is now read into the Sphinx config, dropping the project-specific version discovery invocation. Even its name is loaded from the PEP 621 config rather than being hardcoded. Both are exposed as RST substitutions.

The tox env has been renamed from docs to build-docs and it now prints out instructions for viewing the built docs site locally. The infrastructure includes an optimizationthat speeds up local documentation rebuilds for any documents that render version information.

Finally, the Sphinx invocation command runs in a stricter mode and allows the caller to pass custom arguments at the end, which is relied on in the RTD env but is not significant in the dev envs.

This patch replaces the project-coupled version computation method
with a standardized lookup of the installed project version using
`importlib.metadata`. It also loads the project name from a standard
PEP 621 configuration location.

The change also makes both available as RST substitutions.
@webknjaz webknjaz added test Changes to test files code_health Issue/PR improves codebase health backport-3.1 Request Patchback to create a PR using `git cherry-pick -x` backport-3.0 Request Patchback to create a PR using `git cherry-pick -x` labels Apr 1, 2026
@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Apr 1, 2026
This updates the workflow tool to be in line with other maintained
tox-based projects. And the change also includes an optimization
that speeds up local documentation rebuilds for any documents that
render version information.

The tox env has been renamed from `docs` to `build-docs` and it now
prints out instructions for viewing the built docs site locally.

Finally, the Sphinx invocation command runs in a stricter mode and
allows the caller to pass custom arguments at the end.
@webknjaz webknjaz force-pushed the maintenance/docs-sync-rtd-meta branch 3 times, most recently from 6a59d05 to 0e3f492 Compare April 1, 2026 16:08
This change wires all the Sphinx invocations in RTD via tox, making
it rely on the same centralized automation that contributors would
use locally and GHA may run as CI.
@webknjaz webknjaz force-pushed the maintenance/docs-sync-rtd-meta branch from 2baa156 to 45502fc Compare April 1, 2026 16:37
@webknjaz webknjaz marked this pull request as ready for review April 1, 2026 16:37
@webknjaz webknjaz requested a review from a team as a code owner April 1, 2026 16:37
@webknjaz webknjaz merged commit e94e544 into ansible:devel Apr 1, 2026
17 checks passed
@patchback
Copy link
Copy Markdown

patchback bot commented Apr 1, 2026

Backport to release_3.1: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply e94e544 on top of patchback/backports/release_3.1/e94e544b9a003040efde05023ea755d01ee302d9/pr-809

Backporting merged PR #809 into devel

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-builder.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/release_3.1/e94e544b9a003040efde05023ea755d01ee302d9/pr-809 upstream/release_3.1
  4. Now, cherry-pick PR 🧪🤖 Integrate RTD w/ the tox workflow tool natively #809 contents into that branch:
    $ git cherry-pick -x e94e544b9a003040efde05023ea755d01ee302d9
    If it'll yell at you with something like fatal: Commit e94e544b9a003040efde05023ea755d01ee302d9 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x e94e544b9a003040efde05023ea755d01ee302d9
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR 🧪🤖 Integrate RTD w/ the tox workflow tool natively #809 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/release_3.1/e94e544b9a003040efde05023ea755d01ee302d9/pr-809
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback
Copy link
Copy Markdown

patchback bot commented Apr 1, 2026

Backport to release_3.0: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply e94e544 on top of patchback/backports/release_3.0/e94e544b9a003040efde05023ea755d01ee302d9/pr-809

Backporting merged PR #809 into devel

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible/ansible-builder.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/release_3.0/e94e544b9a003040efde05023ea755d01ee302d9/pr-809 upstream/release_3.0
  4. Now, cherry-pick PR 🧪🤖 Integrate RTD w/ the tox workflow tool natively #809 contents into that branch:
    $ git cherry-pick -x e94e544b9a003040efde05023ea755d01ee302d9
    If it'll yell at you with something like fatal: Commit e94e544b9a003040efde05023ea755d01ee302d9 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x e94e544b9a003040efde05023ea755d01ee302d9
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR 🧪🤖 Integrate RTD w/ the tox workflow tool natively #809 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/release_3.0/e94e544b9a003040efde05023ea755d01ee302d9/pr-809
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

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

Labels

backport-3.0 Request Patchback to create a PR using `git cherry-pick -x` backport-3.1 Request Patchback to create a PR using `git cherry-pick -x` code_health Issue/PR improves codebase health needs_triage New item that needs to be triaged test Changes to test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant