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

Teams initial support #146

Merged

Conversation

triedandtested-dev
Copy link
Contributor

@triedandtested-dev triedandtested-dev commented Mar 6, 2024

Resolves #144

  • workspace_access - support for team.
  • teams data source
  • team data source

@triedandtested-dev triedandtested-dev requested review from gabcoyne and a team as code owners March 6, 2024 00:20
@triedandtested-dev triedandtested-dev force-pushed the feature/teams-access-support branch from dc8b1cf to e2dc919 Compare March 11, 2024 22:51
@triedandtested-dev
Copy link
Contributor Author

@gabcoyne I removed the unsupported checker from the linter should be good now

@mch-sb
Copy link

mch-sb commented Mar 12, 2024

Nice!👌 This would help out us quite a bit also!

@triedandtested-dev triedandtested-dev changed the title Team access support Teams initial support Mar 12, 2024
@@ -155,7 +155,6 @@ linters-settings:
- sliceClear
- sloppyLen
- sloppyReassign
- sloppyTestFuncName
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

# Assign the Workspace Role to the Team
resource "prefect_workspace_access" "team_developer" {
accessor_type = "TEAM"
accessor_id = "11111111-1111-1111-1111-111111111111"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
accessor_id = "11111111-1111-1111-1111-111111111111"
accessor_id = prefect_account_member.marvin.user_id

just to reinforce that accessor_id is either a service account ID or an account member ID (eg a user). "accessor" is kind of an abstract term we chose here to unify the bot/user domains, so it might not be immediately clear to the TF user

// TeamFilter defines the search filter payload
// when searching for team by name.
// example request payload:
// {"teams": {"name": {"any_": ["test"]}}}.
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@@ -87,9 +87,9 @@ func (r *WorkspaceAccessResource) Schema(_ context.Context, _ resource.SchemaReq
},
"accessor_type": schema.StringAttribute{
Required: true,
Description: "USER or SERVICE_ACCOUNT",
Description: "USER | SERVICE_ACCOUNT | TEAM",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@parkedwards parkedwards left a comment

Choose a reason for hiding this comment

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

amazing work! I left a non-blocking suggestion for the docs section, but this looks great. thank you for doing this!

@parkedwards
Copy link
Contributor

taking a look at the failing CI steps

@parkedwards
Copy link
Contributor

ok this has to do with how we set up our workflow triggers - GHA won't insert Secrets from a forked workflow for obvious reasons.

I'm going to merge this in, but also sanitize our main branch in case there are failures. thanks for the contribution @triedandtested-dev

@parkedwards parkedwards merged commit 6148417 into PrefectHQ:main Mar 20, 2024
3 of 7 checks passed
@triedandtested-dev triedandtested-dev deleted the feature/teams-access-support branch March 20, 2024 22:57
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.

Granting teams access to workspaces
3 participants