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

fix: show tier-releated error msg for HVD clusters upon sync activation #27189

Merged
merged 4 commits into from
May 24, 2024

Conversation

andaley
Copy link
Contributor

@andaley andaley commented May 23, 2024

πŸ› οΈ Description

βž• show HVD clusters a more specific error when attempts to activate fail
πŸ› 🧹 ensure activation errors are cleared once the user tries to re-activate

  • enterprise tests pass locally

πŸ“Έ Screenshots

Screen.Recording.2024-05-22.at.5.25.42.PM.mov

πŸ—οΈ How to Build and Test the Change

The best way to reproduce this is by hard coding the flags service so isHvdManaged returns true, and then forcing an error to the activate endpoint by changing the API path to something invalid. Check out the screenshot below for an example:

Screenshot 2024-05-22 at 5 27 58β€―PM

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label May 23, 2024
Copy link

github-actions bot commented May 23, 2024

CI Results:
All Go tests succeeded! βœ…

@andaley andaley added this to the 1.17.0-rc milestone May 23, 2024
@andaley andaley marked this pull request as ready for review May 23, 2024 01:01
@andaley andaley requested a review from a team as a code owner May 23, 2024 01:01
Comment on lines +76 to +81
if (this.args.isHvdManaged) {
errors.push(
'Secrets Sync is available for Plus tier clusters only. Please check the tier of your cluster to enable Secrets Sync.'
);
}
this.activationErrors = errors;
Copy link
Contributor Author

@andaley andaley May 23, 2024

Choose a reason for hiding this comment

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

this is subtle, but it ensures we display both the raw API error and a more HVD-specific error in case the reason for the failure is due to the cluster having an incorrect tier. the result is 2 error banners, like so:

Screenshot 2024-05-22 at 5 14 34β€―PM

i considered showing only the tier error, but i didn't feel good about obfuscating the true server error just in case it occurred for any other reason (even though it should be very unlikely). i also considered trying to keep both error messages within the same error banner but that would require edits to the <MessageError /> component which started to feel like too much scope creep for an item we'd like to get in ASAP.

open to other ideas!

@andaley andaley force-pushed the ui/vault-27413/update-activate-error branch from a0c1474 to 535d15b Compare May 23, 2024 01:06
Copy link

Build Results:
All builds succeeded! βœ…

Comment on lines +65 to +68
@action
clearActivationErrors() {
this.activationErrors = null;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops, looks like i missed this when implementing the sync activation modal. this ensures those errors are cleared once a user re-clicks the "confirm" button in the activation modal.

@onDismiss={{fn (mut this.hideError) true}}
data-test-opt-in-error
/>
<MessageError @errors={{this.activationErrors}} @onDismiss={{fn (mut this.hideError) true}} data-test-opt-in-error />
Copy link
Contributor

Choose a reason for hiding this comment

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

For the dismiss "x" on the upper right of the error banners, does this mean if I click one dismiss it will dismiss both banners?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it sure does. that's a great point. that's a bug with the <MessageErrors /> component implementation of using its @onDismiss args -- it applies the same callback to every alert rendered:

{{#each this.displayErrors as |error|}}
<Hds::Alert
data-test-message-error
@type="inline"
@color="critical"
@onDismiss={{@onDismiss}}

i'll file a bug report for this. great find!

Copy link
Contributor

@Monkeychip Monkeychip left a comment

Choose a reason for hiding this comment

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

Looks good to me. One question in the hbs file and then a reminder to run enterprise test locally yarn run test:filter -f=enterprise. You'll see on recent PRs that we're indicating these were run with a checkbox on the pr description. We only need to run them if the code touches enterprise features, which this does.
image

@andaley andaley enabled auto-merge (squash) May 24, 2024 00:06
@andaley andaley merged commit 3841f20 into main May 24, 2024
31 checks passed
@andaley andaley deleted the ui/vault-27413/update-activate-error branch May 24, 2024 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants