Skip to content

[codex] Skip invalid builds on single-version projects#12905

Draft
ericholscher wants to merge 2 commits intomainfrom
codex/single-version-build-guard-6477
Draft

[codex] Skip invalid builds on single-version projects#12905
ericholscher wants to merge 2 commits intomainfrom
codex/single-version-build-guard-6477

Conversation

@ericholscher
Copy link
Copy Markdown
Member

This fixes builds being triggered for non-default internal versions on single-version projects.

Single-version projects only serve the default internal version, but the build trigger path still accepted any active internal version. That made the issue in #6477 still reproducible: the system would accept a build for a version that is not valid for that project mode. This change blocks those invalid build triggers in the shared build preparation path, makes webhook-driven version selection report them as not built, and keeps the API v3 build endpoint from serializing a missing build.

Validation:

  • /Users/eric/projects/readthedocs.org/.venv/bin/pytest --reuse-db --ds=readthedocs.settings.test readthedocs/rtd_tests/tests/test_core_utils.py readthedocs/core/tests/test_hooks.py readthedocs/api/v3/tests/test_builds.py

Fixes #6477

Generated by Copilot.

The build_versions_from_names function now unpacks trigger_build return
value as (_, build), but existing test mocks did not set a return_value,
causing unpacking errors in 12 tests.
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.

Warn users when building a version other than the default in a single version project

1 participant