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

RFC: Untrusted pull request roles based on author's association #175

Merged
merged 3 commits into from
Aug 15, 2022

Conversation

ahal
Copy link
Contributor

@ahal ahal commented Jun 13, 2022

Rendered

Issue: #173

@ahal ahal force-pushed the github_author_association branch from 6405241 to 1bcefd5 Compare June 13, 2022 18:29
JohanLorenzo
JohanLorenzo previously approved these changes Jun 14, 2022
Copy link

@JohanLorenzo JohanLorenzo left a comment

Choose a reason for hiding this comment

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

I like this proposal very much! I know the mobile teams would be pleased to let untrusted contributors run a subset of the jobs anyway.

The tiny nit I'd like to talk about is the name mixed. If someone new to TC reads a .taskcluster.yml file, they have no way to guess what this policy does without reading the docs. How about something like public_restricted or non_collarborators_restricted?

@ahal
Copy link
Contributor Author

ahal commented Jun 14, 2022

I like this proposal very much! I know the mobile teams would be pleased to let untrusted contributors run a subset of the jobs anyway.

The tiny nit I'd like to talk about is the name mixed. If someone new to TC reads a .taskcluster.yml file, they have no way to guess what this policy does without reading the docs. How about something like public_restricted or non_collarborators_restricted?

Good call, I like public_restricted. More bikeshedding here welcome if anyone has other ideas.

@ahal ahal force-pushed the github_author_association branch from 1bcefd5 to ea9c4ea Compare June 14, 2022 14:10
be assumed. So far this behavior is identical to the `collaborators` policy.

However if the author is not a collaborator, a new role called `repo:github.com/${
payload.organization }/${ payload.repository }:pull-request-untrusted` will be assumed instead.
Copy link
Contributor Author

@ahal ahal Jun 14, 2022

Choose a reason for hiding this comment

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

I'm also unsure about the name pull-request-untrusted and would like to invite some bikeshedding here too. Other options: pull-request-public, pull-request-restricted, ??

I think I like "untrusted" because it's a good reminder to ci-config maintainers about which scopes should be granted to it. On the other hand, maybe "untrusted" will be confusing due to us using that term in CoT + levels already.

Copy link
Contributor

Choose a reason for hiding this comment

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

At first I thought that it would be good to align pull request policy name public_RESTRICTED and the role ...:pull-request-UNTRUSTED, but I agree that for someone managing those roles, it would be easier to understand that those scopes should be checked carefully.
I guess we can leave it as is 👍

@matt-boris matt-boris requested review from a team, lotas, petemoore and matt-boris and removed request for a team July 18, 2022 21:02
lotas
lotas previously approved these changes Jul 20, 2022
@ahal
Copy link
Contributor Author

ahal commented Jul 22, 2022

Here's an example implementation of this RFC: taskcluster/taskcluster#5569

(Got a little ahead of myself, but happy to change it if things come up here).

matt-boris
matt-boris previously approved these changes Jul 22, 2022
To allow projects to tell whether a pull request was created by a collaborator or not, a new
`is_collaborator` field will be included in the JSON-e context used to evaluate the
`.taskcluster.yml` file. This field will be present when `tasks_for` is `github-pull-request`
(regardless of `pullRequest` policy), otherwise it will be undefined.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I think I'd like to re-work this part bit. While going through the implementation I realized this is adding some unnecessary complexity and ambiguity.

Rather than an is_collaborator context value which only has meaning in some contexts, I'd like to make a new tasks_for value of github-pull-request-untrusted. I think this will result in both a cleaner implementation, as well as cleaner code in consumer's taskgraph transforms.

@ahal ahal dismissed stale reviews from matt-boris, lotas, and JohanLorenzo via f92ab31 July 28, 2022 20:12
lotas
lotas previously approved these changes Aug 9, 2022
petemoore
petemoore previously approved these changes Aug 10, 2022
Copy link
Member

@petemoore petemoore left a comment

Choose a reason for hiding this comment

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

Looks fine to me, thanks Andrew!

@petemoore
Copy link
Member

This will be landed on Friday this week during the Taskcluster Community meeting, unless there are any matters which come up that block it. Therefore please submit any final comments or raise objections before then.

Also makes the title a bit more clear.
@ahal ahal dismissed stale reviews from petemoore and lotas via cc49f17 August 12, 2022 15:50
@ahal ahal requested a review from a team as a code owner August 12, 2022 15:50
@ahal
Copy link
Contributor Author

ahal commented Aug 12, 2022

Latest push doesn't change the content, I had just put the wrong RFC number in it (didn't realize it was supposed to match the PR, nor that there was a script to generate it).

@ahal
Copy link
Contributor Author

ahal commented Aug 12, 2022

I think it might good if new pushes didn't invalidate the reviews here :). The author can probably use their best judgement if a new change warrants a new review and re-request explicitly if it does.

@matt-boris matt-boris merged commit 89e9c1c into taskcluster:main Aug 15, 2022
@ahal ahal deleted the github_author_association branch August 15, 2022 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants