Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: use actual git identifier for READTHEDOCS_GIT_IDENTIFIER #11875

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Dec 24, 2024

A commit can point to more than one branch/tag, so using git describe/name-rev or similar doesn't work reliably. Since we already have the tag/branch name for most of the versions (verbose_name), we can just use that, there are only three special cases:

  • LATEST: this is an alias for the default branch
  • STABLE: this is an alias for the stable version
  • External versions: we don't save the name of the base branch, just the commit and PR number, so not sure what to return here, I'm returning the commit for now. Maybe we can update the docs to mention this.

commit_name was doing exactly that, except for stable, so I went ahead and renamed it and refactored it (we were no longer using it) to use it in our API, so builders have access to it.

Closes #11662

@@ -478,29 +478,6 @@ def test_list_user_created_latest_and_stable_versions_in_default_branch_choices(
],
)

def test_commit_name_not_in_default_branch_choices(self):
Copy link
Member Author

Choose a reason for hiding this comment

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

this test wasn't needed, we already test that only an exact list of the expected branches is included above.

@stsewd stsewd marked this pull request as ready for review December 24, 2024 18:59
@stsewd stsewd requested a review from a team as a code owner December 24, 2024 18:59
@stsewd stsewd requested a review from ericholscher December 24, 2024 18:59
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

Simple enough 👍

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.

Build: READTHEDOCS_GIT_IDENTIFIER shouldn't be the commit SHA on versions from tags
2 participants