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

[OPENJDK-1963] document MAVEN_MIRRORS upcasing behaviour #404

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

jmtd
Copy link
Member

@jmtd jmtd commented Oct 9, 2023

rewrite description of MAVEN_MIRRORS to properly document the format of the parameter (uppercase, dashes get replaced with underscores).

https://issues.redhat.com/browse/OPENJDK-1963

modules/maven/default/module.yaml Outdated Show resolved Hide resolved
Comment on lines 46 to 53
See also: `prefix_MAVEN_MIRROR_ID`; `prefix_MAVEN_MIRROR_OF`;
`prefix_MAVEN_MIRROR_URL`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is meant by prefix_MAVEN_MIRROR_ID. Is it meant to point to a variable, like if MAVEN_MIRRORS=one then prefix becomes ONE_? If so, how about using <prefix>_MAVEN_MIRROR_ID etc. and including the example last, which would tie everything together?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're guess is right, that's what it's intended to be used as. There's no tooling that puts in cross-reference hyperlinks, (yet), but it's intended to point the reader at the entry for prefix_MAVEN_MIRROR_URL, elsewhere. Since prefix_ is indeed a placeholder, we could adopt a nomenclature to make that clearer. I'll have to experiment to make sure that the GHA scripts don't choke on chevrons.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use <prefix>_MAVEN_MIRROR_URL without breaking anything.

if we used <<prefix_MAVEN_MIRROR_URL>>, the doc generator would put an internal hyperlink in to a section labelled with the same name. To make the label, we would need the intermediate asciidoctor for the target text to look like [[prefix_MAVEN_MIRROR_URL]]prefix_MAVEN_MIRROR_URL. This could be achieved with

- name: '[[prefix_MAVEN_MIRROR_URL]]prefix_MAVEN_MIRROR_URL'
  description: "The URL of the mirror."
  example: "http://10.0.0.1:8080/repository/internal"

but that's ugly. Alternatively the python script could automatically generate the [[]] anchor part for every row.

This might be clearer with a POC and I'm conflating two things here

  • adding cross-references between entries
  • replacing prefix_SOME_THING to make clearer to humans that prefix_ is a placeholder

rewrite description of MAVEN_MIRRORS to properly document the format
of the parameter (uppercase, dashes get replaced with underscores).

Signed-off-by: Jonathan Dowland <[email protected]>
@jmtd jmtd force-pushed the OPENJDK-1963-MAVEN_MIRRORS-case branch from f67fbb8 to e10b056 Compare October 25, 2023 09:21
Where we refer to an environment variable with a portion to be
substituted, e.g. `prefix_MAVEN_MIRROR_ID` where "prefix" will
be substitute by something like APP1, depending on the value of
`MAVEN_MIRRORS`, use the convention "<prefix>", to indicate that
the value is a placeholder.

Signed-off-by: Jonathan Dowland <[email protected]>
@jmtd
Copy link
Member Author

jmtd commented Nov 27, 2023

I've pushed a commit that standardizes on <prefix>_ when referencing an environment variable pattern, and filed https://github.com/jboss-container-images/openjdk/issues/422 to track further improvements to the way we reference variables in descriptions.

@jmtd jmtd merged commit d7d81df into rh-openjdk:ubi9 Nov 27, 2023
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