-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add reusable workflow for workflow failure reporting #121
base: master
Are you sure you want to change the base?
Conversation
936987c
to
2825ebc
Compare
Taken from conda-base after generalizations¹ and further adjustments. ¹ <nextstrain/conda-base@d7d23af...3c01cf9>
2825ebc
to
f91a96d
Compare
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.
Thanks @victorlin! This should be useful for a lot of repos. We can even consider if we want to use it for the automated pathogen workflows.
I'm considering using this for the nextstrain/status CI workflow. However, that workflow has a history of temporary failures, so it might be get noisy.
# Search for issues opened by this job. | ||
matching_issues=$(gh issue list \ | ||
--state open \ | ||
--author '@me' \ | ||
--json 'number,title' \ | ||
--jq 'map(select(.title == "${{ inputs.title }}") | .number)') |
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.
non-blocking question
Should there be some filter on the branch of the workflow? Or I guess the calling workflow can control if report-failure.yaml
only gets run on the default branch...
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 that's outside the scope of this reusable workflow. There could be a valid reason for the calling workflow to open issues regardless of branch. Yes, I've encoded this in the calling workflow for conda-base, cli PRs.
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 yeah that makes sense. I guess the title can include the branch of the workflow to make sure this matches issues per branch.
Maybe the inputs.title.description
should explicitly state that the title is used for issue matching.
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 as part of cfa7538
Same thing with the nextstrain/cli CI workflow. I think in general it will be nice to have the issue automation in place, even if we decide to disable it temporarily during periods of unstable CI. If we find ourselves disabling it more than it's enabled, it's maybe a sign that CI status is not useful and that we should rework the steps to improve reliability. |
body: | | ||
Automatically created by the workflow [${{ github.workflow }}](${{ env.workflow_link }}) which indicated failure on [run ${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}). | ||
|
||
See the workflow run for details and make changes as necessary. | ||
|
||
This issue will be automatically closed upon the next successful run of the workflow. |
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.
The issue title has been parameterized to the required inputs.title
but the issue body is fixed. I'm thinking it would be better to use this as default, but allow customization through inputs.body
.
This behavior is an essential part of the workflow, and should be documented more clearly, including the making explicit the default --limit 30.
Description of proposed changes
Taken from conda-base after generalizations¹ and further adjustments.
¹ nextstrain/conda-base@d7d23af...3c01cf9
Related issue(s)
Motivated by desire to do the same thing in another repository: nextstrain/cli#412
Checklist