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] Don't check canonical links in production as part of sanity testing #4942

Closed
Tracked by #4083
chalin opened this issue Aug 2, 2024 · 0 comments · Fixed by #4943
Closed
Tracked by #4083

[CI] Don't check canonical links in production as part of sanity testing #4942

chalin opened this issue Aug 2, 2024 · 0 comments · Fixed by #4943
Labels
CI/infra CI & infrastructure

Comments

@chalin
Copy link
Contributor

chalin commented Aug 2, 2024

During production builds under Netlify, we do sanity checks, which include link checking. Our link checker is htmltest, which is run on the generated site files before they are published to the production server. So it doesn't make sense to check canonical links, which point to the production server, since the new site hasn't been deployed yet.

Here's an excerpt from a build log, https://app.netlify.com/teams/opentelemetry/builds/66ad42e51e6650000862745d:

...
4:37:53 PM: tmp/bin/htmltest --log-level 1
4:37:53 PM: htmltest started at 08:37:53 on public
4:37:53 PM: ========================================================================
4:37:53 PM: running in concurrent mode, this is experimental
4:37:55 PM: blog/2023/otel-in-focus-break/index.html
4:37:55 PM:   hitting --- blog/2023/otel-in-focus-break/index.html --> https://opentelemetry.io/blog/2023/otel-in-focus-break/
4:37:55 PM: blog/2023/otel-in-focus-01/index.html
4:37:55 PM:   hitting --- blog/2023/otel-in-focus-01/index.html --> https://opentelemetry.io/blog/2023/otel-in-focus-01/
4:37:56 PM: blog/2023/integrations/index.html
4:37:56 PM:   hitting --- blog/2023/integrations/index.html --> https://opentelemetry.io/blog/2023/integrations/
4:37:56 PM: blog/2023/otel-in-focus-07/index.html
4:37:56 PM:   hitting --- blog/2023/otel-in-focus-07/index.html --> https://opentelemetry.io/blog/2023/otel-in-focus-07/
4:37:56 PM: blog/2023/gc-elections/index.html
4:37:56 PM:   hitting --- blog/2023/gc-elections/index.html --> https://opentelemetry.io/blog/2023/gc-elections/
4:37:56 PM: blog/2022/welcome/index.html
4:37:56 PM:   hitting --- blog/2022/welcome/index.html --> https://opentelemetry.io/blog/2022/welcome/
...

The link checker is "hitting" canonical links, e.g.:

$ curl -s https://opentelemetry.io/blog/2023/otel-in-focus-break | grep 'https://opentelemetry.io/blog/2023/otel-in-focus-break'
... <link rel=canonical href=https://opentelemetry.io/blog/2023/otel-in-focus-break/>...

There is little benefit in checking those canonical links, and in fact, any reported errors would likely be false positives because the new site hasn't been deployed.

I could modify the OTel partial to add a special tag to the canonical link element, but it'll be simpler to just ignore <link> elements with rel attributes. Yes, that'll rule out link elements other than rel="canonical", but this is only meant as a sanity test, and we won't miss out on very many extra ` elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/infra CI & infrastructure
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant