-
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
fix(ui): source can in fact be undefined
#20381
fix(ui): source can in fact be undefined
#20381
Conversation
The assumption that a source is always there is not always true. To repro, create an app-of-apps containing a single app without any `source` present. In the UI this will crash, horribly. This PR fixes that so that instead of crashing the user will get useful info indicating what is wrong with the app. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
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 agree that by mistake there can be cases where an app is deployed without source but the UI shouldn't crash, and should throw appropriate errors.
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 not sure I understand the target experience(s) here. There are a lot of new nil checks which will presumably replace a bad error message with some other behavior, but it's not clear what the other behavior will be. Seems like we should probably be detecting misconfigurations at a high level, showing a tailored error message, and short-circuiting the field access code paths entirely.
ui/src/app/applications/components/application-parameters/application-parameters.tsx
Outdated
Show resolved
Hide resolved
The target experience is to display what is in the screenshot. When the For a bit more context, @34fathombelow got paged by a customer due to this issue (they having misconfigured an application in this manner), which is the driver of this PR. Granted that I've sprinkled the coalescing operator a bit too liberally here and can do some amendments for that...
I agree in principle, but the issue here is that we would need to figure out a whole new flow(s) for that. UX wise this would present a completely different flow than what users usually expect when their apps are misconfigured. Or am I misunderstanding something here? |
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Will review again! Makes sense, gotta be pragmatic about the cost of special error handling vs. just having reasonable fallback behavior. |
Merging since we're aligned on design, and @gdsoumya approved. Support has been brutal this week, won't have time to review myself. |
We feel you, it's been the same for us at Akuity as well 😞 |
/cherry-pick release-2.13 |
/cherry-pick release-2.12 |
* fix(ui): source can in fact be `undefined` The assumption that a source is always there is not always true. To repro, create an app-of-apps containing a single app without any `source` present. In the UI this will crash, horribly. This PR fixes that so that instead of crashing the user will get useful info indicating what is wrong with the app. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * chore(ui): some cr tweaks Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * chore(ui): some cr tweaks Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> --------- Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
/cherry-pick release-2.11 |
Cherry-pick failed with |
Cherry-pick failed with |
* fix(ui): source can in fact be `undefined` The assumption that a source is always there is not always true. To repro, create an app-of-apps containing a single app without any `source` present. In the UI this will crash, horribly. This PR fixes that so that instead of crashing the user will get useful info indicating what is wrong with the app. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * chore(ui): some cr tweaks Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * chore(ui): some cr tweaks Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> --------- Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* fix(ui): source can in fact be `undefined` The assumption that a source is always there is not always true. To repro, create an app-of-apps containing a single app without any `source` present. In the UI this will crash, horribly. This PR fixes that so that instead of crashing the user will get useful info indicating what is wrong with the app. * chore(ui): some cr tweaks * chore(ui): some cr tweaks --------- Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
* fix(ui): source can in fact be `undefined` The assumption that a source is always there is not always true. To repro, create an app-of-apps containing a single app without any `source` present. In the UI this will crash, horribly. This PR fixes that so that instead of crashing the user will get useful info indicating what is wrong with the app. * chore(ui): some cr tweaks * chore(ui): some cr tweaks --------- Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* fix(ui): source can in fact be `undefined` The assumption that a source is always there is not always true. To repro, create an app-of-apps containing a single app without any `source` present. In the UI this will crash, horribly. This PR fixes that so that instead of crashing the user will get useful info indicating what is wrong with the app. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * chore(ui): some cr tweaks Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * chore(ui): some cr tweaks Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> --------- Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
With argoproj#20381 multi-source apps were not taken into account 🤦 Fixes argoproj#20445. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* fix(ui): source can in fact be `undefined` The assumption that a source is always there is not always true. To repro, create an app-of-apps containing a single app without any `source` present. In the UI this will crash, horribly. This PR fixes that so that instead of crashing the user will get useful info indicating what is wrong with the app. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * chore(ui): some cr tweaks Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * chore(ui): some cr tweaks Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> --------- Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> Signed-off-by: Adrian Aneci <aneci@adobe.com>
With argoproj#20381 multi-source apps were not taken into account 🤦 Fixes argoproj#20445. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> Signed-off-by: Adrian Aneci <aneci@adobe.com>
The assumption that a source is always there is not always true. To repro, create an app-of-apps containing a single app without any
source
present (an example can be found at https://github.com/blakepettersson/broken-app-of-apps). In the UI this will crash, horribly. This PR fixes that so that instead of crashing the user will get useful info indicating what is wrong with the app.Presumably fixes #15545.
Cherry-pick for at least 2.12 and 2.13, perhaps even lower depending how easy this is to port.
Checklist: