Skip to content

Add automated documentation build workflow for 26.1 LTS#143

Merged
Arctis-Fireblight merged 24 commits intoRedot-Engine:masterfrom
MichaelFisher1997:feature/versioning-setup
Feb 12, 2026
Merged

Add automated documentation build workflow for 26.1 LTS#143
Arctis-Fireblight merged 24 commits intoRedot-Engine:masterfrom
MichaelFisher1997:feature/versioning-setup

Conversation

@MichaelFisher1997
Copy link

@MichaelFisher1997 MichaelFisher1997 commented Feb 3, 2026

Automated Documentation Build for Redot 26.1 LTS

This PR adds a GitHub Actions workflow to build and deploy 26.1 LTS documentation.

What It Does:

  • Builds docs from master branch (includes all latest content like MCP)
  • Uses conf.py from 26.1 branch for version labeling
  • Deploys to docs.redotengine.org/

Setup Required Before Merge:

  1. Create 26.1 branch:
  2. Update conf.py in 26.1 branch: set
  3. Merge this PR

After Merge:

Documentation will automatically build and deploy on every push to master.

- Add BUILD_DIR environment variable to build.sh for versioned output
- Update workflow to build stable (4.3), 4.4, and dev branches
- Deploy all versions to Cloudflare Pages
- Add stable -> 4.4 and latest -> dev redirects
- Enable deployment from feature/versioning-setup branch for testing
Add fetch-depth: 0 to actions/checkout to ensure stable and 4.4
branches are available for building versioned documentation.
Remove git fetch commands and checkout origin/stable and origin/4.4
directly since fetch-depth: 0 already brings all branches.
Add upstream remote and fetch stable/4.4 branches from Redot-Engine/redot-docs
instead of relying on origin which may not have these branches in forks.
Add index.html at root level that redirects to stable (4.4) version.
Cloudflare Pages needs an index.html at the deploy root.
Use GitHub Actions matrix strategy to build 4.3, 4.4, and dev versions in parallel.
Each version builds independently, then artifacts are combined in deploy job.
Should reduce total build time from ~72 minutes to ~25 minutes (lengthiest single build).
Change relative URLs (4.4/, dev/) to absolute paths (/4.4/, /dev/)
to prevent infinite redirect loops when accessing versioned docs.
Save build.sh from current branch before checking out upstream/stable
or upstream/4.4, then restore it after checkout. This ensures we use
the BUILD_DIR-aware build script even when building older branches
that don't have this feature.
…, dev)

- Add godot_versions list to html_context in conf.py
- Update versions.html template to use godot_versions instead of hardcoded stable/latest
- Show actual version numbers (4.3, 4.4, 26.1, dev, stable, latest) in dropdown
Add set -x and echo statements to see exactly what's happening when
checking out upstream branches and running the build. This will help
identify why builds are failing on upstream/stable and upstream/4.4.
Check if migrate.py supports --exclude-classes flag before using it.
Upstream branches (4.4, stable) have older migrate.py that doesn't
support this flag, causing 'required arguments missing' error.
When gitBranch is HEAD (upstream checkout), we know we're on an old
branch that doesn't support --exclude-classes flag. Use simple syntax
for upstream branches and --exclude-classes only for our feature branch.
Remove stable, latest, and 26.1 from version list to simplify.
Update root redirect to go directly to 4.4.
Remove stable.html and latest.html redirects.
Stop copying conf.py from feature branch to upstream branches.
Each branch needs its own version settings:
- 4.4 branch should show '4.4', not 'dev'
- 4.3 branch should show '4.3'
- Only feature branch shows 'dev'

This fixes the issue where 4.4 docs were showing dev branding and warning banner.
- Add fallback in versions.html for branches without godot_versions defined
- Copy updated versions.html template to upstream branches during build
- This ensures all versions show the same version selector dropdown
- 4.3 and 4.4 branches will now properly show version list even without godot_versions in conf.py
- Single build job for 26.1 LTS
- Deploy directly to root (no subdirectories)
- Removed multi-version matrix for simplicity
- Build to 26.1 directory
- Copy files to dist folder for artifact
- Deploy from downloaded artifact root
Workflow was building from feature/versioning-setup branch instead of 26.1.
Now explicitly fetches and checks out origin/26.1 before building.
The 26.1 branch has old build.sh without BUILD_DIR support.
Now we save the updated build.sh to /tmp first, then use it after
checking out 26.1 branch. This ensures BUILD_DIR works correctly.
- Checkout upstream/master (has MCP docs and latest content)
- Use conf.py from origin/26.1 (shows version 26.1)
- This gives us all master content labeled as 26.1 LTS
@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

This pull request updates the build and deployment pipeline to support versioned documentation. Changes include CI/CD workflow orchestration to handle a new 26.1 branch, build script modifications to accept a BUILD_DIR override, Sphinx configuration updates to reference a new Redot engine base path and add version listings, and template changes to dynamically render version selectors.

Changes

Cohort / File(s) Summary
CI/CD Workflow and Build Orchestration
.github/workflows/build-and-deploy.yml, build.sh
Added versioning support with BUILD_DIR override mechanism. Workflow now orchestrates multi-step builds using a versioned script, fetches configuration from feature branches, and manages artifact uploads/deployments for versions 26.1 and master. Build script updated to accept BUILD_DIR parameter and conditionally apply migration logic based on branch state.
Documentation Configuration
conf.py
Updated Sphinx configuration to reference Redot engine documentation base path, switched default godot_version from 4.4 to dev, and introduced new godot_versions list for version selector. Minor formatting and string normalization adjustments throughout.
Version Selector Template
_templates/versions.html
Modified version display and listing logic to use dynamic godot_versions when available, with fallback to hardcoded version list. Changed display_version source from version to godot_version variable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A rabbit hops through versions new,
Building docs in shades of blue,
From master's branch to 26.1's way,
Versioned tales will come to stay! 📚✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately describes the main change: adding an automated documentation build workflow for 26.1 LTS, which aligns with the core objective of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MichaelFisher1997
Copy link
Author

Note for maintainers: This PR should be merged AFTER PR #142.

The workflow depends on the 26.1 branch (from PR #142) existing to get the correct version configuration. Merge PR #142 first, then this one.

@MichaelFisher1997
Copy link
Author

Setup Instructions for Maintainers:

Before merging this PR, please create a &26.1 branch upstream:

After the 26.1 branch exists upstream, this workflow will work correctly.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
conf.py (1)

212-213: ⚠️ Potential issue | 🟡 Minor

html_extra_path is overwritten—robots.txt will be excluded.

Line 213 reassigns html_extra_path, discarding the robots.txt from line 212. Both files should be included.

🔧 Proposed fix
-html_extra_path = ["robots.txt"]
-html_extra_path = ["sitemap.xml"]
+html_extra_path = ["robots.txt", "sitemap.xml"]
🤖 Fix all issues with AI agents
In `@build.sh`:
- Around line 73-81: The condition that checks both BUILD_DIR and gitBranch
prevents using --exclude-classes in detached HEAD (gitBranch == "HEAD"), so
change the logic in the build.sh block that calls migrate.py to rely only on
BUILD_DIR: if [ -n "$BUILD_DIR" ]; then call python migrate.py --exclude-classes
"$inputDir" "$migrateDir" else call python migrate.py "$inputDir" "$migrateDir"
fi, leaving the gitBranch/git rev-parse logic alone or removing the gitBranch
check so that --exclude-classes is used whenever BUILD_DIR is set regardless of
detached HEAD state.

In `@conf.py`:
- Around line 194-204: The configuration is for the 26.1 LTS build but
godot_version is set to "dev" and godot_versions doesn't include 26.1; change
the godot_version constant to "26.1" and update the godot_versions list to
include an entry for ("26.1", "/26.1/") (and remove or reorder the "dev" entry
if the LTS build shouldn’t advertise it), ensuring the symbols godot_version and
godot_versions in conf.py reflect the 26.1 LTS values.
🧹 Nitpick comments (2)
.github/workflows/build-and-deploy.yml (2)

57-70: Cache key may not reflect the runtime conf.py state.

The cache key at line 62 uses hashFiles('**/*.rst', 'conf.py', 'migrate.py'), but conf.py is overwritten at runtime (line 44) after checkout. The hash is computed from the checked-out upstream/master's conf.py, not the 26.1 version that's actually used during the build.

This could lead to:

  • Cache hits when the actual config differs
  • Unexpected cache misses when only the 26.1 config changes

Consider either:

  1. Computing the hash after overwriting conf.py, or
  2. Including the 26.1 branch ref in the cache key explicitly
Option: Include branch ref in cache key
-          key: migrated-26.1-${{ hashFiles('**/*.rst', 'conf.py', 'migrate.py') }}
+          key: migrated-26.1-${{ hashFiles('**/*.rst', 'migrate.py') }}-conf-26.1

75-81: Redundant BUILD_DIR declaration.

BUILD_DIR is set via both export (line 77) and the env block (line 81). The env block alone is sufficient and cleaner.

Remove redundant export
       - name: Build documentation for 26.1
         run: |
           # Use the saved build.sh which supports BUILD_DIR
-          export FULL_RUN=1
-          export BUILD_DIR="26.1"
           /tmp/build-with-versions.sh
         env:
           FULL_RUN: 1
           BUILD_DIR: "26.1"

Comment on lines +73 to +81
# Check if we're building from upstream branch (doesn't support --exclude-classes)
# by checking if BUILD_DIR is set (our feature branch sets it, upstream builds won't)
if [ -n "$BUILD_DIR" ] && [ "$gitBranch" != "HEAD" ]; then
# Our branch with new migrate.py - use --exclude-classes
python migrate.py --exclude-classes "$inputDir" "$migrateDir"
else
# Upstream branch - old migrate.py, don't use --exclude-classes
python migrate.py "$inputDir" "$migrateDir"
fi
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Logic flaw: detached HEAD state defeats the --exclude-classes flag.

When the workflow runs git checkout upstream/master, Git enters detached HEAD state where git rev-parse --abbrev-ref HEAD returns "HEAD". Since the condition requires gitBranch != "HEAD", the --exclude-classes flag will never be used in the CI workflow even when BUILD_DIR is set.

If the intent is to use --exclude-classes whenever BUILD_DIR is set (regardless of HEAD state), simplify the condition:

🔧 Proposed fix
-        # Check if we're building from upstream branch (doesn't support --exclude-classes)
-        # by checking if BUILD_DIR is set (our feature branch sets it, upstream builds won't)
-        if [ -n "$BUILD_DIR" ] && [ "$gitBranch" != "HEAD" ]; then
+        # Use --exclude-classes when BUILD_DIR is set (our versioned builds)
+        if [ -n "$BUILD_DIR" ]; then
             # Our branch with new migrate.py - use --exclude-classes
             python migrate.py --exclude-classes "$inputDir" "$migrateDir"
         else
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Check if we're building from upstream branch (doesn't support --exclude-classes)
# by checking if BUILD_DIR is set (our feature branch sets it, upstream builds won't)
if [ -n "$BUILD_DIR" ] && [ "$gitBranch" != "HEAD" ]; then
# Our branch with new migrate.py - use --exclude-classes
python migrate.py --exclude-classes "$inputDir" "$migrateDir"
else
# Upstream branch - old migrate.py, don't use --exclude-classes
python migrate.py "$inputDir" "$migrateDir"
fi
# Use --exclude-classes when BUILD_DIR is set (our versioned builds)
if [ -n "$BUILD_DIR" ]; then
# Our branch with new migrate.py - use --exclude-classes
python migrate.py --exclude-classes "$inputDir" "$migrateDir"
else
# Upstream branch - old migrate.py, don't use --exclude-classes
python migrate.py "$inputDir" "$migrateDir"
fi
🤖 Prompt for AI Agents
In `@build.sh` around lines 73 - 81, The condition that checks both BUILD_DIR and
gitBranch prevents using --exclude-classes in detached HEAD (gitBranch ==
"HEAD"), so change the logic in the build.sh block that calls migrate.py to rely
only on BUILD_DIR: if [ -n "$BUILD_DIR" ]; then call python migrate.py
--exclude-classes "$inputDir" "$migrateDir" else call python migrate.py
"$inputDir" "$migrateDir" fi, leaving the gitBranch/git rev-parse logic alone or
removing the gitBranch check so that --exclude-classes is used whenever
BUILD_DIR is set regardless of detached HEAD state.

Comment on lines +194 to +204
"godot_version": "dev",
# Enables a banner that displays the up-to-date status of each article.
"godot_show_article_status": True,
# Display user-contributed notes at the bottom of pages that don't have `:allow_comments: False` at the top.
"godot_show_article_comments": on_rtd and not is_i18n,
# Available documentation versions for the version selector
"godot_versions": [
("4.3", "/4.3/"),
("4.4", "/4.4/"),
("dev", "/dev/"),
],
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Version configuration appears inconsistent with 26.1 LTS purpose.

This conf.py is meant for the 26.1 LTS build, but:

  1. godot_version is set to "dev" (line 194) instead of "26.1"
  2. godot_versions list (lines 200-204) contains 4.3, 4.4, dev but not 26.1

If this conf.py will be used for 26.1 LTS documentation, update the values accordingly:

🔧 Suggested fix for 26.1 LTS configuration
-    "godot_version": "dev",
+    "godot_version": "26.1",
     # Enables a banner that displays the up-to-date status of each article.
     "godot_show_article_status": True,
     # Display user-contributed notes at the bottom of pages that don't have `:allow_comments: False` at the top.
     "godot_show_article_comments": on_rtd and not is_i18n,
     # Available documentation versions for the version selector
     "godot_versions": [
         ("4.3", "/4.3/"),
         ("4.4", "/4.4/"),
+        ("26.1", "/26.1/"),
         ("dev", "/dev/"),
     ],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"godot_version": "dev",
# Enables a banner that displays the up-to-date status of each article.
"godot_show_article_status": True,
# Display user-contributed notes at the bottom of pages that don't have `:allow_comments: False` at the top.
"godot_show_article_comments": on_rtd and not is_i18n,
# Available documentation versions for the version selector
"godot_versions": [
("4.3", "/4.3/"),
("4.4", "/4.4/"),
("dev", "/dev/"),
],
"godot_version": "26.1",
# Enables a banner that displays the up-to-date status of each article.
"godot_show_article_status": True,
# Display user-contributed notes at the bottom of pages that don't have `:allow_comments: False` at the top.
"godot_show_article_comments": on_rtd and not is_i18n,
# Available documentation versions for the version selector
"godot_versions": [
("4.3", "/4.3/"),
("4.4", "/4.4/"),
("26.1", "/26.1/"),
("dev", "/dev/"),
],
🤖 Prompt for AI Agents
In `@conf.py` around lines 194 - 204, The configuration is for the 26.1 LTS build
but godot_version is set to "dev" and godot_versions doesn't include 26.1;
change the godot_version constant to "26.1" and update the godot_versions list
to include an entry for ("26.1", "/26.1/") (and remove or reorder the "dev"
entry if the LTS build shouldn’t advertise it), ensuring the symbols
godot_version and godot_versions in conf.py reflect the 26.1 LTS values.

@MichaelFisher1997
Copy link
Author

Setup Instructions

This PR adds automated documentation builds for Redot 26.1 LTS.

Before Merging:

  1. Create the 26.1 branch upstream:

  2. Update conf.py in the 26.1 branch:

    • Set in conf.py
    • Commit and push
  3. Then merge this PR

What This Does:

  • Builds documentation from master branch (has all latest content including MCP)
  • Labels it as 26.1 using conf.py from the 26.1 branch
  • Deploys to docs.redotengine.org/

Result:

Users see 26.1 LTS docs with all the latest content.

@Arctis-Fireblight Arctis-Fireblight merged commit e358874 into Redot-Engine:master Feb 12, 2026
4 of 5 checks passed
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