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

Add support for a map of labels in the flow validator #2006

Closed
anna-geller opened this issue Aug 31, 2023 · 1 comment · Fixed by #2009
Closed

Add support for a map of labels in the flow validator #2006

anna-geller opened this issue Aug 31, 2023 · 1 comment · Fixed by #2009
Assignees
Labels
enhancement New feature or request

Comments

@anna-geller
Copy link
Member

Feature description

We want to support both options for the definition of labels.

  1. A list of key-value pairs:
id: myflow
namespace: dev
labels:
  - key: team
    value: data
  - key: project
    value: dwh
  1. A map of labels:
id: myflow
namespace: dev
labels:
  team: data
  project: dwh

Initially, option 2 was the default.
Now, option 1 is the default and the validator complains when using the Map syntax.

Both work, but the validator currently only accepts the first option.

Both options are valid. This issue is to bring back support for the Map of labels on the schema for both web validator and VS Code extension.

@anna-geller anna-geller added the enhancement New feature or request label Aug 31, 2023
@github-project-automation github-project-automation bot moved this to Backlog in All issues Aug 31, 2023
@anna-geller anna-geller changed the title The labels validator should support both map and a list of key-value pairs Add support for a map of labels in the flow validator Aug 31, 2023
@loicmathieu loicmathieu self-assigned this Sep 1, 2023
@loicmathieu
Copy link
Member

We can support both but in this case the validator will not be aware of the Label type anymore so it will validate any arrays.

Using a map will works

labels:
  key: value

Using a list of labels will work

labels:
  - key: key
    value: value1

The following will validate but create an invalid label in the database (not that it will not crash even at validation time)

labels:
  - toto: titi

@loicmathieu loicmathieu moved this from Backlog to Ready in All issues Sep 1, 2023
@loicmathieu loicmathieu moved this from Ready to In Progress in All issues Sep 1, 2023
@loicmathieu loicmathieu moved this from In Progress to Review in All issues Sep 1, 2023
tchiotludo pushed a commit that referenced this issue Sep 5, 2023
@github-project-automation github-project-automation bot moved this from Review to Done in All issues Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants