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#17650crenshaw-dev merged 9 commits intoargoproj:masterfrom ishitasequeira:multi-source-cli-commands
revisions flag#17650Conversation
|
@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. |
| --revision string Compare live app to a particular revision | ||
| --revisions stringArray Show manifests at specific revisions (comma-separated) for the index of sources in source-indexes | ||
| --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.
intArray type would make it clearer to users and not leak go implementation details
There was a problem hiding this comment.
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
| 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.
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.
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
| localIncludes []string | ||
| appNamespace string | ||
| revisions []string | ||
| sourceIndexes []int64 |
There was a problem hiding this comment.
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.
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.
If flagset support is missing for uint, then let's stick to int64
agaudreault
left a comment
There was a problem hiding this comment.
LGTM. Lets discuss the index at the next contributor meeting
crenshaw-dev
left a comment
There was a problem hiding this comment.
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 <ishiseq29@gmail.com>
|
@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. |
…mand with `revisions` flag (argoproj#17650) * Add support for multiple source to manifests --revision command Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Update GetManifests to support multiple sources Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * remove testing logs Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * update cli docs Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * add extra validation for diff command Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * fix lint Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Empty-Commit Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * revert apimachinery version Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Update docs based on comments Signed-off-by: ishitasequeira <ishiseq29@gmail.com> --------- Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
…mand with `revisions` flag (argoproj#17650) * Add support for multiple source to manifests --revision command Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Update GetManifests to support multiple sources Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * remove testing logs Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * update cli docs Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * add extra validation for diff command Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * fix lint Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Empty-Commit Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * revert apimachinery version Signed-off-by: ishitasequeira <ishiseq29@gmail.com> * Update docs based on comments Signed-off-by: ishitasequeira <ishiseq29@gmail.com> --------- Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
The PR adds support for multiple sources to
argocd app manifestsandargocd app diffcommands. As part of this PR, the support for multiple sources is by the addition of 2 new flags--revisionsand--source-indexes. This 2 flags allow the user to set a revision for a specific source defined by index insource-indexesflag.Examples:
argocd app manifestscommandargocd app diffcommandChecklist: