Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Git backend: make
default_branch
to point to VCS' default branch #9424New 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
Git backend: make
default_branch
to point to VCS' default branch #9424Changes from 6 commits
353578b
bdf154a
baf0679
37ff4c6
4c6f1a7
c3a4d54
fc90d36
5fc00a3
7aa90eb
ecd47e9
ce95eb1
8b295d2
0db8eed
e524e75
03ef8ea
2bf335b
5040369
223902b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just add a
get_default_branch
method to the class here, and hit the API from the caller where we have the version?readthedocs.org/readthedocs/doc_builder/director.py
Lines 200 to 204 in 239d890
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm... We could, yes. I'm not sure if it's better than just initializing this class with a read
Version
object instead of theversion_slug
only.clone()
method's caller is the same class; from outside, the method called isupdate()
--but I understand it's the same for the purpose of your commentclone()
method a little more organic, since the caller doesn't need to think about updating thedefault_branch
each time after callingclone()
--However, I don't see it bad for now.There are other potential solutions as well:
version_pk
tooVersion
objectVersion
object without thepk
: https://docs.readthedocs.io/en/stable/api/v3.html#version-detailIt probably makes sense to use APIv3 since it's part of the organic transition to remove APIv2 internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm, thinking a little more about this... These ides will interfere with this other improvement #9736 where we will be cloning the exact branch directly, instead of the
default_branch
and then switching to the one wanted.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also be part of another issue to investigate a little more, if you think it's not mandatory for this PR for now. It only affects Bitbucket currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to not include, but I just wanted to note that we have options here to get the data we want by thinking about getting it another way. 🤷