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

Maintainer approval check #11378

Merged

Conversation

peternied
Copy link
Member

@peternied peternied commented Nov 29, 2023

Description

Implements proposal from #10613 (comment)

Replace Codeowners to control accepting pull requests with a GitHub action check that reads from the list of maintainers any verifies they have approved the PR. Codeowners can still be used for mapping subject matter experts that want to be notified, but isn't a requirement for every maintainer to be listed on the top level.

By modifying the branch protection rules 'maintainer has approved' check, could be required (only bypassable by an Admin), which would offer effectively the same security as Codeowners.

This is a new approval check that effectively doubles as the existing CODEOWNERS checks on this repository - which will allow that code owners check to be removed in favor of this one.

This check pulls the list of maintainers from GitHub repository settings. This also codifies the number of approvals needed in the repository in the event we increase or alter these requirements.

UX when PRs are blocked:

image

Example workflow:

https://github.com/peternied/OpenSearch-1/actions/runs/7026869463/job/19120342204?pr=138

Rollout plan:

After this PR has been merged, and been broadly accepted, a repository admin will change the required checks to include this workflow - this prevents changes from being merged even if this check isn't passing. Then the code owners file can be updated so maintainers can direct the kinds of changes they would like to be notified about.

Related Issues

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor

❌ Gradle check result for ad5276a: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Nov 29, 2023

Compatibility status:

Checks if related components are compatible with change 58c7cab

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/sql.git]

Copy link
Contributor

❕ Gradle check result for 4183a4c: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.cluster.allocation.ClusterRerouteIT.testDelayWithALargeAmountOfShards

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Nov 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (50e3666) 71.37% compared to head (20e0f5a) 71.36%.
Report is 23 commits behind head on main.

❗ Current head 20e0f5a differs from pull request most recent head 58c7cab. Consider uploading reports for the commit 58c7cab to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11378      +/-   ##
============================================
- Coverage     71.37%   71.36%   -0.01%     
+ Complexity    59102    59071      -31     
============================================
  Files          4893     4893              
  Lines        277754   277755       +1     
  Branches      40356    40356              
============================================
- Hits         198242   198222      -20     
+ Misses        63066    63060       -6     
- Partials      16446    16473      +27     

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

Copy link
Contributor

github-actions bot commented Dec 7, 2023

❌ Gradle check result for 58c7cab: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Dec 7, 2023

❌ Gradle check result for 58c7cab: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@peternied
Copy link
Member Author

@peternied peternied merged commit 87b3011 into opensearch-project:main Dec 7, 2023
29 of 30 checks passed
@peternied peternied deleted the maintainer-approved-check branch December 7, 2023 20:48
@peternied peternied added the backport 2.x Backport to 2.x branch label Dec 7, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-11378-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 87b30118673db54611078b3a8aaede20082ff59a
# Push it to GitHub
git push --set-upstream origin backport/backport-11378-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-11378-to-2.x.

deshsidd pushed a commit to deshsidd/OpenSearch that referenced this pull request Dec 11, 2023
peternied added a commit to peternied/OpenSearch-1 that referenced this pull request Dec 11, 2023
peternied added a commit to peternied/OpenSearch-1 that referenced this pull request Dec 11, 2023
@peternied
Copy link
Member Author

@prudhvigodithi (CC @opensearch-project/admin)

Since the check is now available an running in 1.3, 2.x and main. Could you make the following change to the branch protection on OpenSearch?

  • Uncheck Require review from Code Owners

image

  • Check Require status checks to pass before merging
    • Do not check or uncheck Require branches to be up to date before merging
    • Add Minimum approval count to the list of Status checks that are required.

image

@prudhvigodithi
Copy link
Member

@peternied I have just updated the rule with the changes you mentioned.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 1.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-1.x 1.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-1.x
# Create a new branch
git switch --create backport/backport-11378-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 87b30118673db54611078b3a8aaede20082ff59a
# Push it to GitHub
git push --set-upstream origin backport/backport-11378-to-1.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-1.x

Then, create a pull request where the base branch is 1.x and the compare/head branch is backport/backport-11378-to-1.x.

peternied added a commit to peternied/OpenSearch-1 that referenced this pull request Dec 13, 2023
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
(cherry picked from commit 87b3011)
peternied added a commit that referenced this pull request Dec 13, 2023
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
(cherry picked from commit 87b3011)
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
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