-
Notifications
You must be signed in to change notification settings - Fork 30
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: Remove disabled fields from showing on redeployment in server mode #839
Conversation
Visible = optionSettingHandler.IsOptionSettingDisplayable(recommendation, setting), | ||
Visible = | ||
optionSettingHandler.IsOptionSettingDisplayable(recommendation, setting) && | ||
!(recommendation.IsExistingCloudApplication && !setting.Updatable && !setting.VisibleOnRedeployment), |
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.
- can test coverage be applied to this new logic
- "visible on redeployment" sounds definitive, but this isn't the case. It appears that "Updatable" takes priority (which makes sense). How can future maintainers avoid assumptions when they set VisibleOn to true and expect their field to always appear?
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 added a server mode test to mimic the behavior in the toolkit. This change only applies to server mode.
The JSON schema for the recipe explains this. I did not want to make the setting name very long.
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 you also move this logic into IsOptionSettingDisplayable
? With a name like that I'd expect it to make the final determination, and wouldn't want some other caller of it to miss adding the new logic.
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.
Initially my changes were in IsOptionSettingDisplayable
but that impacts both the CLI, server mode, summary view and detailed view of option settings which is not what I want. So I moved it to server-mode specifically.
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.
Ah, that'd be good context to add as a comment, but not a deal breaker if you're not already revisiting this file again.
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.
Added a comment
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #839 +/- ##
===========================================
+ Coverage 32.41% 61.65% +29.24%
===========================================
Files 272 278 +6
Lines 10746 10811 +65
Branches 1482 1492 +10
===========================================
+ Hits 3483 6666 +3183
+ Misses 6974 3609 -3365
- Partials 289 536 +247 ☔ View full report in Codecov by Sentry. |
1e650ae
to
fdf67d3
Compare
Visible = optionSettingHandler.IsOptionSettingDisplayable(recommendation, setting), | ||
Visible = | ||
optionSettingHandler.IsOptionSettingDisplayable(recommendation, setting) && | ||
!(recommendation.IsExistingCloudApplication && !setting.Updatable && !setting.VisibleOnRedeployment), | ||
SummaryDisplayable = optionSettingHandler.IsSummaryDisplayable(recommendation, setting), |
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 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 opted to leave the summary view as is to give the customer an idea of all the settings they have already selected. However, not all of them are editable, so when they click Edit settings
they will only see the ones that are editable as well as the disabled ones that we want visible.
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.
The highlighted Create New
is specifically what was called out first in aws/aws-toolkit-visual-studio#429, so I still think it'd be great to get it out of the summary. The "Create New Roles" too.
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.
As discussed internally, the summary view will show all currently applied settings while the edit view will show the updatable settings plus the ones we decided should be visible. In order to remove the Create New
and similar options from the summary view, I need to add custom logic which I prefer to treat as a separate effort.
Visible = optionSettingHandler.IsOptionSettingDisplayable(recommendation, setting), | ||
Visible = | ||
optionSettingHandler.IsOptionSettingDisplayable(recommendation, setting) && | ||
!(recommendation.IsExistingCloudApplication && !setting.Updatable && !setting.VisibleOnRedeployment), |
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 you also move this logic into IsOptionSettingDisplayable
? With a name like that I'd expect it to make the final determination, and wouldn't want some other caller of it to miss adding the new logic.
@@ -100,6 +100,7 @@ | |||
"TypeHint": "AppRunnerService", | |||
"AdvancedSetting": false, | |||
"Updatable": false, | |||
"VisibleOnRedeployment": true, |
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.
Throughout, I'd probably be a little more conservative and leave anywhere we're displaying an ID/ARN/etc. visible if possible. In case a user is using this as a reference and then doing something else with the associated resources in the console or on another screen.
- AppRunner - KMS key
- Fargate - VPC Id, Load Balancer ARN
- Beanstalk - IAM role ARN, EC2 key pair
But not a deal breaker if anyone feels strongly, and this is something we can toggle as needed.
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.
Since the summary screen shows all the currently selected options, I wanted the edit screen to be mostly the updatable settings which is why I wasn't very generous with visibility of disabled settings. Curious what @normj and @96malhar think? and as you said, changing the visibility of the disabled settings is not a breaking change and we can update based on feedback.
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.
As a user, I'd prefer to always see the AWS resources associated with my application across all configuration views (including the edit screen) even if I cannot modify them.
To be explicit about the immutability of certain settings on a re-deployment, we should append a line to the OptionSetting description saying - "The configured value cannot be changed during a redeployment to an existing Cloud Application". This line should be appended wherever Updatable
is set to false
and VisibleOnRedeployment
is set to true
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 have made the resources that Alex mentioned visible. Also, I have experimented with adding a message to the description but it looked weird and repetetive in the toolkit. This message should be added by the Toolkit and should look different than the description so it could stand out.
@@ -100,6 +100,7 @@ | |||
"TypeHint": "AppRunnerService", | |||
"AdvancedSetting": false, | |||
"Updatable": false, | |||
"VisibleOnRedeployment": true, |
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.
As a user, I'd prefer to always see the AWS resources associated with my application across all configuration views (including the edit screen) even if I cannot modify them.
To be explicit about the immutability of certain settings on a re-deployment, we should append a line to the OptionSetting description saying - "The configured value cannot be changed during a redeployment to an existing Cloud Application". This line should be appended wherever Updatable
is set to false
and VisibleOnRedeployment
is set to true
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.
Good with this as an incremental improvement, but I still think we should try to get "Create" out of the summary pane before fully resolving aws/aws-toolkit-visual-studio#429
I will create a backlog item to remove the "Create" out of the summary pane. |
Issue #, if available:
DOTNET-6316
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.