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

CI: Automatically close broken links issues when new ones are created #5827

Merged

Conversation

inFocus7
Copy link
Contributor

@inFocus7 inFocus7 commented Jul 13, 2023

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 the Broken 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.
    • The token needs the 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, ever
  • days-before-close: 0: To automatically close the issue.
    • I could not find examples in the 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

  1. Reopen dev-UX: Automatically close stale issues created by Check Broken Links action  #5806 with an added Broken links label
  2. Run the Check Broken Links action with my changes
  3. View the run and expect no errors
  4. Check that the above issue has been closed on run, with the message linking to our PRs with label(s).

Note: 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

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

@inFocus7 inFocus7 requested a review from a team as a code owner July 13, 2023 00:42
@github-actions github-actions bot added the T:CI label Jul 13, 2023
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'
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@inFocus7 inFocus7 Jul 14, 2023

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
Copy link
Member

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?

Copy link
Contributor Author

@inFocus7 inFocus7 Jul 14, 2023

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.

Copy link
Member

@pysel pysel left a 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

@inFocus7
Copy link
Contributor Author

inFocus7 commented Jul 14, 2023

@pysel The workflow has a workflow_dispatch, so you should be able to manually run it on the action here - if you have the permissions to. Although it would have to be post-merge. I tried seeing if I can run it from my fork but the action doesn't appear.

Copy link
Member

@mattverse mattverse left a 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

@inFocus7
Copy link
Contributor Author

@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.

Copy link
Member

@pysel pysel left a comment

Choose a reason for hiding this comment

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

agree with @mattverse!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dev-UX: Automatically close stale issues created by Check Broken Links action
4 participants