operator-sdk icon indicating copy to clipboard operation
operator-sdk copied to clipboard

As a developer, I'd like to force the link-checker to skip specific links for a PR

Open asmacdo opened this issue 5 years ago • 12 comments

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.

asmacdo avatar Nov 03 '20 16:11 asmacdo

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.

camilamacedo86 avatar Nov 04 '20 13:11 camilamacedo86

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.

asmacdo avatar Nov 09 '20 18:11 asmacdo

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.

asmacdo avatar Nov 09 '20 19:11 asmacdo

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

openshift-bot avatar Feb 07 '21 19:02 openshift-bot

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

openshift-bot avatar Mar 09 '21 20:03 openshift-bot

/lifecycle frozen

jberkhahn avatar Apr 07 '21 18:04 jberkhahn

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

asmacdo avatar Apr 26 '22 21:04 asmacdo

could we make it so the link-checker runs but doesn't block merge?

fabianvf avatar Apr 29 '22 20:04 fabianvf

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.

asmacdo avatar Apr 29 '22 20:04 asmacdo

the issues/flakes are timeouts when we are validating the links. Can we not just increase the timeout of it?

camilamacedo86 avatar Jun 13 '22 17:06 camilamacedo86

See that it has an timeout option: https://github.com/gjtorikian/html-proofer#configuring-typhoeus-and-hydra

camilamacedo86 avatar Jun 14 '22 09:06 camilamacedo86

https://github.com/operator-framework/operator-sdk/blob/master/hack/check-links.sh#L15-L18

asmacdo avatar Aug 08 '22 18:08 asmacdo