Skip to content

Auto inject extension status note if guides forget the include - #2892

Open
holly-cummins wants to merge 1 commit into
mainfrom
auto-inject-extension-status-note
Open

Auto inject extension status note if guides forget the include#2892
holly-cummins wants to merge 1 commit into
mainfrom
auto-inject-extension-status-note

Conversation

@holly-cummins

Copy link
Copy Markdown
Contributor

#2713, our test for dead fragment links, can't be merged yet because some links are still dead:


[ERROR] Failures: 
[ERROR]   LinkCrawlerTest.crawlAndCheckFragmentAnchors:95 Found 10 broken fragment anchor(s):
  http://localhost:8090/guides#q=spring
       linked from: http://localhost:8090/spring/migrate
  http://localhost:8090/guides/container-image#s2i
       linked from: http://localhost:8090/guides/deploying-to-kubernetes
  http://localhost:8090/guides/deploying-to-kubernetes#duration-note-anchor-quarkus-kubernetes-client_quarkus-kubernetes-client
       linked from: http://localhost:8090/guides/deploying-to-kubernetes
  http://localhost:8090/guides/deploying-to-kubernetes#duration-note-anchor-quarkus-kubernetes_quarkus-knative
       linked from: http://localhost:8090/guides/deploying-to-kubernetes
  http://localhost:8090/guides/deploying-to-kubernetes#duration-note-anchor-quarkus-kubernetes_quarkus-kubernetes
       linked from: http://localhost:8090/guides/deploying-to-kubernetes
  http://localhost:8090/guides/deploying-to-kubernetes#duration-note-anchor-quarkus-kubernetes_quarkus-openshift
       linked from: http://localhost:8090/guides/deploying-to-kubernetes
  http://localhost:8090/guides/funqy#extension-status-note
       linked from: http://localhost:8090/guides/funqy
  http://localhost:8090/guides/opentelemetry#disable-all-or-parts-of-the-opentelemetry-extension
       linked from: http://localhost:8090/guides/telemetry-opentracing-to-otel-tutorial
  http://localhost:8090/guides/update-quarkus#extension-status-note
       linked from: http://localhost:8090/guides/update-quarkus
  http://localhost:8090/support#enterprise-support
       linked from: http://localhost:8090/releases

I thought I'd fixed all the guides dead links with quarkusio/quarkus#55413, but when 3.38 was released, the latest guides were still failing.

Analysis suggested that some guides forget to include extension-status.adoc, even though they put in an extension status. I could fix this in every guide with the problem, but that would be a lot of backports to get everything right. Instead, I've added some automagic, which auto-includes if an extension has a :extension-status: but doesn't include the adoc file.

Magic does have drawbacks, so I'm happy if people push back and think we should fix at source.

Root Cause Analysis

Before July 13, 2026:

  • Guides (like funqy.adoc) had :extension-status: preview
  • Ruby treeprocessor created a label with href="#extension-status-note"
  • Guides did NOT include _includes/extension-status.adoc
  • Result: BROKEN LINK - clicking the label led to #extension-status-note which didn't exist

July 13, 2026 - PR 55413 merged:

  • Added [[extension-status-note]] anchor to extension-status.adoc in quarkus repo
  • Expected this to fix the problem

But the problem persisted because:

  • Guides like funqy.adoc still don't manually include::_includes/extension-status.adoc[]
  • They only set :extension-status: preview
  • Just having the anchor in the file doesn't help if the file isn't included!
  • The ifdef::extension-status[] in extension-status.adoc means it only renders when included AND when the attribute is
    set

August 3, 2026 - CI run failed:

  • Test detected broken #extension-status-note links in funqy and update-quarkus guides
  • PR 55413 didn't actually fix the problem because the file still wasn't being included

August 4, 2026 - This PR

  • Added auto-injection logic to Ruby (and Java) treeprocessor
  • Now when a guide has :extension-status: but doesn't include the file, the treeprocessor:
    a. Reads _includes/extension-status.adoc
    b. Prepends the anchor (semi-redundant + defensive, it's already in the file for the latest versions – but not for older ones)
    c. Converts to HTML with the status attribute
    d. Injects as a pass block

This fixes broken fragment links where guides with extension-status labels
link to #extension-status-note, but that anchor doesn't exist unless the
guide manually includes extension-status.adoc.

The solution injects the anchor programmatically at build time, requiring
NO changes to the guides repository. Both Jekyll (Ruby) and Roq (Java)
implementations prepend [[extension-status-note]] when converting the
include file to HTML.

Changes:
1. Ruby treeprocessor (_plugins/asciidoctor-extension.rb)
   - Detects when #extension-status-note anchor is missing
   - Reads _includes/extension-status.adoc
   - Prepends [[extension-status-note]] anchor before conversion
   - Converts to HTML with status attribute set
   - Inserts as pass block after the status label

2. Java Asciidoctor extensions (for Roq builds)
   - ExtensionStatusTreeprocessor: mirrors Ruby implementation
   - ConfigTableTreeprocessor: config table show more buttons
   - ConfigTablePostprocessor: config table CSS classes
   - TooltipInlineMacroProcessor: tooltip inline macro
   - EnvVarCopyButtonInlineMacroProcessor: env var copy buttons
   - ConfigPropertyCopyButtonInlineMacroProcessor: config property copy buttons
   - QuarkusExtensionRegistry: registers all extensions with Asciidoctor

3. Comprehensive test coverage (29 passing tests)
   - ExtensionStatusTreeprocessorTest: anchor injection behavior
   - ConfigTableTreeprocessorTest: config table processing
   - InlineMacroProcessorTest: all inline macro processors

Key advantage: The extension-status.adoc files in the guides repo remain
unchanged. No anchors need to be added there. The treeprocessors handle
everything at build time. All Ruby plugins now have Java equivalents for
Roq compatibility.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@holly-cummins
holly-cummins force-pushed the auto-inject-extension-status-note branch from 7a51a97 to 4c27337 Compare August 4, 2026 16:59
@quarkus-bot

quarkus-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

Status for workflow Build

This is the status report for running Build on commit 4c27337.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

🎊 PR Preview 01b114e has been successfully built and deployed to https://quarkus-website-pr-2892-preview.surge.sh

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

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