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

Permissions testing, better handling of "everyone" privileges #1067

Merged
merged 18 commits into from
Jul 14, 2022
Merged

Permissions testing, better handling of "everyone" privileges #1067

merged 18 commits into from
Jul 14, 2022

Conversation

andrewpcone
Copy link
Contributor

This pull request addresses #702

@andrewpcone andrewpcone marked this pull request as ready for review June 15, 2022 17:00
kannon92
kannon92 previously approved these changes Jun 21, 2022
Copy link
Contributor

@kannon92 kannon92 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. I would like a person who is more familar with Armada permissions to look this over though.

@robertdavidsmith
Copy link
Collaborator

Hi,

Thanks a lot for the PR.

Please can you update the title and description to fully cover what the PR does, as it's a bit more than just adding tests.

e.g. there are some very welcome improvements to error messages, and also some special casing of group "everyone" that wasn't there before.

Thanks,

Rob

@robertdavidsmith
Copy link
Collaborator

Please can you add unit tests for the removal of "everyone", including the case where "everyone" is not present (which looks like it will fail currently).

I agree adding the groups to queue perms is a bit funny, I believe GR has an internal use case that needs this. Someone such as @JamesMurkin may know more. I would love to remove auto queue creation eventually.

Thanks,

Rob

@JamesMurkin
Copy link
Contributor

Hi,

I think we all agree that we want to drop auto queue creation, sadly we have an internal use case that relies on it. We'll have to migrate them off before we can remove it.

I will initiate this internally however I can't give a timeline quite yet, so we'll have to keep it.

code = e.Code()
}

return nil, status.Errorf(code, "[SubmitJobs] couldn't get/make queue: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we have moved away from adding the function name into the error messages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood. Should we remove the [FuncName] in the other error strings?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please do if you have time, however I just would ideally try to avoid adding more.

return nil, err
code := codes.Unknown
if e, ok := status.FromError(err); ok {
code = e.Code()
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe one for a separate PR but we now have something that magically sets the return code base on error type:
https://github.com/G-Research/armada/blob/master/internal/common/armadaerrors/errors.go#L251

I think the plan was to move to using the appropriate error types rather than setting codes explicitly


groupNames := principal.GetGroupNames()
everyone_index := slices.Index(groupNames, "everyone")
groupNames = append(groupNames[:everyone_index], groupNames[everyone_index+1:]...)
Copy link
Contributor

Choose a reason for hiding this comment

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

Several nit picks here:

@andrewpcone andrewpcone changed the title Permissions testing Permissions testing, better handling of "everyone" privileges Jun 22, 2022
@andrewpcone
Copy link
Contributor Author

@dejanzele OK to merge?

@kannon92 kannon92 enabled auto-merge (squash) July 14, 2022 13:15
@kannon92 kannon92 merged commit c08164f into armadaproject:master Jul 14, 2022
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.

None yet

4 participants