-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix github build status reporting bug #5985
Conversation
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 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.
@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 |
We can change the code to send the commit when triggering the build though, right? We have the data at least for external versions. |
Yes we can do that. do you think that is a better approach then this? |
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. |
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 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.
readthedocs.org/readthedocs/projects/tasks.py
Line 688 in af20054
commit = self.project.vcs_repo(self.version.slug).commit |
We're also still checking out the identifier from the Version
, and not the actual commit we're passing in:
readthedocs.org/readthedocs/projects/tasks.py
Line 156 in bb8b08f
version_repo.checkout(self.version.identifier) |
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 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, |
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 we should also be passing commit
into the Build object here when created here.
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.
Done!
readthedocs/projects/tasks.py
Outdated
version_repo.update() | ||
self.sync_versions(version_repo) | ||
identifier = self.commit or self.version.identifier | ||
version_repo.checkout(self.version.identifier) |
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 we should pass this here. identifier
from the line above. might have changes while resolving conflict :)
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.
Ah yea, that was a failure in the conflict resolution on my side.
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.