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(application-controller): Add support for rollback multi-source applications #14124

Merged

Conversation

JorTurFer
Copy link
Contributor

@JorTurFer JorTurFer commented Jun 19, 2023

Signed-off-by: Jorge Turrado jorge.turrado@scrm.lidl

Currently, ArgoCD support multi-source applications and that's a really nice feature, but using multi source, end users have to sacrify the option of executing fast rollbacks because the rollbacks are not supported for multi-source applications.
This PR adds the support for rollback multi-source applications (as single source applications do)

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

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 don't think so, does it?)
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • 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.

Please see Contribution FAQs if you have questions about your pull-request.

Fixes #12580

@JorTurFer JorTurFer changed the title enable buttons and support multiversion in details feat(application-controller): Add support for rollback multi-source applications using the UI Jun 19, 2023
@JorTurFer JorTurFer force-pushed the multi-source-history-rollback branch from fd30f30 to b2d284b Compare June 20, 2023 16:34
@JorTurFer JorTurFer marked this pull request as ready for review June 22, 2023 16:29
@JorTurFer JorTurFer marked this pull request as draft June 22, 2023 16:46
@JorTurFer JorTurFer marked this pull request as ready for review June 22, 2023 21:45
@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Attention: Patch coverage is 62.16216% with 42 lines in your changes missing coverage. Please review.

Project coverage is 45.01%. Comparing base (2547abc) to head (26dd5ff).
Report is 5 commits behind head on master.

Files Patch % Lines
server/application/application.go 54.54% 13 Missing and 7 partials ⚠️
controller/sync.go 60.00% 3 Missing and 3 partials ⚠️
util/webhook/webhook.go 0.00% 6 Missing ⚠️
pkg/apis/application/v1alpha1/types.go 0.00% 4 Missing ⚠️
cmd/argocd/commands/app.go 0.00% 0 Missing and 2 partials ⚠️
server/repository/repository.go 90.47% 1 Missing and 1 partial ⚠️
util/argo/argo.go 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14124      +/-   ##
==========================================
+ Coverage   45.00%   45.01%   +0.01%     
==========================================
  Files         354      354              
  Lines       47959    48018      +59     
==========================================
+ Hits        21582    21617      +35     
- Misses      23574    23594      +20     
- Partials     2803     2807       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JorTurFer
Copy link
Contributor Author

JorTurFer commented Jun 22, 2023

Please, put special attention reviewing the frontend because I'm not frontend developer and maybe I have done something terriblely wrong

@JorTurFer
Copy link
Contributor Author

This is how it looks in the frontend:
image

image

@JorTurFer JorTurFer changed the title feat(application-controller): Add support for rollback multi-source applications using the UI feat(application-controller): Add support for rollback multi-source applications Jun 30, 2023
@ownyrd
Copy link

ownyrd commented Jul 3, 2023

Thanks for implementing this. Hope it gets merged soon :)

@crenshaw-dev
Copy link
Collaborator

Thanks for the PR! We're past feature freeze for 2.8, so I'll queue this up for the 2.9 roadmap.

@JorTurFer
Copy link
Contributor Author

Thanks for the PR! We're past feature freeze for 2.8, so I'll queue this up for the 2.9 roadmap.

Sure 😄
Do you have any ETA for reviewing the PR? No rush at all, it's just for fixing merge conflicts when you are going to review it to not be rebasing it all the time xD

@crenshaw-dev
Copy link
Collaborator

Makes sense! At least 3 weeks out, I'm focusing on getting 2.8 ready for GA for now.

@JorTurFer
Copy link
Contributor Author

JorTurFer commented Jul 18, 2023

Makes sense! At least 3 weeks out, I'm focusing on getting 2.8 ready for GA for now.

After vacations (I'll take them the first half of August so during second half) looks as a nice moment to rebase the PR with latest changes 😄
Thanks for the info 🙇

@kewei5zhang
Copy link

Hoping to have this merged soon. 🙏

@JorTurFer
Copy link
Contributor Author

Hi @crenshaw-dev
Is it now a good moment to rebase my PR? 😄

Copy link
Collaborator

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

Only had time for a quick glance, opened one can of worms. :-)

reposerver/repository/repository.proto Outdated Show resolved Hide resolved
@JorTurFer JorTurFer force-pushed the multi-source-history-rollback branch from fadc943 to 99e0b80 Compare August 17, 2023 14:16
@JorTurFer
Copy link
Contributor Author

Sorry, I needed more time that I expected for rebasing the PR 🤦 (the summer break has erased my memory 100%)

@JorTurFer
Copy link
Contributor Author

I have removed the logic from here and I have moved it into the state

@Pehesi97
Copy link

Any news on this? Do you guys need an extra pair of hands?

@JorTurFer
Copy link
Contributor Author

Any news on this? Do you guys need an extra pair of hands?

It's waiting a review 😄

@crenshaw-dev
Copy link
Collaborator

@Pehesi97 we need lots of extra pairs of hands. 😆

@GuerreiroLeonardo
Copy link

Any predictions on when it will be released?

@JorTurFer
Copy link
Contributor Author

@GuerreiroLeonardo , if you could help them reviewing the code, I think this will be faster for sure 😄
I guess that we are a bit overloaded atm with the summer break and the last release

@GuerreiroLeonardo
Copy link

GuerreiroLeonardo commented Sep 6, 2023

@GuerreiroLeonardo , if you could help them reviewing the code, I think this will be faster for sure 😄 I guess that we are a bit overloaded atm with the summer break and the last release

@JorTurFer JorTurFer I wish I could, I have no knowledge on the argoCD code. I am simply a user right now hahah. I gues it would take a lot of hours until I am proficient enough to give any relevant contribution. Sorry =/
I guess maybe crenshaw-dev could help

@gioppoluca
Copy link

We also consider this PR important, do not have to capabilities to look at the code, but could test it once it gets released.

Copy link
Member

@jsoref jsoref left a comment

Choose a reason for hiding this comment

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

I'd want to see:

Note that I'm not wearing a project owner hat, this what I'd want as a drive-by reviewer / UI person / end user.

}

// GetRefSources creates a map of ref keys (from the sources' 'ref' fields) to information about the referenced source.
// This function also validates the references use allowed characters and does not define the same ref key more than
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// This function also validates the references use allowed characters and does not define the same ref key more than
// This function also validates the references use allowed characters and do not define the same ref key more than

Choose a reason for hiding this comment

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

Is a spelling error on a comment a good reason to ask for a review on such a feature? Seems a good way to make contributors stop contributing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took the code from argo.go and I moved it as it was and i didn't notice it. I'll update it 😄

}
refKey := "$" + source.Ref
if _, ok := refKeys[refKey]; ok {
return nil, fmt.Errorf("invalid sources: multiple sources had the same `ref` key")
Copy link
Member

Choose a reason for hiding this comment

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

it'd be really nice if errors like this reported at least a pair of sources so that users have something to chase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took the code from argo.go and I moved it as it is but I could add the key to the message if you think is useful

Copy link
Member

Choose a reason for hiding this comment

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

My goal is to be able to read a message and figure out how to address it. If this error will be shown as is, I'd want to see the id of the thing (is it an application/<x>?) and two sources that had the same ref (preferably with the ref). If it's going to be pasted w/ other things, then as long as once it's pasted it has those bits, that'd make it usable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd try to improve the message 😄
I'll review the logic trying to figure out the best way to print the message

@jsoref
Copy link
Member

jsoref commented Sep 26, 2023

In:

Why do I see the same revision twice?

If I can't kick the tires, could you at please kick the tires for me?

User Story:

  1. User has a "multi-source application" (some sample content for me to look at)
  2. User deploys it (show picture of screens)
  3. User makes a change (?) (show change, picture of how things change)
  4. User needs to trigger a rollback (show path through UI that user takes to trigger it)
  5. User sees rollback complete (show how the UI looks)
  6. User wants to review to see what rollback(s) have happened (show path through UI for this).

@JorTurFer
Copy link
Contributor Author

JorTurFer commented Sep 26, 2023

design doc
user facing documentation
a ui demo (so I can kick the tires) -- the picture in #14124 (comment) should be in the description.

Hi @jsoref
I appreciate your feedback but you couldn't see those things just because the PR template doesn't require them and I'm new contributing to this project.
I followed it and I have tried to do my best, but based on the documentation I had, those things weren't required. If you point me to any doc about how can I provide the UI demo, I'd be more than happy providing it. I'd really appreciate any guide on that part because I'm totally lost in front side.

About the user documentation, the UX is the same because I haven't added any new interaction, I just enabled an already existing button.

Why do I see the same revision twice?

Because probably I used the same repository for both sources, sorry. I didn't think that it was important.

If I can't kick the tires, could you at please kick the tires for me?

Except for how the multiple sources are presented, all the other points are exactly the same as the current scenario. It's true that I added the extra sources information to the UI (using the parenthesis), but I can remove it if you think that it's wrong.

JorTurFer and others added 14 commits June 10, 2024 19:30
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
@JorTurFer JorTurFer force-pushed the multi-source-history-rollback branch from 9813bdd to 49a8b31 Compare June 10, 2024 17:30
Copy link
Member

@ishitasequeira ishitasequeira left a comment

Choose a reason for hiding this comment

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

LGTM!! Thanks @JorTurFer !! Approving with fact that @keithchong will be raising a follow on PR to fix the UI issues he identified.

@ishitasequeira ishitasequeira merged commit 0e531c9 into argoproj:master Jun 10, 2024
28 checks passed
@JorTurFer
Copy link
Contributor Author

Thanks @crenshaw-dev @ishitasequeira and @keithchong for your support! ❤️

@richardpj
Copy link

This is wonderful news! Thank you all for your efforts.

@JorTurFer JorTurFer deleted the multi-source-history-rollback branch June 11, 2024 06:33
timgriffiths pushed a commit to timgriffiths/argo-cd that referenced this pull request Jun 11, 2024
…pplications (argoproj#14124)

* feat(application-controller): Add support for rollback multi-source applications

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* regenerate codegen after rebase

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix tests

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix front linting

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* update test

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* update codegen

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* Update server/application/application.go

Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>

* apply feedback

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix errors

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* add support for switching between single and multi

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix dereference issue

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* remove unnecesary code

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* Rebase master

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

* fix style

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix reference

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* add a comment

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

---------

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
mkieweg pushed a commit to mkieweg/argo-cd that referenced this pull request Jun 11, 2024
…pplications (argoproj#14124)

* feat(application-controller): Add support for rollback multi-source applications

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* regenerate codegen after rebase

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix tests

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix front linting

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* update test

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* update codegen

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* Update server/application/application.go

Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>

* apply feedback

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix errors

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* add support for switching between single and multi

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix dereference issue

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* remove unnecesary code

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* Rebase master

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

* fix style

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix reference

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* add a comment

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

---------

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Hariharasuthan99 pushed a commit to AmadeusITGroup/argo-cd that referenced this pull request Jun 16, 2024
…pplications (argoproj#14124)

* feat(application-controller): Add support for rollback multi-source applications

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* regenerate codegen after rebase

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix tests

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix front linting

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* update test

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* update codegen

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* Update server/application/application.go

Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>

* apply feedback

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix errors

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* add support for switching between single and multi

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix dereference issue

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* remove unnecesary code

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* Rebase master

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

* fix style

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix reference

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* add a comment

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

---------

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
jsolana pushed a commit to jsolana/argo-cd that referenced this pull request Jul 24, 2024
…pplications (argoproj#14124)

* feat(application-controller): Add support for rollback multi-source applications

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* regenerate codegen after rebase

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix tests

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix front linting

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* update test

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* update codegen

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* Update server/application/application.go

Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>

* apply feedback

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix errors

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* add support for switching between single and multi

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix dereference issue

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* remove unnecesary code

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* Rebase master

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

* fix style

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* fix reference

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>

* add a comment

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

---------

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com>
Signed-off-by: Javier Solana <javier.solana@cabify.com>
Signed-off-by: Javier Solana <javier.solana@cabify.com>
@afreyermuth98
Copy link

Hello !
Any idea when this feature would be available on a release ? :)

@blakepettersson
Copy link
Member

@afreyermuth98 this should be available in 2.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

Support for rollback in multiple sources