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

Automatically approve, merge, and score PRs containing only changes to plugins #108

Merged
merged 134 commits into from
Apr 3, 2023

Conversation

kvfairchild
Copy link
Contributor

@kvfairchild kvfairchild commented Nov 9, 2022

Adds two GitHub Actions workflows and supporting infrastructure to

  1. Approve and merge any PRs that adhere to these requirements (automerge_plugin-only_prs.yml):
  • Are labeled with automerge or automerge-web (all submissions originating from brain-score.org are tagged with automerge-web)
  • Don't contain any changes outside of child directories of plugin directories (/benchmarks, /models, /metrics, /data)
  • All tests are passing

This workflow is triggered on a PR by the completion of CI checks OR by the addition of a label. It first runs an action to confirm that the PR is labeled with either automerge or automerge-web; if so, it then checks Travis status and sets the travisok flag to one of True (Travis completed successfully), Wait (Travis has not finished running), or Fail (Travis completed with errors).

If travisok is

  • Wait: The workflow exits and will be triggered again on CI check completion. (Rather than only triggering the workflow on check completion, this status accommodates the case where a user has waited for CI checks to complete before adding the automerge label).
  • True: An action is run to identify all files changed by the PR. If no files have been touched outside of child directories of plugin directories (/benchmarks, /models, /metrics, /data), the PR is automatically approved and merged to main.
  • False: If the PR is tagged with automerge-web, the user ID associated with the Brain-Score account of the submitter is parsed from the PR title and passed to an action that 1) returns the email address associated with that account and 2) sends an email to that address that includes a link to the PR and requests that the test failures be addressed.
  1. Score any PRs merged to main that include changes to a benchmark or model directory (score_new_plugins.yml).

This workflow is triggered on any merge to main. It first runs an action to identify all files changed by the PR, parses those files with a Python script (parse_changed_files.py) to extract any benchmark and model directories included in those changes, and passes the file names of those directories to Jenkins for scoring along with:

  • author_email: the email address associated with the GitHub account of the PR author.
  • user_id: if the PR is submitted via brain-score.org, the user ID associated with the Brain-Score account of the submitter is included in, and extracted from, the PR title.
  • domain: the domain associated with the submitted plugins; this field is language by default for all submissions to this repository.
  • public: whether the plugin is public or private; currently this field is True for all submissions by default, but this accommodates plans to support private plugins in the future.
  • competition: currently None by default, but in the future this will allow PRs to be tagged with the name of a competition and filed accordingly.
  • model_type: artificialsubject by default for all submissions to this repository.

@kvfairchild kvfairchild changed the title Automatically merge, score Automatically approve, merge, and score PRs containing only changes to plugins Nov 9, 2022
@kvfairchild kvfairchild added the automerge PR will be automatically approved and merged if it includes only changes to plugins label Nov 9, 2022
@kvfairchild kvfairchild changed the base branch from main to submissions December 9, 2022 16:19
@kvfairchild kvfairchild changed the base branch from submissions to main December 9, 2022 16:20
@kvfairchild kvfairchild merged commit 1dab959 into main Apr 3, 2023
kvfairchild added a commit that referenced this pull request Apr 29, 2023
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.

2 participants