Skip to content

Add sphinx-airflow-theme as uv workspace member#65840

Closed
srchilukoori wants to merge 1 commit into
apache:mainfrom
srchilukoori:feature/sphinx-theme-workspace
Closed

Add sphinx-airflow-theme as uv workspace member#65840
srchilukoori wants to merge 1 commit into
apache:mainfrom
srchilukoori:feature/sphinx-theme-workspace

Conversation

@srchilukoori

@srchilukoori srchilukoori commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Vendors sphinx-airflow-theme as a uv workspace member (docs-theme/). Templates are committed; compiled assets and template updates are synced from the published wheel at build time via scripts/ci/fetch_theme_assets.py. __init__.py is owned locally for version management via upgrade_important_versions.py.

Closes: #45576

Changes

  • docs-theme/ — vendored theme (templates, config, static JS); _gen/ gitignored
  • scripts/ci/fetch_theme_assets.py — downloads wheel, extracts all theme files except __init__.py (version source of truth stays local)
  • pyproject.toml / devel-common/pyproject.toml — workspace member + >=0.3.11 dep
  • Dockerfile.ci / .github/workflows/airflow-distributions-tests.yml — fetch assets in CI
  • scripts/ci/docker-compose/local.yml / .dockerignore / docker_command_utils.py — bind-mount wiring
  • upgrade_important_versions.py — tracks theme version in __init__.py
  • dev/breeze/tests/test_theme_workspace.py — retry test for fetch script

Why two fetch points?

Breeze bind-mounts docs-theme/ over the image path, masking baked content. Workflow fetches on host; Dockerfile covers non-mount scenarios.

Theme sync model

airflow-site is the source of truth. When a new theme version is published, upgrade_important_versions.py bumps __version__ in __init__.py, which triggers fetch_theme_assets.py to re-extract all theme files (templates + _gen/ assets) from the new wheel. No reverse sync, no local asset builds.

Was generative AI tooling used to co-author this PR?

  • Yes

@potiuk

potiuk commented Apr 26, 2026

Copy link
Copy Markdown
Member

How are you going to make sure it is going to be synchronized between airlfow-site and airflow repo ?

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Waiting for explantion of how the process shoudl work

Comment thread scripts/ci/prek/upgrade_important_versions.py
@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch from 4bacb0f to 7dc298f Compare April 26, 2026 23:58
@srchilukoori
srchilukoori requested a review from potiuk April 27, 2026 00:24
@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch 4 times, most recently from dd88bf6 to 26ed34d Compare May 2, 2026 18:31
@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch 4 times, most recently from 571eef7 to d8c747c Compare June 7, 2026 23:42
@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch from d8c747c to 41280fd Compare June 11, 2026 15:53
@srchilukoori
srchilukoori requested a review from potiuk June 15, 2026 14:01
@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch from 41280fd to cfddb02 Compare June 15, 2026 14:03
@potiuk

potiuk commented Jun 16, 2026

Copy link
Copy Markdown
Member

Hmm - I think I have one more proposal to make "documentation editing" works equally well for "versioned docs" in airflow and "airflow-site" for all the webpage stuff.

We basically want to have two workflows:

  1. Update the theme in "airflow-site" and build the site and see any asset changes reflected in the "airflow-site" docs

  2. we build airflow docs locally in "airflow" repo - and changing "sphinx-airflow-theme" locallly and seeing it applied live on local doc server (including generating assets)

I think that should be possilbe by:

a) locally building (not fetching) the _gen files - when we always fetch them from whl file, we cannot easily iterate locally on thme

b) synchronizing - rather than pulling the "airflow-sphinx-theme" between "airflow" and "airflow-site" - that means two -way operations:

  • airflow fetching the theme files from "airflow-site" (not -gen) when running "important uppgrade" and rebuilding _gen rather than fetching them
  • ailrflow-site - fetching the "airflow" changes from v3-2-stable when it changes committing those to "airflow-site"

Do you thin kit's a good and workable approach @srchilukoori ? If so - can you also implement it and add documentaiton to the docs building explaining this process (i.e. what you need to do in order to modify themes when you work on ailrflow, and what happens when you do it for "airflow-site".

@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch from cfddb02 to 778d7e3 Compare June 26, 2026 22:15
@srchilukoori

Copy link
Copy Markdown
Contributor Author

Hmm - I think I have one more proposal to make "documentation editing" works equally well for "versioned docs" in airflow and "airflow-site" for all the webpage stuff.

We basically want to have two workflows:

  1. Update the theme in "airflow-site" and build the site and see any asset changes reflected in the "airflow-site" docs
  2. we build airflow docs locally in "airflow" repo - and changing "sphinx-airflow-theme" locallly and seeing it applied live on local doc server (including generating assets)

I think that should be possilbe by:

a) locally building (not fetching) the _gen files - when we always fetch them from whl file, we cannot easily iterate locally on thme

b) synchronizing - rather than pulling the "airflow-sphinx-theme" between "airflow" and "airflow-site" - that means two -way operations:

  • airflow fetching the theme files from "airflow-site" (not -gen) when running "important uppgrade" and rebuilding _gen rather than fetching them
  • ailrflow-site - fetching the "airflow" changes from v3-2-stable when it changes committing those to "airflow-site"

Do you thin kit's a good and workable approach @srchilukoori ? If so - can you also implement it and add documentaiton to the docs building explaining this process (i.e. what you need to do in order to modify themes when you work on ailrflow, and what happens when you do it for "airflow-site".

I added the theme files to the fetch_theme_assets.py, the version bump will pull all files (new + existing). Adding the local build and bi-directional sync will add more complexity, so I prefer to keep it to forward sync from airflow-site to airflow.

@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch from 778d7e3 to 1fa3a98 Compare June 29, 2026 14:50

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the update — the version concern from my last pass is resolved: it's now __version__ = "0.3.11" and the dependency has moved from the URL-pinned wheel to the workspace member (sphinx-airflow-theme>=0.3.11), so fetch_theme_assets.py no longer resolves a stale/older asset. Good.

One thing before this can move: the branch is currently conflicting with main (DIRTY), so please rebase onto latest main. The two failing checks (Latest Boto and Pendulum2 provider tests) are unrelated to a docs-theme change and look like stale-base fallout — a rebase should clear both. Once it's rebased and green, ping me for a full re-review of the workspace-member wiring.

Not approving in the meantime — purely the rebase, not the approach.


This review was drafted by an AI-assisted tool and confirmed by an Airflow maintainer. The findings below are observations, not blockers; an Airflow maintainer — a real person — will take the next look at the PR. If you think a finding is mis-applied, please reply on the PR and a maintainer will weigh in.

More on how Airflow handles maintainer review: contributing-docs/05_pull_requests.rst.

@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch from 1fa3a98 to 2da996f Compare July 3, 2026 16:01
@srchilukoori

Copy link
Copy Markdown
Contributor Author

Thanks for the update — the version concern from my last pass is resolved: it's now __version__ = "0.3.11" and the dependency has moved from the URL-pinned wheel to the workspace member (sphinx-airflow-theme>=0.3.11), so fetch_theme_assets.py no longer resolves a stale/older asset. Good.

One thing before this can move: the branch is currently conflicting with main (DIRTY), so please rebase onto latest main. The two failing checks (Latest Boto and Pendulum2 provider tests) are unrelated to a docs-theme change and look like stale-base fallout — a rebase should clear both. Once it's rebased and green, ping me for a full re-review of the workspace-member wiring.

Not approving in the meantime — purely the rebase, not the approach.

This review was drafted by an AI-assisted tool and confirmed by an Airflow maintainer. The findings below are observations, not blockers; an Airflow maintainer — a real person — will take the next look at the PR. If you think a finding is mis-applied, please reply on the PR and a maintainer will weigh in.
More on how Airflow handles maintainer review: contributing-docs/05_pull_requests.rst.

rebased the branch and resolved the conflicts. ci tests are running now.

@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch 2 times, most recently from d2136a9 to fdc5cf1 Compare July 7, 2026 13:33
@srchilukoori
srchilukoori requested a review from potiuk July 7, 2026 13:46
@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch from fdc5cf1 to 24973e2 Compare July 8, 2026 16:41
@potiuk

potiuk commented Jul 13, 2026

Copy link
Copy Markdown
Member

Hmm:

airflow-site is the source of truth. When a new theme version is published, upgrade_important_versions.py bumps version in init.py, which triggers fetch_theme_assets.py to re-extract all theme files (templates + _gen/ assets) from the new wheel. No reverse sync, no local asset builds.

When I look at that - I think we should do locoal building of assets in airflow repo (it's really needed when you want to locally modiy the theme and see it "live" - that was the main motivation of the change. I do not think they should be pulled from wheel - it does not solve any issue to be honest.

@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch from 24973e2 to a458aec Compare July 13, 2026 23:46
@srchilukoori

Copy link
Copy Markdown
Contributor Author

Hmm:

airflow-site is the source of truth. When a new theme version is published, upgrade_important_versions.py bumps version in init.py, which triggers fetch_theme_assets.py to re-extract all theme files (templates + _gen/ assets) from the new wheel. No reverse sync, no local asset builds.

When I look at that - I think we should do locoal building of assets in airflow repo (it's really needed when you want to locally modiy the theme and see it "live" - that was the main motivation of the change. I do not think they should be pulled from wheel - it does not solve any issue to be honest.

@potiuk Having the site files in this repo, would lead to code divergence between the site and the airflow repository. Are you planning to merge the airflow-site into this repository? The current state (in this PR) is keeping the airflow-site as SOT, and pulling new versions when there are updates to airflow-site.

@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch 3 times, most recently from b87a9b9 to e55304c Compare July 16, 2026 13:15
Vendor sphinx-airflow-theme into docs-theme/ as a uv workspace member.
Templates are committed; compiled assets and template updates are synced
from the published wheel by fetch_theme_assets.py, which extracts all
theme files except __init__.py (version source of truth, managed by
upgrade_important_versions.py). airflow-site remains the single source
of truth — no reverse sync, no local asset builds.

Fetch theme assets on host before doc builds in CI

The MOUNT_ALL bind mount shadows _gen/ baked into the Docker image,
so the host must have the assets before breeze build-docs runs.
@srchilukoori
srchilukoori force-pushed the feature/sphinx-theme-workspace branch from e55304c to 7df547b Compare July 19, 2026 13:09
@potiuk

potiuk commented Jul 19, 2026

Copy link
Copy Markdown
Member

I really think that this is far too much to solve the issue. It does not solve the actual issue described - being able to quickly iterate n the theme changes while working on docs.

Looking at the current implementation, I think a better approach would be to handle the case differently:

  1. checkout "airflow-site" repo locally somewhgere
  2. Run breeze with --local-theme <path> to mount-bind the theme from checked-out airflow-site
  3. Iterate and run doc build in breeze while haivng the theme mounted from "airflow-site" - including "dev" building the assets on the flight.

That would be far less intrusive - and would be an "easy" dev-env for docs - and it would solve the case where we want to be able to work on theme and see the result of it in versioned docs - while also (in airflow-site) build the docs for landing page and the website with the same theme.

Then the flow would be:

  1. iterate locally on the change
    2)commit / merge the airflow-site changes and release them while site is built
  2. commit the local changes once the new them is published by site build

I think that seem like closes to what the issue describes.

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

Labels

area:dev-tools ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an option to mount airflow-site/sphinx_airflow_theme when running CI locally

3 participants