Skip to content

Add image checking to link crawler test#2764

Merged
gsmet merged 3 commits into
quarkusio:mainfrom
holly-cummins:test-image-crawler
Jun 26, 2026
Merged

Add image checking to link crawler test#2764
gsmet merged 3 commits into
quarkusio:mainfrom
holly-cummins:test-image-crawler

Conversation

@holly-cummins

@holly-cummins holly-cummins commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Single crawl pass now checks both broken links and broken images. The crawl results are cached so both test methods reuse the same pass.

In order to be able to re-use the existing crawl and not crawl twice (sloooow), this needed a bit of a refactor of the current tests to allow the crawl results to be re-used.

The tests found one image which was semi-broken, but only semi – there was a .. at the start of the url, which would go out of the quarkus.io site, but all browsers normalise this to .. In fact, it's mandated by spec that they do so:

Silently collapsing /../ to / is a standard URL normalization technique defined in RFC 3986. This process, called "removing dot-segments," ensures paths don't result in directory traversal that breaks the intended hierarchy

So I've added this behaviour to the tests.

This PR will probably make a merge mess with #2713, but I'll see which merges first and then fix.

This PR has found 4 real dead images, so I'll have to fix those before it can merge.

The normalisation change in the link crawler, as a side effect, found another real dead link that had snuck through previous versions of the test. It turns out that http://quarkus.io/faq linked to user stories, but the link was inappropriately relative and doesn't work in a browser, even though it passed in the previous versions of the tests.

@holly-cummins

Copy link
Copy Markdown
Contributor Author

Ugh, worked on my machine. Will fix. :(

@holly-cummins
holly-cummins marked this pull request as draft June 22, 2026 16:34
@holly-cummins

holly-cummins commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Ah, seems like it's a side effect of the normalisation, and also a difference in behaviour between the vertx server and the serving solution used in gh pages.

The root cause: normalize() strips trailing slashes, so /newsletter/18/ becomes /newsletter/18. When URI.resolve("index_files/img.png") runs against /newsletter/18, RFC 3986 treats 18 as a filename and resolves relative to /newsletter/, giving /newsletter/index_files/img.png. The browser, having followed the redirect to /newsletter/18/, correctly resolves to /newsletter/18/index_files/img.png. Against quarkus.io this didn't matter because the production CDN/server handles these paths differently, but the local CI server serves from the filesystem where only the correct path works.

@holly-cummins
holly-cummins marked this pull request as ready for review June 22, 2026 17:27
@gsmet

gsmet commented Jun 23, 2026

Copy link
Copy Markdown
Member

Not sure why the build is failing here, I will let you sort it out :).

holly-cummins and others added 3 commits June 23, 2026 13:56
The relative link `blog/tag/user-story/` resolved against `/faq/` to
produce `/faq/blog/tag/user-story/`. Use an absolute path instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use absolute path for worldtour image to bypass incorrect imagesdir,
and fix .png/.jpg extension mismatch in newsletter 60.

Add missing internal images

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Single crawl pass now checks both broken links and broken images. Th crawl results are cached so both test methods reuse the same pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@holly-cummins

Copy link
Copy Markdown
Contributor Author

Not sure why the build is failing here, I will let you sort it out :).

Turns out I made typos in two of my image fixes, which is why we need automates checks. :)

And my revisions to the link crawler caused it to pop up another, genuinely broken, dead link.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

🙈 The PR is closed and the preview is expired.

@gsmet
gsmet merged commit 6995258 into quarkusio:main Jun 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants