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

refactor(cli): dynamically get versioned links to documentation #13455

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

Joibel
Copy link
Member

@Joibel Joibel commented Aug 12, 2024

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 previous const values to be functions as this is now runtime determined. Making the whole thing const 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 for argo server. Forcing the version to 3.5 generates expected 3.5 links.

@Joibel Joibel assigned Joibel and isubasinghe and unassigned Joibel Aug 12, 2024
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 <[email protected]>
@Joibel Joibel added the area/docs Incorrect, missing, or mistakes in docs label Aug 12, 2024
@Joibel Joibel enabled auto-merge (squash) August 12, 2024 10:16
@Joibel Joibel merged commit a572e71 into main Aug 12, 2024
30 checks passed
@Joibel Joibel deleted the versioned-doc-links branch August 12, 2024 10:24
@agilgur5 agilgur5 changed the title fix(docs): Provide versioned links to documentation fix(cli): Provide versioned links to documentation Aug 12, 2024
@agilgur5 agilgur5 added the area/cli The `argo` CLI label Aug 12, 2024
@agilgur5 agilgur5 changed the title fix(cli): Provide versioned links to documentation fix(cli): dynamically get versioned links to documentation Aug 12, 2024
pkg/apis/workflow/v1alpha1/version_types.go Show resolved Hide resolved
@@ -1,13 +1,35 @@
package help

const (
root = "https://argo-workflows.readthedocs.io/en/latest"
Copy link
Member

@agilgur5 agilgur5 Aug 14, 2024

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

Copy link
Member Author

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.

Joibel added a commit that referenced this pull request Aug 15, 2024
Signed-off-by: Alan Clucas <[email protected]>
@agilgur5 agilgur5 changed the title fix(cli): dynamically get versioned links to documentation refactor(cli): dynamically get versioned links to documentation Sep 14, 2024
Joibel added a commit to pipekit/argo-workflows that referenced this pull request Sep 19, 2024
Joibel added a commit that referenced this pull request Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli The `argo` CLI area/docs Incorrect, missing, or mistakes in docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants