-
Notifications
You must be signed in to change notification settings - Fork 608
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
CI: Automatically close broken links issues when new ones are created #5827
CI: Automatically close broken links issues when new ones are created #5827
Conversation
repo-token: ${{secrets.GITHUB_TOKEN}} | ||
only-issue-labels: automated issue,Broken links | ||
# close-issue-message requires permission `issues: write` | ||
close-issue-message: 'This issue is closed due to a new "Check Broken Links" run. If any links are still broken, they will be reported in a new issue: https://github.com/osmosis-labs/osmosis/issues?q=is%3Aissue+is%3Aopen+label%3A%22automated+issue%22+label%3A%22Broken+links%22' |
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.
Is this link suppose to take us somewhere?
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 I think you're missing the last 2
in the link. It's a link to our open issues filtered with both the label automated issue
and Broken links
. So if there's a new broken links issue generated, people can see it there.
only-issue-labels: automated issue,Broken links | ||
# close-issue-message requires permission `issues: write` | ||
close-issue-message: 'This issue is closed due to a new "Check Broken Links" run. If any links are still broken, they will be reported in a new issue: https://github.com/osmosis-labs/osmosis/issues?q=is%3Aissue+is%3Aopen+label%3A%22automated+issue%22+label%3A%22Broken+links%22' | ||
days-before-stale: -1 |
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.
what does -1 stand for? I'm guessing nil?
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.
Yeah, it's so that the issue is never marked as stale
If set to a negative number like -1, no issues or pull requests will be marked as stale automatically.
My idea is to not mark the issue as stale -1
, but do close it (0
) when this action is ran, since a new issue should be created with the latest broken links.
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.
Is it maybe possible to somehow check on a fork? or maybe it would be nice to make it possible to run this action manually and check that it indeed works after it gets merged
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'm in favor of merging this and giving it a try
@mattverse awesome! If we manually kick it off, we'll want to make sure the latest broken links issue is open and has "Broken links" label. Once we run it, if it works, it'll close that issue and create a new issue. If y'all can manually run it from the actions tab, i think its possible to run the action from a specific branch. That way we don't merge this until verifying the action from this 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.
agree with @mattverse!
Closes: #5806
What is the purpose of the change
Improves our developer experience by automatically closing old Broken Links issues when we create new ones during our automated run.
Workflow explanation:
only-issue-labels: automated issue,Broken links
: To close only issues with those labels (I added theBroken links
label to the action to make it more unique)close-issue-message: ...
: To have a message explaining the close, and a link to our open issues - if any - with the labels.issues: write
permission for the message to be written. Unsure if it has those permissions.days-before-stale: -1
: To not mark it as stale, everdays-before-close: 0
: To automatically close the issue.stale
documentation on if this works, but 'logically' it should. This is the main reason I'd want to see about manually running the workflow to check it works.Testing and Verifying
There are no tests for the action, but one way to manually verify if this works is to
Check Broken Links
action #5806 with an addedBroken links
labelCheck Broken Links
action with my changesNote: It's possible that no new issue gets created if there are no broken links. We can confirm it works as expected by ensuring there are no failures during the CI run. We know the action works since it has created issues before, so the functionality we care about is the new step
Close Existing Broken Links Issue(s)
not breaking the CI proccess.Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)