-
Notifications
You must be signed in to change notification settings - Fork 858
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
Feat: cli def alias support #4185
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4185 +/- ##
==========================================
- Coverage 60.33% 58.86% -1.47%
==========================================
Files 330 331 +1
Lines 31938 31974 +36
==========================================
- Hits 19269 18823 -446
- Misses 10164 10648 +484
+ Partials 2505 2503 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -45,6 +45,8 @@ import ( | |||
const ( | |||
// DescriptionKey the key for accessing definition description | |||
DescriptionKey = "definition.oam.dev/description" | |||
// AliasKey the key for accessing definition alias | |||
AliasKey = "definition.oam.dev/alias" |
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.
let's align the key with where it's used
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.
lost in cli args, fixed.
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.
does velaux apiserver use this alias? @barnettZQG
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.
currently not, but we can use it later
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.
It should be used somewhere or it's meanless.
Signed-off-by: Zhiyu Wang <zhiyuwang.newbis@gmail.com>
Is this alias used in any other places? Like |
We're currently using aliases to show our preferred naming on ux instead of dns-formatted english, which is a great experience. |
Yes, you can also give that experience in |
Okay, I recommend to make this alias also available in |
Yes, it can also be used in vela def get or list, but I'm not sure if there is such a case, maybe we can add when needed |
Signed-off-by: Zhiyu Wang zhiyuwang.newbis@gmail.com
Description of your changes
User can use alias metadata in cue.
Fixes #
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR if necessary.How has this code been tested
go run cmd/plugin/main.go def render test.cue
go run cmd/plugin/main.go def get test-trait
Special notes for your reviewer
The alias field can also be placed in the annotation, but I think it's better as a native field.