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

Fix github build status reporting bug #5985

Merged
merged 7 commits into from Jul 31, 2019

Conversation

@saadmk11
Copy link
Member

@saadmk11 saadmk11 commented Jul 24, 2019

This will fix the bug that was sending status reports for wrong commits.This happens when multiple commits are added to a pull request in a short amount of time and versions get updated with new identifiers every time so, that's why when sending the finish status report (success/failure) it might send it for a different commit sha and give some inconsistent result.

@saadmk11 saadmk11 requested a review from ericholscher Jul 24, 2019
@saadmk11 saadmk11 added this to In progress in Pull Request Builder via automation Jul 24, 2019
Copy link
Member

@ericholscher ericholscher left a comment

This is better, but I'm wondering if we need to send a commit explicitly to the builder, instead of it getting it from the Version? That way we'll be working on the same commit always in the build.

@saadmk11
Copy link
Member Author

@saadmk11 saadmk11 commented Jul 24, 2019

@ericholscher Build object does not have the commit sha when the build is triggered. Its added while building. so to send the triggered/pending status we need to send the version identifier

@ericholscher
Copy link
Member

@ericholscher ericholscher commented Jul 24, 2019

We can change the code to send the commit when triggering the build though, right? We have the data at least for external versions.

@saadmk11
Copy link
Member Author

@saadmk11 saadmk11 commented Jul 24, 2019

Yes we can do that. do you think that is a better approach then this?

@ericholscher
Copy link
Member

@ericholscher ericholscher commented Jul 24, 2019

Yes. This can still hit bugs when a commit will switch between triggering and building. We should be explicitly passing a commit along if we have it.

@saadmk11 saadmk11 requested a review from ericholscher Jul 24, 2019
@saadmk11 saadmk11 requested a review from ericholscher Jul 25, 2019
Copy link
Member

@ericholscher ericholscher left a comment

I think this is a better approach. We've still not confirming that we're actually building the commit. We're not passing it into the VCS code to actually make sure we're checking it out and building, which is what we really need to be doing.

commit = self.project.vcs_repo(self.version.slug).commit
is where we're still getting the commit from the VCS.

We're also still checking out the identifier from the Version, and not the actual commit we're passing in:

version_repo.checkout(self.version.identifier)

@saadmk11 saadmk11 requested a review from ericholscher Jul 26, 2019
Copy link
Member

@ericholscher ericholscher left a comment

I think this looks 💯 now! I'm excited for this -- not being able to build a specific commit has been an annoyance for me for a long time, so it's cool to see this work actually happening :)

@@ -102,6 +104,7 @@ def prepare_build(
kwargs = {
'record': record,
'force': force,
'commit': commit,
Copy link
Member

@ericholscher ericholscher Jul 26, 2019

I think we should also be passing commit into the Build object here when created here.

Copy link
Member Author

@saadmk11 saadmk11 Jul 26, 2019

Done!

@saadmk11 saadmk11 requested a review from ericholscher Jul 26, 2019
version_repo.update()
self.sync_versions(version_repo)
identifier = self.commit or self.version.identifier
version_repo.checkout(self.version.identifier)
Copy link
Member Author

@saadmk11 saadmk11 Jul 31, 2019

I think we should pass this here. identifier from the line above. might have changes while resolving conflict :)

Copy link
Member

@ericholscher ericholscher Jul 31, 2019

Ah yea, that was a failure in the conflict resolution on my side.

@ericholscher ericholscher merged commit 9ff43df into readthedocs:master Jul 31, 2019
1 check passed
Pull Request Builder automation moved this from In progress to Done Jul 31, 2019
@saadmk11 saadmk11 deleted the build-status-bug-fix branch Jul 31, 2019
@stsewd stsewd mentioned this pull request Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants