operator-sdk
operator-sdk copied to clipboard
As a developer, I'd like to force the link-checker to skip specific links for a PR
Feature Request
Somewhat frequently, CI gets jammed up due to the link checker.
Case 1: External site down
If any of the sites we link to are down, we are unable to pass CI.
Case 2: Chicken/Egg links
Some PRs link to GitHub code that will not exist until the PR is merged.
Prior Work
The link checker can accept an additional argument url-ignore
https://github.com/operator-framework/operator-sdk/blob/master/hack/check-links.sh#L10
https://github.com/gjtorikian/html-proofer#special-cases-for-the-command-line
The recent addition of "Edit this page" links caused failure of every new doc. All of these cases should be covered by this change (useful as example syntax): https://github.com/operator-framework/operator-sdk/pull/4156/commits/f3fb15bd2377ce622680ccc7c5090b21bf82a5a3#diff-38c47b01ea565a10189c9ef7211e75e02e5072e0bfc16f09469ac4aa96d592aaL15-R15
Implementation
Ideally, we could have a special commit syntax that would replace the url-ignore value. This would allow devs to explicitly ignore links they are creating, or links that are broken for a reason beyond our control.
I understand that we just faced this situation because a new feature adds in the docs where the link was added https://github.com/operator-framework/operator-sdk/edit/master. Should we face this scenario frequently? If not, I am ok with we dealing with manually as done in this case.
We've encountered it often enough for new code files, but also for temporarily flaking external websites. We need some way to manually allow our CI to pass if one of many external sites aren't up.
What we've decided to do is move the link checker from a Travis job to a GitHub action. The link checker will no longer block merging but will show up as a red x.
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle rotten /remove-lifecycle stale
/lifecycle frozen
In retrospect, I dont think this is a huge problem assuming we are actually dealing with broken links instead of flake. If something external is broken, chicken-egg etc, admins can still merge.
Alternative idea: The link checker will only fail if a link fails n times in a row. (Still mergable by admins) Hopefully will eliminate flake?
Link Checker GH action - (if docs-pr fail hard? it would be irritating to move docs with broken links) - retrieve list - run link-checker - if failed: add links to list: - If failed n times post link. - it passed: ensure clear list
HostedSomewhereProbabyGithub: list-of-failed-urls: numFailed
If this isnt enough to eliminate flake, we could make it a little smarter by ignoring when a single domain is going haywire.
Good first issue? Help wanted? (Or Ill get to it eventually)
- GH actions are pretty easy https://dhttps://github.com/operator-framework/operator-sdk/tree/master/.github/workflowsocs.github.com/en/actions
- Ours live here https://github.com/operator-framework/operator-sdk/tree/master/.github/workflows
could we make it so the link-checker runs but doesn't block merge?
Ive gotten the impression this doesn't work very well since job statuses are success failure or canceled. We could have it be a "success" then post a comment with the failing links, I'd be fine with that.
the issues/flakes are timeouts when we are validating the links. Can we not just increase the timeout of it?
See that it has an timeout option: https://github.com/gjtorikian/html-proofer#configuring-typhoeus-and-hydra
https://github.com/operator-framework/operator-sdk/blob/master/hack/check-links.sh#L15-L18