-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
refactor(cli): dynamically get versioned links to documentation #13455
Conversation
Instead of always linking to latest, link to the versioned documentation where the version of the built software is known Signed-off-by: Alan Clucas <alan@clucas.org>
b79d9e1
to
c57e99a
Compare
@@ -1,13 +1,35 @@ | |||
package help | |||
|
|||
const ( | |||
root = "https://argo-workflows.readthedocs.io/en/latest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised in response to this
Instead of always linking to latest, link to the versioned documentation where the version of the built software is known
For reference, this was versioned before as well -- each release branch changes the tail of its root
.
See also #12446, #12462, #12473.
That's why I changed the title to say "dynamically get", as before it was statically referenced. The dynamic variant is more resilient to change, so I think that's a good change.
The scope is also for the CLI in this case; per the above PRs, there are still several other places that use static version links that could be updated to use this dynamic variant instead.
Some won't be updatable as they're in static documentation (e.g. example YAML, swagger, direct README and other direct markdown (vs docs website rendered), etc). UI would also need similar code to pull out the version numbers to make its references dynamic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is this story: I forgot this existed at all when writing #13265, despite me having used it before in #11646 - so #13265 wasn't using this, and I wrote this function and pulled it out into this PR.
Anyway, I think we're in agreement this is a good change, so I'll fix up some of it in #13265.
Signed-off-by: Alan Clucas <alan@clucas.org>
Signed-off-by: Alan Clucas <alan@clucas.org>
Signed-off-by: Alan Clucas <alan@clucas.org>
Raised in response to this
Motivation
Instead of always linking to latest, link to the versioned documentation where the version of the built software is known
Modifications
Added a method to split the software version into components.
Changed help.
root
to provide a versioned link to documentation and modified all previousconst
values to be functions as this is now runtime determined. Making the whole thingconst
may be possible but the current encapsulation is nice and none of this is important for performance.Removed the unused WorkflowTemplates doc links
Verification
make codegen
still generates the same link forargo server
. Forcing the version to 3.5 generates expected 3.5 links.