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 Bug in Role Helper #142

Merged
merged 5 commits into from
Aug 23, 2024
Merged

Fix Bug in Role Helper #142

merged 5 commits into from
Aug 23, 2024

Conversation

ichung08
Copy link
Collaborator

Description

Fixes bug in ValidateWorkspaceDeploymentRoles where users weren't able to assign multiple deployment roles under the same workspace

🎟 Issue(s)

🧪 Functional Testing

📸 Screenshots

📋 Checklist

  • Added/updated applicable tests
  • Added/updated examples in the examples/ directory
  • Updated any related documentation

@ichung08 ichung08 self-assigned this Aug 23, 2024
@ichung08 ichung08 marked this pull request as ready for review August 23, 2024 20:09
@ichung08 ichung08 requested review from vandyliu, sunkickr and a team as code owners August 23, 2024 20:09

// get list of workspaceIds
workspaceIds := lo.Map(input.WorkspaceRoles, func(role iam.WorkspaceRole, _ int) string {
return role.WorkspaceId
})

// check if deploymentWorkspaceIds are in workspaceIds
workspaceIds = lo.Intersect(lo.Uniq(workspaceIds), lo.Uniq(deploymentWorkspaceIds))
workspaceIds = lo.Intersect(lo.Uniq(workspaceIds), deploymentWorkspaceIds)
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we have a test case where before this change it would fail and after it would pass

},
{
Role: "DEPLOYMENT_ADMIN",
EntityId: "cm070pg0r00wd01qgnskk0dir",
Copy link
Collaborator

Choose a reason for hiding this comment

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

where did this deploymentId come from?
should we create a deployment for this test and use that one instead?

@ichung08 ichung08 merged commit 3214d91 into main Aug 23, 2024
9 checks passed
@ichung08 ichung08 deleted the 133-fix-bug-in-role-helper branch August 23, 2024 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants