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
merged 9 commits into from
Mar 14, 2019
Merged

Trigger build on default branch when saving a project #5393

merged 9 commits into from
Mar 14, 2019

Conversation

dojutsu-user
Copy link
Member

Close #5358

@dojutsu-user
Copy link
Member Author

@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 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

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

@stsewd
Copy link
Member

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

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

readthedocs/core/utils/__init__.py Outdated Show resolved Hide resolved
Copy link
Member

@stsewd stsewd left a comment

Choose a reason for hiding this comment

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

Thanks

@stsewd stsewd requested a review from a team March 5, 2019 17:51
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

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

@humitos
Updated the doc string.

@stsewd stsewd requested review from humitos and a team March 6, 2019 15:31
@ericholscher ericholscher merged commit 173c1f8 into readthedocs:master Mar 14, 2019
@dojutsu-user dojutsu-user deleted the trigger-build-default-branch branch March 14, 2019 16:23
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.

4 participants