Skip to content

Ensure attribute links get picked up by ConceptLink#4804

Closed
aneta-petrova wants to merge 1 commit intotheforeman:masterfrom
aneta-petrova:ConceptLink-attr
Closed

Ensure attribute links get picked up by ConceptLink#4804
aneta-petrova wants to merge 1 commit intotheforeman:masterfrom
aneta-petrova:ConceptLink-attr

Conversation

@aneta-petrova
Copy link
Copy Markdown
Member

What changes are you introducing?

Moving https:// out of link attributes and into the modules.

Why are you introducing these changes? (Explanation, links to references, issues, etc.)

jhradilek/asciidoctor-dita-vale#186

Per asciidoctor-dita-vale rules, links and cross-references are not allowed in concept modules. Right now, we often include links as attributes (such as {ManagingContentDocURL}) and these don't get picked up by the ConceptLink rule. Moving the https:// URI from attributes to the text ensures that the links get picked up by Vale.

Anything else to add? (Considerations, potential downsides, alternative solutions you have explored, etc.)

Contributor checklists

  • I am okay with my commits getting squashed when you merge this PR.
  • I am familiar with the contributing guidelines.

Please cherry-pick my commits into:

  • Foreman 3.18/Katello 4.20 (Satellite 6.19)
  • Foreman 3.17/Katello 4.19
  • Foreman 3.16/Katello 4.18 (Satellite 6.18; orcharhino 7.6, 7.7, and 7.8)
  • Foreman 3.15/Katello 4.17
  • Foreman 3.14/Katello 4.16 (Satellite 6.17; orcharhino 7.4; orcharhino 7.5)
  • Foreman 3.13/Katello 4.15 (EL9 only)
  • Foreman 3.12/Katello 4.14 (Satellite 6.16; orcharhino 7.2 on EL9 only; orcharhino 7.3)
  • We do not accept PRs for Foreman older than 3.12.

@github-actions github-actions Bot added Needs tech review Requires a review from the technical perspective Needs style review Requires a review from docs style/grammar perspective Needs testing Requires functional testing labels Apr 30, 2026
@aneta-petrova aneta-petrova removed Needs tech review Requires a review from the technical perspective Needs style review Requires a review from docs style/grammar perspective Needs testing Requires functional testing labels Apr 30, 2026
@github-actions
Copy link
Copy Markdown

The PR preview for 67f46bf is available at theforeman-foreman-documentation-preview-pr-4804.surge.sh

The following output files are affected by this PR:

show diff

show diff as HTML

@aneta-petrova
Copy link
Copy Markdown
Member Author

@maximiliankolb Can you please take a quick look at this? Would this work for you? See the description for context and the problem I'm trying to solve.

@aneta-petrova
Copy link
Copy Markdown
Member Author

Including https:// directly in the text of our modules triggers the ConceptLink rule, which is what I'm trying to accomplish:

Screenshot From 2026-04-30 09-50-48

The consequence of this change would be that we'd have to include https:// in front of every {GuideNameDocURL} attribute from now on.

@jafiala
Copy link
Copy Markdown
Contributor

jafiala commented Apr 30, 2026

Makes sense to me.

But shouldn't this be cherry-picked into all to-be-migrated versions?

@aneta-petrova
Copy link
Copy Markdown
Member Author

Makes sense to me.

But shouldn't this be cherry-picked into all to-be-migrated versions?

Oh yes, and also applied to all occurrences of all guide attributes... 🫠 I just first want to find out if this solution is acceptable to everyone on the team.

@maximiliankolb
Copy link
Copy Markdown
Contributor

@maximiliankolb Can you please take a quick look at this? Would this work for you? See the description for context and the problem I'm trying to solve.

@aneta-petrova This would break downtream builds for me because I overwrite the attribute with a relative path, not a URL. I am unsure if this is working 100% for upstream too.

I hope that there's a more elegant solution that this prefix. IMO this would be a huge effort to patch in upstream docs.

However, if this is the only way to make it work, I am confident to be able to revert this at build time in my downstream build:

for a list of all modules:
    for a list of DocURL attributes:
        sed "s|https://attribute|attribute|g" module.adoc

Your goal is to make a GHA fail if there are any xrefs/DocURLs in concept modules anywhere (but under ".Additional resources")?

@aneta-petrova
Copy link
Copy Markdown
Member Author

@maximiliankolb Can you please take a quick look at this? Would this work for you? See the description for context and the problem I'm trying to solve.

@aneta-petrova This would break downtream builds for me because I overwrite the attribute with a relative path, not a URL. I am unsure if this is working 100% for upstream too.

IMO this would be a huge effort to patch in upstream docs.

Why do you think so? The way I imagined this was to simply drop https:// from our URL attributes and prepending it in front of each DocURL attribute. Am I missing something?

However, if this is the only way to make it work, I am confident to be able to revert this at build time in my downstream build:

for a list of all modules:
    for a list of DocURL attributes:
        sed "s|https://attribute|attribute|g" module.adoc

Your goal is to make a GHA fail if there are any xrefs/DocURLs in concept modules anywhere (but under ".Additional resources")?

Yes. I based this solution on jhradilek/asciidoctor-dita-vale#186 (comment).

@maximiliankolb
Copy link
Copy Markdown
Contributor

"huge" is maybe an exaggeration but I count 112 instances:

$ fd con_ | xargs rg "DocURL" | wc
    112    1216   24102

Am I missing something?

No, that should be it. I am just wondering (openly) if there is another solution because to me, it feels very un-elegant.

Just to clarify: Are links in concepts under "Additional resources" OK?

@aneta-petrova
Copy link
Copy Markdown
Member Author

Just to clarify: Are links in concepts under "Additional resources" OK?

They are.

Unless that concept is an assembly introduction, because assembly introduction cannot include Additional resources.

@aneta-petrova
Copy link
Copy Markdown
Member Author

I am just wondering (openly) if there is another solution because to me, it feels very un-elegant.

So was I, which is in part why I opened this PR. I welcome suggestions for alternatives. This is the only one I can think of.

@aneta-petrova
Copy link
Copy Markdown
Member Author

aneta-petrova commented Apr 30, 2026

Just to clarify: Are links in concepts under "Additional resources" OK?

They are.

Unless that concept is an assembly introduction, because assembly introduction cannot include Additional resources.

I was wrong! 🥳 Assembly intros can include additional resources.

jhradilek/asciidoctor-dita-vale#186 (comment)

This will make addressing the requirements of the rule much easier and less disruptive.

@maximiliankolb
Copy link
Copy Markdown
Contributor

Assembly intros

as in "text within an assembly" or "first concept with leveloffset 0 in an assembly"?

@aneta-petrova
Copy link
Copy Markdown
Member Author

Assembly intros

as in "text within an assembly" or "first concept with leveloffset 0 in an assembly"?

Both :) But for our team, only the second one is relevant. The first concept with leveloffset 0 in assembly can contain an .Additional resources section.

@aneta-petrova
Copy link
Copy Markdown
Member Author

I'll record the result of this conversation, along with the proposed solution, in a downstream ticket for further processing. For now, we can close this PR; once we decided on whether and how to implement it, we can reopen it... or raise a new one.

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.

3 participants