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

Refine PR Builder Code #5933

Merged

Conversation

saadmk11
Copy link
Member

This PR Will work on improving the code for PR builder by updating the code suggested in code reviews

@saadmk11 saadmk11 added the PR: work in progress Pull request is not ready for full review label Jul 16, 2019
@saadmk11 saadmk11 removed the PR: work in progress Pull request is not ready for full review label Jul 16, 2019
@saadmk11 saadmk11 requested review from humitos and ericholscher and removed request for humitos July 16, 2019 15:02
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.

Solid changes, just a couple questions.


if external_version:
if not created:
Copy link
Member

Choose a reason for hiding this comment

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

I'd switch this logic around, and do if created. It just reads a bit cleaner.


if external_version:
if not created:
# identifier will change if there is a new commit to the Pull/Merge Request
if external_version.identifier != identifier:
external_version.identifier = identifier
external_version.save()
Copy link
Member

Choose a reason for hiding this comment

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

We should probably log in this case too (eg. updated external version)

(<a data-bind="attr: {href: commit_url}"><span data-bind="text: commit">{{ build.commit }}</span></a>)
{% else %}
(<span data-bind="text: commit">{{ build.commit }}</span>)
Copy link
Member

Choose a reason for hiding this comment

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

Does this break the JS code that tries to update commit_url if it doesn't exist? I don't know how knockout.js handles this, but we might also need to check for it on that side.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay I'll check this :)

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 have checked. there is no error on the browsers console window. and commit_url does always exist. but set to None when conditions are not met.

@@ -578,18 +578,21 @@ def run_build(self, docker, record):

if self.build_env.failed:
self.send_notifications(self.version.pk, self.build['id'])
# send build failure status to git Status API
# if the build failed, send build failure status to git Status API
# to show status report on the providers pull/merge request UI.
Copy link
Member

Choose a reason for hiding this comment

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

This is still just explaining what the code does. We can just remove these comments, we don't need to explain anything here.

if created:
log.info(
'(Create External Version) Added Version: [%s] ', ' '.join(
external_version.slug
Copy link
Member

Choose a reason for hiding this comment

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

Why are we calling join on a slug?

Copy link
Member Author

Choose a reason for hiding this comment

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

Opps! I was doing something else forgot to remove it sorry.

@ericholscher ericholscher merged commit ea09b41 into readthedocs:gsoc-19-pr-builder Jul 16, 2019
@saadmk11 saadmk11 deleted the refine-pr-builder branch July 16, 2019 17:48
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