-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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): add support for multiple sources to app diff|manifests command with revisions
flag
#17650
feat(cli): add support for multiple sources to app diff|manifests command with revisions
flag
#17650
Conversation
@CodiumAI-Agent /review |
PR Review
Code feedback:
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
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.
I like the input parameters, seems like a good and intuitive approach for people using multi sources
--server-side-generate Used with --local, this will send your manifests to the server for diffing | ||
--source-indexes int64Slice List of source indexes. Default is empty array. Indexes start at 1. (default []) |
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.
intArray
type would make it clearer to users and not leak go implementation details
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.
Unfortunately, this is an auto-generated document. I am using int64Slice
datatype for sourceIndexes as we do not have a function to parse int[]
input in flagSet.
go.mod
Outdated
@@ -94,7 +94,7 @@ require ( | |||
gopkg.in/yaml.v3 v3.0.1 | |||
k8s.io/api v0.26.11 | |||
k8s.io/apiextensions-apiserver v0.26.10 | |||
k8s.io/apimachinery v0.26.11 | |||
k8s.io/apimachinery v0.29.3 |
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.
Is that necessary in this PR? IIRC, updating this affect the kubernetes compatibility. It's probably better to update all k8s.io dependency to be in v0.29 in a dedicated PR if necessary.
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.
Will revert this.
Signed-off-by: ishitasequeira <[email protected]>
Signed-off-by: ishitasequeira <[email protected]>
Signed-off-by: ishitasequeira <[email protected]>
Signed-off-by: ishitasequeira <[email protected]>
Signed-off-by: ishitasequeira <[email protected]>
Signed-off-by: ishitasequeira <[email protected]>
Signed-off-by: ishitasequeira <[email protected]>
Signed-off-by: ishitasequeira <[email protected]>
@@ -1125,6 +1125,8 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co | |||
serverSideGenerate bool | |||
localIncludes []string | |||
appNamespace string | |||
revisions []string | |||
sourceIndexes []int64 |
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.
Should this be int64
? I feel we can use uint
or unit32
here as the index positions do not have negative numbers.
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.
The command flagset does not support uint
or uint32
. Thus, had to keep it int
or int64
. Had used int64
to keep it consistent with what is needed by revisionSourceMappings
. I can change this to int
and then typecast it to int64
for creating revisionSourceMappings
.
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.
If flagset support is missing for uint
, then let's stick to int64
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.
LGTM
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.
LGTM. Lets discuss the index at the next contributor meeting
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.
Can you add a Long
usage description for the app manifests
command to provide an example of how to use this?
I'm not sure the docs are correct about the flags being comma-delimited:
It's behaving like it's not comma-delimited but rather repeated:
dist/argocd app manifests test --revisions d7927a27b4533926b7d86b5f249cd9ebe7625e90,53e28ff20cc530b9ada2173fbbd64d48338583ba --source-indexes 1,2
FATA[0000] While using revisions and source-indexes, length of values for both flags should be same.
This seems to work:
dist/argocd app manifests test --revisions d7927a27b4533926b7d86b5f249cd9ebe7625e90 --revisions 53e28ff20cc530b9ada2173fbbd64d48338583ba --source-indexes 1 --source-indexes 2
Should we add an e2e test to make sure the usage is tested?
Signed-off-by: ishitasequeira <[email protected]>
@crenshaw-dev , thanks for testing that out. I updated the doc to remove
Unfortunately, the current setup for e2e tests, would not work for cli commands of multiple sources. |
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.
LGTM!
…mand with `revisions` flag (argoproj#17650) * Add support for multiple source to manifests --revision command Signed-off-by: ishitasequeira <[email protected]> * Update GetManifests to support multiple sources Signed-off-by: ishitasequeira <[email protected]> * remove testing logs Signed-off-by: ishitasequeira <[email protected]> * update cli docs Signed-off-by: ishitasequeira <[email protected]> * add extra validation for diff command Signed-off-by: ishitasequeira <[email protected]> * fix lint Signed-off-by: ishitasequeira <[email protected]> * Empty-Commit Signed-off-by: ishitasequeira <[email protected]> * revert apimachinery version Signed-off-by: ishitasequeira <[email protected]> * Update docs based on comments Signed-off-by: ishitasequeira <[email protected]> --------- Signed-off-by: ishitasequeira <[email protected]>
…mand with `revisions` flag (argoproj#17650) * Add support for multiple source to manifests --revision command Signed-off-by: ishitasequeira <[email protected]> * Update GetManifests to support multiple sources Signed-off-by: ishitasequeira <[email protected]> * remove testing logs Signed-off-by: ishitasequeira <[email protected]> * update cli docs Signed-off-by: ishitasequeira <[email protected]> * add extra validation for diff command Signed-off-by: ishitasequeira <[email protected]> * fix lint Signed-off-by: ishitasequeira <[email protected]> * Empty-Commit Signed-off-by: ishitasequeira <[email protected]> * revert apimachinery version Signed-off-by: ishitasequeira <[email protected]> * Update docs based on comments Signed-off-by: ishitasequeira <[email protected]> --------- Signed-off-by: ishitasequeira <[email protected]>
The PR adds support for multiple sources to
argocd app manifests
andargocd app diff
commands. As part of this PR, the support for multiple sources is by the addition of 2 new flags--revisions
and--source-indexes
. This 2 flags allow the user to set a revision for a specific source defined by index insource-indexes
flag.Examples:
argocd app manifests
commandargocd app diff
commandChecklist: