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

Gardening action: add new Flag OSS feature #19382

Merged
merged 11 commits into from
Apr 16, 2021
Merged

Conversation

jeherve
Copy link
Member

@jeherve jeherve commented Apr 1, 2021

Changes proposed in this Pull Request:

This PR brings an additional task to the Gardening action, based on an existing feature currently enabled for the Calypso repo:

This new action flags PRs opened by external contributors (not from a branch on the main repo), adds the "OSS Citizen" label, and posts a Slack message to your team channel to let everyone know you've got a contribution from an external contributor.

Note: I chose to look at how they worked on their PR (from a fork) instead o
f looking at the organization listed in their profile to decide whether they
would be considered as outside contributors.

Jetpack product discussion

  • N/A

Does this pull request change what data or activity we track or use?

  • No

Testing instructions:

  • Ensure the existing action features (auto-labeling, comment below this PR) still work for this PR.
  • Since this runs on pull_request_target, we will not be able to test much before this gets merged. Then once this is merged, I'll open a test PR from a fork to test things in the #jeherve-debug channel.

jeherve added 5 commits April 1, 2021 16:21
- I chose to only add a label for now. In the future we could opt to do more (add a welcome comment, ...)
- I chose to look at how they worked on their PR (from a fork) instead of looking at the organization listed in their profile to decide whether they would be considered as outside contributors.
This brings the feature in line with the existing tool we use today in the Calypso repo.
@jeherve jeherve added Actions GitHub actions used to automate some of the work around releases and repository management [Pri] Normal [Status] In Progress [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it labels Apr 1, 2021
@jeherve jeherve self-assigned this Apr 1, 2021
@github-actions github-actions bot added the [Action] Repo Gardening Github Action: manage PR and issues in your Open Source project label Apr 1, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Apr 1, 2021

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.

jeherve added 3 commits April 1, 2021 17:43
We have fork checks inside the action anyway.
That's not an option from forks. We could aim to open things up via pull_request_target.
Not doing that just yet though.
See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
@jeherve
Copy link
Member Author

jeherve commented Apr 1, 2021

I'll close this for now. The limitations of pull_request make this more difficult to achieve in a straight-forward manner. I'll revisit when I have a bit more time to spend on this. For more info:
https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Apr 12, 2021
Since those events will need to be triggered for folks using forks, we cannot rely on just pull_request.
@jeherve jeherve added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Apr 12, 2021
Copy link
Contributor

@kraftbj kraftbj left a comment

Choose a reason for hiding this comment

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

Let's try it. I'll leave it to you to merge @jeherve so you can test with a fork post-merge.

@kraftbj kraftbj added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Apr 15, 2021
@jeherve jeherve merged commit 55dd7d2 into master Apr 16, 2021
@jeherve jeherve deleted the add/gardening-oss-label branch April 16, 2021 07:16
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Apr 16, 2021
jeherve added a commit that referenced this pull request Apr 16, 2021
Follow-up from #19382.

We need to allow the action to run from forks for pull_request_target events, so we can add labels to PRs created by external contributors.
@jeherve
Copy link
Member Author

jeherve commented Apr 16, 2021

Tested this, and it turns out it will need a follow-up: #19554

jeherve added a commit that referenced this pull request Apr 16, 2021
Follow-up from #19382.

We need to allow the action to run from forks for pull_request_target events, so we can add labels to PRs created by external contributors.
jeherve added a commit to Automattic/vaultpress that referenced this pull request Apr 19, 2021
This allows adding a label and posting a Slack message every time someone opens a PR from a fork.

See Automattic/jetpack#19382

Internal reference: p3btAN-1nR-p2#comment-13830
jeherve added a commit to Automattic/wp-calypso that referenced this pull request Apr 19, 2021
This allows adding a label and posting a Slack message every time someone opens a PR from a fork.

See Automattic/jetpack#19382

Internal reference: p3btAN-1nR-p2#comment-13830
jeherve added a commit to Automattic/wp-desktop that referenced this pull request Apr 19, 2021
This allows adding a label and posting a Slack message every time someone opens a PR from a fork.

See Automattic/jetpack#19382

Internal reference: p3btAN-1nR-p2#comment-13830
jeherve added a commit to Automattic/wp-calypso that referenced this pull request Apr 20, 2021
This allows adding a label and posting a Slack message every time someone opens a PR from a fork.

See Automattic/jetpack#19382

Internal reference: p3btAN-1nR-p2#comment-13830
jeherve added a commit to Automattic/vaultpress that referenced this pull request Apr 20, 2021
This allows adding a label and posting a Slack message every time someone opens a PR from a fork.

See Automattic/jetpack#19382

Internal reference: p3btAN-1nR-p2#comment-13830
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Action] Repo Gardening Github Action: manage PR and issues in your Open Source project Actions GitHub actions used to automate some of the work around releases and repository management [Pri] Normal [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants