spec-prod icon indicating copy to clipboard operation
spec-prod copied to clipboard

link-checker fails with relative URLs

Open gkellogg opened this issue 4 years ago • 5 comments

Using w3c/spec-prod@v2

See https://github.com/w3c/N3/runs/2793542809?check_suite_focus=true for example, but also failing in https://github.com/w3c/rdf-star/runs/2810861457?check_suite_focus=true.

Both specs contain an href to a file relative to the spec source, and link-checker fails on them.

From https://github.com/w3c/N3/runs/2793542809?check_suite_focus=true

page not found from index.html to ../ns/crypto.html
page not found from index.html to ../ns/list.html
page not found from index.html to ../ns/log.html
page not found from index.html to ../ns/math.html
page not found from index.html to ../ns/string.html
page not found from index.html to ../ns/time.html
page not found from index.html to ../grammar/n3.ebnf

From https://github.com/w3c/rdf-star/runs/2810861457?check_suite_focus=true:

page not found from editors_draft.html to ../tests/index.html
page not found from editors_draft.html to ../UCR/rdf-star-ucr.html#annotate-statements-from-other-named-graphs-and-datasets
page not found from editors_draft.html to ../UCR/rdf-star-ucr.html#annotate-commit-deltas
page not found from editors_draft.html to ../UCR/rdf-star-ucr.html#meta-properties-over-properties

cc/ @pchampin @william-vw

gkellogg avatar Jun 12 '21 23:06 gkellogg

@marcoscaceres This appears to be a limitation of 'link-checker' npm package, as it expects a base directory instead of a file. Maybe we can skip ../ URLs?

sidvishnoi avatar Jun 17 '21 10:06 sidvishnoi

Before I started using w3c/spec-prod, I worked with lycheeverse/lychee-action for doing link checks. It wasn't perfect, either, but did have some options and patterns to limit the links it would follow:

https://github.com/json-ld/json-ld-star/commit/0c9b640e3ad8bb197f25f232ec83451f7a166ebb#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f

gkellogg avatar Jun 17 '21 16:06 gkellogg

@gkellogg Thanks for introducing me to lychee. I'll try it out, and if it doesn't work well enough, I'll fix href-checker. Maybe this weekend.

sidvishnoi avatar Jun 17 '21 18:06 sidvishnoi

Is there a workaround, perhaps to just skip the link checker? It's interfering with various update processes.

gkellogg avatar Jul 05 '21 18:07 gkellogg

Link checker is currently opt-in, so you can skip the link checker by removing VALIDATE_LINKS option from the workflow file, or setting VALIDATE_LINKS: false if you prefer to be explicit.

sidvishnoi avatar Jul 05 '21 20:07 sidvishnoi