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

Fix issue with trigger_benchmark being too strict with the permission check #6731

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

rashidnhm
Copy link
Contributor

Context:
This pull request updates the trigger_benchmarks workflow to allow users with write permissions to this repository to trigger benchmarks.

Previously, you needed at least maintain permissions, which a lot of pennylane development teams did not have.

Description of the Change:
The workflow after first verifying that the command issued was /benchmark, will hit /repos/OWNER/REPO/collaborators/USERNAME/permission endpoint for this repo.

Then, check if the user object returns has at least push permission:

"permissions": {
    "admin": false,
    "maintain": false,
    "push": false,
    "triage": true,
    "pull": true
}

If admin/maintain/push is true, the webhook will be triggered.

Benefits:
More people are able to trigger benchmarks.

Possible Drawbacks:
More people are able to trigger benchmarks.

... Ideally we want to have a custom role created, then assign that role to specific teams/users and you would need to have that role in order to trigger benchmark. However, custom roles are only offered on the GitHub Enterprise plan. If we do upgrade to that in the future, we can revisit this logic.

Related GitHub Issues:
None. sc-80243

Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.60%. Comparing base (24f491f) to head (4636f4c).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6731   +/-   ##
=======================================
  Coverage   99.60%   99.60%           
=======================================
  Files         478      478           
  Lines       45045    45045           
=======================================
  Hits        44868    44868           
  Misses        177      177           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rashidnhm rashidnhm enabled auto-merge (squash) December 19, 2024 14:55
@rashidnhm rashidnhm merged commit 3ff71de into master Dec 19, 2024
45 checks passed
@rashidnhm rashidnhm deleted the sc-80243-update-benchmark-trigger-check branch December 19, 2024 15:01
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.

3 participants