Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Conversation

@eggshell
Copy link

It is possible to run into a scenario where two different pulls have
the same SHA. We should report to these pulls and tell them to amend
their change.

Implements: BonnyCI/projman#127

Signed-off-by: Cullen Taylor cullentaylor@outlook.com

Copy link

@loafyloaf loafyloaf left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

@gandelman-a gandelman-a left a comment

Choose a reason for hiding this comment

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

Couple of things. And I think we need a test case for this. But other than that, looks pretty straight forward..


if len(pulls) > 1:
raise Exception('Multiple pulls found with head sha %s' % sha)
for pull in pulls:

Choose a reason for hiding this comment

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

This code wont actually run because the Exception will already have been raised at this point

for pull in pulls:
self.commentPull(pull.owner, pull.project, pull.pr_number,
'Multiple pulls found with head sha %s. '
'Please amend your change.' % sha)

Choose a reason for hiding this comment

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

We probably want this msg to be configurable in the same way it is for merge failures, test success, etc?

Copy link

@gandelman-a gandelman-a left a comment

Choose a reason for hiding this comment

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

See previous comments

@eggshell eggshell force-pushed the multiple-pulls-fix branch from ffb24dc to 5144626 Compare April 19, 2017 21:10
It is possible to run into a scenario where two different pulls have
the same SHA. We should report to these pulls and tell them to amend
their change.

Implements: BonnyCI/projman#127

Signed-off-by: Cullen Taylor <cullentaylor@outlook.com>
@eggshell eggshell force-pushed the multiple-pulls-fix branch from 5144626 to b6b5f9a Compare April 23, 2017 21:48
@bonnyci
Copy link

bonnyci bot commented Apr 23, 2017

@jamielennox
Copy link

Now we've worked with github PRs a bit more I think this situation is likely and that we need to figure out this PR->commit thing a bit bettter. This is not a -1 on this review just a conversation.

It seems perfectly fine that a status resolves to multiple pull requests, we should ideally have a cache of HEAD commits on each project that we can lookup, but then just add the results of a successful status to all PRs that match. Zuul should still handle this correctly and only actually approve those that have been marked as approved.

@eggshell
Copy link
Author

@gandelman-a I'm having a bit of difficulty with recreating the behavior in a test case. Opening two separate PRs from two different branches seems to produce no comment stream whatsoever (which is where I've left the test case in this PR).

I've been testing locally with two PRs from master, but that just results in comments about successful builds.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants