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

Adjust Security Group type hints to show the group name and id #819

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task<TypeHintResourceTable> GetResources(Recommendation recommendat

foreach (var securityGroup in securityGroups.OrderBy(securityGroup => securityGroup.VpcId))
{
var row = new TypeHintResource(securityGroup.GroupId, securityGroup.GroupId);
var row = new TypeHintResource(securityGroup.GroupId, $"{securityGroup.GroupName} ({securityGroup.GroupId})");
row.ColumnValues.Add(securityGroup.GroupName);
row.ColumnValues.Add(securityGroup.GroupId);
row.ColumnValues.Add(securityGroup.VpcId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,16 @@ public async Task GetResources()
{
new SecurityGroup()
{
GroupId = "group1"
GroupId = "group1-id",
GroupName = "group1-name"
}
});

var resources = await command.GetResources(appRunnerRecommendation, securityGroupsOptionSetting);

Assert.Single(resources.Rows);
Assert.Equal("group1", resources.Rows[0].DisplayName);
Assert.Equal("group1", resources.Rows[0].SystemName);
Assert.Equal("group1-name (group1-id)", resources.Rows[0].DisplayName);
Assert.Equal("group1-id", resources.Rows[0].SystemName);
}

[Fact]
Expand Down
Loading