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

Default not readonly & tolerate missing permissions when removing #1062

Merged
merged 2 commits into from
Apr 15, 2022

Conversation

bobcatfish
Copy link
Contributor

Changes

  1. Default to non-readonly roles for permission script 🔑

#926 added a --readonly flag
for adding readonly user permissions, however it added it with defualt
"true" which means that by default when running this script to add or
remove permissions, it will only modify the read only permissions and
will leave any write permissions as-is.

This means that when I went to update the governing board permissions -
i.e. adding permissions for new members and removing permissions from
old members, the script did very little and I couldn't figure out why.

This commit switches the default to the writer roles - defaulting to
reader is probably a safer default, however I think it's a confusing
change given how the script has been used so far. Can be convinced that
instead we should keep the default and add better documentation and
examples (but someone else will probably need to pick that up!)

  1. Tolerate errors when removing permissions 👌

When removing permissions, if the permission to be removed isn't
present, the script will stop. However, if the permission isn't there,
imo that is okay and if the permissions list changes at all, this error
could get it - imo it's better to keep running the script and just
report any errors that couldn't be removed.

I ran into this especially when I ran the remove script but only for
readonly mode - from that point on I could no longer run the script for
the broader permissions b/c it would encounter an error immediately
since the viewer role had already been removed.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

tektoncd#926 added a `--readonly` flag
for adding readonly user permissions, however it added it with defualt
"true" which means that by default when running this script to add or
remove permissions, it will only modify the read only permissions and
will leave any write permissions as-is.

This means that when I went to update the governing board permissions -
i.e. adding permissions for new members and removing permissions from
old members, the script did very little and I couldn't figure out why.

This commit switches the default to the writer roles - defaulting to
reader is probably a safer default, however I think it's a confusing
change given how the script has been used so far. Can be convinced that
instead we should keep the default and add better documentation and
examples (but someone else will probably need to pick that up!)
When removing permissions, if the permission to be removed isn't
present, the script will stop. However, if the permission isn't there,
imo that is okay and if the permissions list changes at all, this error
could get it - imo it's better to keep running the script and just
report any errors that couldn't be removed.

I ran into this especially when I ran the remove script but only for
readonly mode - from that point on I could no longer run the script for
the broader permissions b/c it would encounter an error immediately
since the viewer role had already been removed.
@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 11, 2022
bobcatfish added a commit to bobcatfish/community that referenced this pull request Apr 11, 2022
1. Finishing up updates from governing board election (andrew bayer
   no longer on the board, priya wadhwa joining the board)
2. jerop@ will be taking my place on the governing board while I am
   on leave (see [leave policy](https://github.com/tektoncd/community/blob/main/governance.md#governing-board-leave-policy))
   (thanks jerop@ !!)

Went through the list at https://github.com/tektoncd/community/blob/main/governance.md#changes-to-governing-board
to make sure jerop and priya have all the governing board permissions
and to make the changes required with andrew leaving the board.

While running the permissions adding script I ran into a couple of
difficulties which I've tried to fix in:
* tektoncd/plumbing#1062
* tektoncd/plumbing#1061
bobcatfish added a commit to bobcatfish/community that referenced this pull request Apr 11, 2022
1. Finishing up updates from governing board election (andrew bayer
   no longer on the board, priya wadhwa joining the board)
2. jerop@ will be taking my place on the governing board while I am
   on leave (see [leave policy](https://github.com/tektoncd/community/blob/main/governance.md#governing-board-leave-policy))
   (thanks jerop@ !!)

Went through the list at https://github.com/tektoncd/community/blob/main/governance.md#changes-to-governing-board
to make sure jerop and priya have all the governing board permissions
and to make the changes required with andrew leaving the board.

Also added Priti to the governing board + community meeting faciltator
rotation because she is listed in the rotation in the doc.

While running the permissions adding script I ran into a couple of
difficulties which I've tried to fix in:
* tektoncd/plumbing#1062
* tektoncd/plumbing#1061
bobcatfish added a commit to bobcatfish/community that referenced this pull request Apr 11, 2022
1. Finishing up updates from governing board election (andrew bayer
   no longer on the board, priya wadhwa joining the board)
2. @jerop will be taking my place on the governing board while I am
   on leave (see [leave policy](https://github.com/tektoncd/community/blob/main/governance.md#governing-board-leave-policy))
   (thanks @jerop !!)

Went through the list at https://github.com/tektoncd/community/blob/main/governance.md#changes-to-governing-board
to make sure jerop and priya have all the governing board permissions
and to make the changes required with andrew leaving the board.

Also added Priti to the governing board + community meeting faciltator
rotation because she is listed in the rotation in the doc.

While running the permissions adding script I ran into a couple of
difficulties which I've tried to fix in:
* tektoncd/plumbing#1062
* tektoncd/plumbing#1061
bobcatfish added a commit to bobcatfish/community that referenced this pull request Apr 11, 2022
1. Finishing up updates from governing board election (andrew bayer
   no longer on the board, priya wadhwa joining the board)
2. @jerop will be taking my place on the governing board while I am
   on leave (see [leave policy](https://github.com/tektoncd/community/blob/main/governance.md#governing-board-leave-policy))
   (thanks @jerop !!)

Went through the list at https://github.com/tektoncd/community/blob/main/governance.md#changes-to-governing-board
to make sure jerop and priya have all the governing board permissions
and to make the changes required with andrew leaving the board.

Also added Priti to the governing board + community meeting faciltator
rotation because she is listed in the rotation in the doc.

While running the permissions adding script I ran into a couple of
difficulties which I've tried to fix in:
* tektoncd/plumbing#1062
* tektoncd/plumbing#1061
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/kind misc

@tekton-robot tekton-robot added the kind/misc Categorizes issue or PR as a miscellaneuous one. label Apr 12, 2022
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 12, 2022
tekton-robot pushed a commit to tektoncd/community that referenced this pull request Apr 12, 2022
1. Finishing up updates from governing board election (andrew bayer
   no longer on the board, priya wadhwa joining the board)
2. @jerop will be taking my place on the governing board while I am
   on leave (see [leave policy](https://github.com/tektoncd/community/blob/main/governance.md#governing-board-leave-policy))
   (thanks @jerop !!)

Went through the list at https://github.com/tektoncd/community/blob/main/governance.md#changes-to-governing-board
to make sure jerop and priya have all the governing board permissions
and to make the changes required with andrew leaving the board.

Also added Priti to the governing board + community meeting faciltator
rotation because she is listed in the rotation in the doc.

While running the permissions adding script I ran into a couple of
difficulties which I've tried to fix in:
* tektoncd/plumbing#1062
* tektoncd/plumbing#1061
@dibyom
Copy link
Member

dibyom commented Apr 15, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 15, 2022
@tekton-robot tekton-robot merged commit 5489134 into tektoncd:main Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants