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

feat(cli): add support for multiple sources to sync command #18016

Conversation

ishitasequeira
Copy link
Member

Cherry-picking #17808

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

use arrays instead of map to display ApplicationManifetQuery fields in swagger

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

rebase and update logic for sync command

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

update conditions

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

update displayRevisions on OperationState

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

remove rerunreport file

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

fix index 0 out of bounds error

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

Address comments

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

fix codegen

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

rename GetSourcePtrBySourceIndex to GetSourcePtrByIndex

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

rename GetSourcePtrBySourcePosition to GetSourcePtrByPosition

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

rebase with master and resolve conflicts

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

fix codegen

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

Address feedback and add tests

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

fix unit test

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
@ishitasequeira ishitasequeira requested review from a team as code owners April 29, 2024 15:21
@ishitasequeira ishitasequeira changed the title Cherry pick sync command multisource feat(cli): add support for multiple sources to sync command Apr 29, 2024
Copy link
Contributor

@todaywasawesome todaywasawesome left a comment

Choose a reason for hiding this comment

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

I made some small comments but I don't see anything worth slowing this down.

Might want a 2nd review on the changes to application.go as that's more core.

@@ -1849,6 +1851,9 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
argocd app sync -l '!app.kubernetes.io/instance'
argocd app sync -l 'app.kubernetes.io/instance notin (my-app,other-app)'

# Sync a multi-source application for specific revision of specific sources
argocd app manifests my-app --revisions 0.0.1 --source-positions 1 --revisions 0.0.2 --source-positions 2
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I wonder if we should have named sources too. Maybe a followup PR, not worth stalling this one.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is an open issue opened for the same as a future enhancement. #17731

"type": "array",
"items": {
"type": "string",
"format": "int64"
Copy link
Contributor

Choose a reason for hiding this comment

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

We could probably use int8, I doubt we'll ever have more than 127 source positions to worry about.

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, the command flagset does not support int8. Kept it int64 to avoid unwanted typecasting between command and api server.

@pasha-codefresh pasha-codefresh merged commit f875931 into argoproj:release-2.11 Apr 29, 2024
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants