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

Trigger build on default branch when saving a project #5393

Merged

Conversation

@dojutsu-user
Copy link
Member

@dojutsu-user dojutsu-user commented Mar 4, 2019

Close #5358

readthedocs/core/utils/__init__.py Outdated Show resolved Hide resolved
readthedocs/core/utils/__init__.py Outdated Show resolved Hide resolved
@dojutsu-user
Copy link
Member Author

@dojutsu-user dojutsu-user commented Mar 4, 2019

@stsewd
Tests are failing because every project don't have a default_branch.
I am thinking to add try.. except block.. if it fails then go for LATEST version.
Need your suggestions.

@stsewd
Copy link
Member

@stsewd stsewd commented Mar 4, 2019

I think it's the opposite, projects have an invalid default_branch

https://github.com/stsewd/readthedocs.org/blob/4fd56f6fe7c9a646a2f628a17fda07a56fcc49be/readthedocs/projects/models.py#L971-L973

Or something else, that we can fix in the tests.

@dojutsu-user
Copy link
Member Author

@dojutsu-user dojutsu-user commented Mar 4, 2019

get_default_branch() is returning master for git based projects which is not present as version for many projects.

@stsewd
Copy link
Member

@stsewd stsewd commented Mar 4, 2019

Ok, looks like the method is used for another purpose (to get the version to which point to latest, not latest itself). We need something like projec.default_branch or LATEST I think

@dojutsu-user
Copy link
Member Author

@dojutsu-user dojutsu-user commented Mar 4, 2019

@stsewd
I have implemented that and also added the test.

readthedocs/core/utils/__init__.py Outdated Show resolved Hide resolved
readthedocs/core/utils/__init__.py Outdated Show resolved Hide resolved
stsewd
stsewd approved these changes Mar 5, 2019
Copy link
Member

@stsewd stsewd left a comment

Thanks

@stsewd stsewd requested a review from Mar 5, 2019
Copy link
Member

@humitos humitos left a comment

Looks good!

Please, update the docstring of the function prepare_build:

    :param version: version of the project to be built. Default: ``latest``

since it's not latest the default now.

@dojutsu-user
Copy link
Member Author

@dojutsu-user dojutsu-user commented Mar 6, 2019

@humitos
Updated the doc string.

@stsewd stsewd requested review from humitos and Mar 6, 2019
@ericholscher ericholscher merged commit 173c1f8 into readthedocs:master Mar 14, 2019
1 check passed
@dojutsu-user dojutsu-user deleted the trigger-build-default-branch branch Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants