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

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.

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.

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

@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

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

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

@ericholscher
Copy link
Member

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.

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.

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)

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.

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

Choose a reason for hiding this comment

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

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

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

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

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

@ericholscher ericholscher merged commit 9ff43df into readthedocs:master Jul 31, 2019
@saadmk11 saadmk11 deleted the build-status-bug-fix branch July 31, 2019 15:48
@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
None yet
Development

Successfully merging this pull request may close these issues.

2 participants