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

Implement local link checking as part of build #487

Merged
merged 7 commits into from Jun 23, 2020
Merged

Implement local link checking as part of build #487

merged 7 commits into from Jun 23, 2020

Conversation

@edibopp
Copy link
Contributor

edibopp commented Jun 22, 2020

This was #483, addresses part of #481.

Now with preview ;)

This was a bit more involved than initially anticipated. I don't think it's feasible to test local files without a webserver, as the file path semantics are different. There were a bunch of false negatives, as linkchecker simply ignored paths like /nixpkgs as they are outside the domain – and they would not work, as they translate to file:///nixpkgs.

Starting a local webserver is a heavier approach, but solves the issue. Here I chose caddy instead of, say, python -m http.server, because it is quite a bit faster, yet still zero-configuration for this use case. (I also considered lighttpd and busybox httpd, both of which had unsuitable default configurations.)

The /pkgs/... routes from the nixpkgs manual are ignored, because I think this issue should likely be solved upstream. Even without checking the nixpkgs manual, this setup provides significant value to guard against dead link regressions.

An end-to-end link check against deployed https://nixos.org is out of scope for this PR.

@garbas garbas self-requested a review Jun 23, 2020
@garbas
garbas approved these changes Jun 23, 2020
@garbas garbas merged commit cb970aa into master Jun 23, 2020
1 check passed
1 check passed
build-and-deploy
Details
@garbas garbas deleted the link-checking branch Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.