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

fix(ui): allow links to metadata with dots. Fixes #11741 #13752

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

Joibel
Copy link
Member

@Joibel Joibel commented Oct 14, 2024

Fixes #11741

Motivation

You cannot create UI links to our own annotations or labels.

Argo Workflows uses the format workflows.argoproj.io/something for annotations and labels. These annotations and labels have dots (.) in them.

The links documentation says you can access all workflow fields, using a dot to go down into the child entry.

These two conflict making it impossible to access our own labels and annotations, so fix it for annotations and labels.

This was discovered whilst adding an annotation to the workflows that was useful to link from in a separate feature.

Modifications

When splitting the variable name up use a specialised splitting function that understands that things under workflow.metadata.labels and workflow.metadata.annotations are always names and not to split further. It is crude

Verification

Added a unit test for the hit the special code case. There are already unit tests which test the other case.

Manually tested my new link works.

Signed-off-by: Alan Clucas <alan@clucas.org>
@Joibel Joibel added the area/ui label Oct 14, 2024
@Joibel Joibel marked this pull request as ready for review October 14, 2024 11:00
@Joibel Joibel changed the title fix(ui): allow dotted links to metadata with dots fix(ui): allow links to metadata with dots Oct 14, 2024
@agilgur5 agilgur5 changed the title fix(ui): allow links to metadata with dots fix(ui): allow links to metadata with dots Oct 14, 2024
@agilgur5 agilgur5 changed the title fix(ui): allow links to metadata with dots fix(ui): allow links to metadata with dots. Fixes #11741 Oct 14, 2024
Copy link
Contributor

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

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

LGTM. This is one of the two approaches I mentioned in #11741 (comment)

@agilgur5 agilgur5 merged commit 6d9e0f5 into argoproj:main Oct 14, 2024
20 checks passed
@agilgur5
Copy link
Contributor

For reference, links are also an outlier in using their own custom, simplified templating system and with their own syntax; see also: #8626

@Joibel Joibel deleted the link-dot-fix branch October 15, 2024 07:24
isubasinghe pushed a commit that referenced this pull request Oct 30, 2024
Signed-off-by: Alan Clucas <alan@clucas.org>
isubasinghe pushed a commit that referenced this pull request Oct 30, 2024
Signed-off-by: Alan Clucas <alan@clucas.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: links for label containing dot not working
2 participants