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

Get latest CI status of a commit filtered by branch #96

Merged
merged 1 commit into from
Apr 2, 2018
Merged

Get latest CI status of a commit filtered by branch #96

merged 1 commit into from
Apr 2, 2018

Conversation

benjamb
Copy link
Contributor

@benjamb benjamb commented Mar 23, 2018

The current implementation fetches the latest CI status for a particular sha. While a relatively rare circumstance, it's possible that at the point Marge-bot picks up an MR, another developer may have branched from the same commit and pushed to the repository. This new pipeline would be detected by Marge-bot, which could then be cancelled, causing Marge-bot to drop the MR stating "CI cancelled", while the CI for the correct branch will have passed.

This MR changes the CI status check to use the pipelines API, in order to filter status by ref (branch).

Commit.fetch_by_id() is no longer used after this change, I wasn't entirely sure whether I should remove that as part of this, leave it for a follow-up, or for you to decide what to do with it.

@benjamb benjamb changed the title Add method to get latest CI status of a sha filtered by branch Get latest CI status of a commit filtered by branch Mar 23, 2018
Changes the CI status check to use the pipelines API, in order to filter
status by ref (branch).
@JaimeLennox JaimeLennox merged commit c5ce790 into smarkets:master Apr 2, 2018
@JaimeLennox
Copy link
Contributor

Looks good to me. Thanks!

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