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
base: master
Are you sure you want to change the base?
feat(application-controller): Add support for rollback multi-source applications #14124
Conversation
fd30f30
to
b2d284b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14124 +/- ##
==========================================
+ Coverage 49.73% 49.90% +0.17%
==========================================
Files 274 275 +1
Lines 48948 49331 +383
==========================================
+ Hits 24343 24621 +278
- Misses 22230 22310 +80
- Partials 2375 2400 +25 ☔ View full report in Codecov by Sentry. |
Please, put special attention reviewing the frontend because I'm not frontend developer and maybe I have done something terriblely wrong |
Thanks for implementing this. Hope it gets merged soon :) |
Thanks for the PR! We're past feature freeze for 2.8, so I'll queue this up for the 2.9 roadmap. |
Sure 😄 |
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 😄 |
Hoping to have this merged soon. 🙏 |
Hi @crenshaw-dev |
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.
Only had time for a quick glance, opened one can of worms. :-)
fadc943
to
99e0b80
Compare
Sorry, I needed more time that I expected for rebasing the PR 🤦 (the summer break has erased my memory 100%) |
I have removed the logic from here and I have moved it into the state |
Any news on this? Do you guys need an extra pair of hands? |
It's waiting a review 😄 |
@Pehesi97 we need lots of extra pairs of hands. 😆 |
Any predictions on when it will be released? |
@GuerreiroLeonardo , if you could help them reviewing the code, I think this will be faster for sure 😄 |
@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 =/ |
We also consider this PR important, do not have to capabilities to look at the code, but could test it once it gets released. |
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'd want to see:
- design doc
- user facing documentation
- a ui demo (so I can kick the tires) -- the picture in feat(application-controller): Add support for rollback multi-source applications #14124 (comment) should be in the description.
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 |
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.
// 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 |
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 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.
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 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") |
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'd be really nice if errors like this reported at least a pair of sources so that users have something to chase
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 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
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.
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.
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'd try to improve the message 😄
I'll review the logic trying to figure out the best way to print the message
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:
|
Hi @jsoref About the user documentation, the UX is the same because I haven't added any new interaction, I just enabled an already existing button.
Because probably I used the same repository for both sources, sorry. I didn't think that it was important.
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. |
// In case of rollback, this function also updates the targetRevision to the proper revision | ||
func GetRefSources(ctx context.Context, opts GetRefSourcesOptions) (argoappv1.RefTargetRevisionMapping, error) { | ||
refSources := make(argoappv1.RefTargetRevisionMapping) | ||
if len(opts.Sources) > 1 { |
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.
We can avoid the check len(opts.Sources) > 1
as the loop would not be executed if opts.Sources
is empty.
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.
Yeah, but you still can have 1 single item in sources slides, that's the reason. Originally this func received the app itself and checked if spec.HasMultipleSources()
and this is the closer option.
I can remove it if you still think that it's not required
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.
While testing the feature out, it seems, the application is not able to handle rollback from source
to sources
field or vice versa. To reproduce,
- Create a single multi-source application
- Update the application to be of a single source, i.e. remove
spec.sources
and addspec.source
. - Try rolling back to the previous version. It does not rollback the app to
spec.sources
.
yeah, I didn't support changing between both because I thought that it wasn't an scenario, but I can check and try to extend the PR to support it too, let me check it. Do the other changes work as expected? |
…pplications 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>
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>
867fbcc
to
6203cbf
Compare
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@ishitasequeira , I've updated the PR supporting changes between single source and multi source. PTAL when you have some time. |
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
I'm not sure why the docker image is not built well, but I'd say that it's not related with my changes due to the message:
|
}} | ||
details={details} | ||
/> | ||
<div className='row'> |
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'm working on adding the multi-source support in what is currently the Parameters tab. For example, see PR. This is part of the proposal to support multi-source apps in the UI here, which references your PR. In order to better distinguish between the sources, I thought that showing the index within the sources field would help. So around this area, what do you think about adding a title here, something like what is depicted in my screenshots. It could be as simple as showing Source {i+1}
On a separate note, I made the current Edit card a collapsible section, and this is something 'new' to the UI. If there are many sources, and the list of parameters can get really long, it could get unwieldy and difficult to use. What you have here is fine as is, since the info is read-only. In order to get your PR merged, I think we could make these rows collapsible in a future PR (in order to align the multi-source presentation).
value: ( | ||
<Revision | ||
repoUrl={utils.getAppDefaultSource(application).repoURL} | ||
revision={utils.getAppDefaultSyncRevision(application) + utils.getAppDefaultSyncRevisionExtra(application)} |
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.
Check if the extra part should be part of the revision field value, which might be included as part of the hyperlink
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 className='fa fa-ellipsis-h' /> | ||
</button> | ||
)} | ||
{onClick && <button className='application-status-panel__more-button' />} |
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.
There was a 'More' button here before Ishita disabled it. Is this the new intended behavior?
@@ -93,7 +93,15 @@ export const ApplicationOperationState: React.StatelessComponent<Props> = ({appl | |||
}); | |||
} | |||
if (operationState.syncResult) { | |||
operationAttributes.push({title: 'REVISION', value: <Revision repoUrl={utils.getAppDefaultSource(application).repoURL} revision={operationState.syncResult.revision} />}); |
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.
Previously, the revision value wouldn't be displayed until the operation has finished. Seems like in this new behavior, the revision represents the most recent, successfully synced revision, and therefore will always show here, even if the operation is in progress. Is this the intended design? Is the if check on syncResult needed?
@@ -107,13 +102,14 @@ export const ApplicationStatusPanel = ({application, showDiff, showOperation, sh | |||
<div className='application-status-panel__item-name' style={{marginBottom: '0.5em'}}> | |||
{application.spec.syncPolicy?.automated ? 'Auto sync is enabled.' : 'Auto sync is not enabled.'} | |||
</div> | |||
{application.status && application.status.sync && application.status.sync.revision && !application.spec.source.chart && ( | |||
{application.status && application.status.sync && application.status.sync.revision && revision && !application.spec.source.chart && ( |
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.
Could application.status.sync.revision && revision
be simplified to just revision
?
<div className='application-status-panel__item-name' style={{marginBottom: '0.5em'}}> | ||
{appOperationState.phase} <Timestamp date={appOperationState.finishedAt || appOperationState.startedAt} /> | ||
</div> | ||
{(appOperationState.syncResult && appOperationState.syncResult.revision && ( | ||
{(appOperationState.syncResult && revision && ( |
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.
See my other comment regarding the operation sync result
Thanks @JorTurFer for updating the PR with the use-case. It seems to be working now. The issue you mentioned has been fixed in master. Once you rebase your PR, the issue should get resolved. |
Hi @JorTurFer any idea when you're gonna be able to look into these issues? |
I really appreciate the feedback @keithchong! Sadly, I don't have enough time nowadays to address it, there have been a lot of changes in the UI since I checked it time ago and I'm not frontend developer, so understand the UI requires a huge time to me. As the backend is almost ready, and it works, would be you willing to be invited to my repo and help me with those changes directly there (I've already invited you, just in case)? I feel that you have more context about how the things have to be done in front side. This offer is extensible to any other contributor who is willing to do it, I don't have problems adding them to my fork. I see that you have pushed the UI proposal (btw, it looks nice, congrats!) and maybe you can adapt current UI to that proposal. Other option can be just reverting all the UI changes and keep only the backend + cli support. Any other folk can continue from there on their own fork without all the (probably terrible) decisions that I took in front. @ishitasequeira ? And sorry again, we are in the middle of a hard project and I don't think that I can solve the front issues soon 😞 |
Hi @JorTurFer , reverting or taking away your UI changes might be a bit extreme. I'll see if I can fix the link issue and any other 'straight-forward' issues. For the other concerns, I think we should open follow-on Issues and address them in separate PRs, hopefully for the next release. Aligning the look and feel and adding back the 'More' button should not be blocking your PR. IMO, from the issues I saw, the incorrect status for the sync operation in progress is probably higher priority, because it is misleading information. |
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:
Please see Contribution FAQs if you have questions about your pull-request.
Fixes #12580