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

[FAB-17133] Add Action to Trigger CI Builds #313

Merged
merged 1 commit into from
Nov 27, 2019
Merged

[FAB-17133] Add Action to Trigger CI Builds #313

merged 1 commit into from
Nov 27, 2019

Conversation

lindluni
Copy link
Contributor

@lindluni lindluni commented Nov 24, 2019

This change adds a GitHub Action that is used
to trigger CI builds when the PR is commented
on using "/ci-run"

You can test it out here: https://github.com/btl5037/fabric/pull/3
You can see the actual runs here: https://github.com/btl5037/fabric/actions

Signed-off-by: Brett Logan Brett.T.Logan@ibm.com

Type of change

  • New feature

Description

This change adds a GitHub action to trigger CI builds on comment

Users can comment "/ci-run" on their PR conversation tab to retrigger CI. It first checks to see if an existing build is running before triggering the new build.

Copy link
Contributor

@mastersingh24 mastersingh24 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 fine, but is it possible to actually just re-run failed jobs?

mastersingh24
mastersingh24 previously approved these changes Nov 25, 2019
@lindluni
Copy link
Contributor Author

So it's not using the AZ CLI, but I had my moment of clarity when I stepped away last night and got some sleep, it looks like the rest API has an endpoint for retriggering just the failed builds, I am working on that now

@denyeart
Copy link
Contributor

So it's not using the AZ CLI, but I had my moment of clarity when I stepped away last night and got some sleep, it looks like the rest API has an endpoint for retriggering just the failed builds, I am working on that now

Just curious - why is a github action comment for retriggering failed jobs better/different than clicking Re-Run on the failed job?
In general we'd like to write down and socialize all the common comment actions people should be using, so for consistency good to have comment actions. Just wondering if there is any difference relative to clicking Re-Run.

This change adds a GitHub Action that is used
to trigger CI builds when the PR is commented
on using "/ci-run"

Signed-off-by: Brett Logan <Brett.T.Logan@ibm.com>
@lindluni
Copy link
Contributor Author

lindluni commented Nov 26, 2019

The only people authorized to use the re-run function or the /azp-run comment are repo maintainers/admins and people who have been added to the org in Azure DevOps (which is unfortunate). So the maintainers and admins can retrigger individual failed jobs, but there is no mechanism for an author who isn't a maintainer to retrigger ci on their own build.

@mastersingh24 I really dug into the the REST API today, there is no endpoint to re-trigger failed jobs only. Per above, as a maintainer you can do so via the checks tab, but the author cannot if they aren't a maintainer. I did open a ticket with Azure DevOp's to ask if and when this might be implemented and a feature request to add this. Unfortunately it's not perfect, but it's what we can do right now. Since author's can't re-trigger their CI on their own, this would give them some means to do so, even if not perfect. They only added rerun failed jobs last month, so its a fairly new feature, which is probably why there is nothing on the API for it.

@lindluni
Copy link
Contributor Author

lindluni commented Nov 26, 2019

I updated the job to only allow the author or those assigned as reviewers (which in our case is our maintainers) to allow the retriggering of the pipeline. It also doesn't retrigger if a build is already executing against it

@kchristidis
Copy link
Contributor

Unfortunately it's not perfect, but it's what we can do right now. Since author's can't re-trigger their CI on their own, this would give them some means to do so, even if not perfect. They only added rerun failed jobs last month, so it's a fairly new feature, which is probably why there is nothing on the API for it.

Noted. Thanks for digging into it. This LGTM.

@kchristidis kchristidis merged commit dd26403 into hyperledger:master Nov 27, 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.

None yet

4 participants