Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Require multiple editor approvals to merge unknown files #105

Merged
merged 13 commits into from
Aug 10, 2022
Merged

Require multiple editor approvals to merge unknown files #105

merged 13 commits into from
Aug 10, 2022

Conversation

Pandapip1
Copy link
Member

@Pandapip1 Pandapip1 commented Jul 29, 2022

Fixes #46, Fixes #79

@Pandapip1
Copy link
Member Author

3 test cases had to be deleted due to them being out-of-date.

@Pandapip1
Copy link
Member Author

@MicahZoltu @axic ready for review.

@MicahZoltu
Copy link
Contributor

This does not appear to fix #53 so I removed that from the OP (so it doesn't get auto-closed). Also, I would like to better understand why we are removing some of these tests. We also should test this on a fork to make sure it behaves as expected, and possibly add one or more new test cases to cover its behavior.

@Pandapip1
Copy link
Member Author

Also, I would like to better understand why we are removing some of these tests.

They all dealt with approving unknown files with one editor's approval (specifically, the Gemfile).

Possibly add one or more new test cases to cover its behavior

I've already done that :) (https://github.com/ethereum/EIP-Bot/pull/105/files#diff-b6ddeb8623cdd627ccf86b7b69fb769923e00d0a27fb35869b71492a6027815a)

@Pandapip1
Copy link
Member Author

I can confirm that it does not merge with a single editor approval, as f2e6aa2 didn't pass.

@Pandapip1
Copy link
Member Author

I've now added test cases describing every possible condition. If this passes, it is ready to merge.

@MicahZoltu
Copy link
Contributor

MicahZoltu commented Aug 2, 2022

Since we don't have any active maintainers working on the bot at the moment (we are all EIP bot newbs), I would like to see this manually E2E tested before we merge, just to make sure we are generally doing things right.

I believe @JEAlfonsoP is working on doing E2E tests on their fork, perhaps they could test this change (probably easier than testing the many-files change)? @JEAlfonsoP to this this, update your EIP fork's workflow to point at the latest commit of this branch and then create a PR that touches a non-EIP file and the bot should:
A. post a comment saying that it needs 2 editors to approve.
B. it should have a red X in the checks section of the PR on initial PR submission
C. after one editor approves it should have a red X in the checks section of the PR
D. after two editors approve it should have a green check in the checks section of the PR
E. Bonus: If the author is an editor, it should only require a single other editor approval

@Pandapip1
Copy link
Member Author

Pandapip1 commented Aug 2, 2022

B implies C unless branch protection is set up incorrectly. Also, I have added E2E tests!

@JEAlfonsoP
Copy link
Contributor

I can do that.

@JEAlfonsoP
Copy link
Contributor

Workflow is setup to run with this commit.
I ran several tests and bot responded but I think I do not have a proper test case. Do you have a test case ?

@Pandapip1
Copy link
Member Author

I have indeed added E2E tests for all cases (1 author approval, 1 editor approval, and 2 editor approvals) and it passes all of them.

@Pandapip1 Pandapip1 closed this Aug 3, 2022
@Pandapip1 Pandapip1 reopened this Aug 3, 2022
@Pandapip1
Copy link
Member Author

Didn't mean to close, oops.

@MicahZoltu
Copy link
Contributor

I wouldn't consider the automated tests we have to be E2E. They are either unit tests or functional tests (people disagree on what this class of tests is called). E2E usually means you are testing the entire system end to end, which includes real versions of every piece of software being interacted with. I don't think there is a way to automate this with GitHub, which is why I was hoping that @JEAlfonsoP could do the end to end test manually.

@MicahZoltu
Copy link
Contributor

I ran several tests and bot responded but I think I do not have a proper test case. Do you have a test case ?

Do you have a link to where you ran these tests (the GH action runs)? The test to do is the one I described above, did it pass all of the various lettered items in that list?

@Pandapip1
Copy link
Member Author

I will be more than willing to do these tests once #109 is merged since I have a working test environment.

@@ -108,7 +108,7 @@ export class RequireFilenameEIPNum implements IRequireFilenameEIPNum {
const approvals = await this.getApprovals();

const isEditorApproved =
_.intersection(editorApprovals, approvals).length !== 0;
_.intersection(editorApprovals, approvals).length >= 2;
Copy link
Member Author

Choose a reason for hiding this comment

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

FYI @MicahZoltu - this is the only functional change made. All the rest is fixing the test cases.

@Pandapip1 Pandapip1 requested a review from SamWilsn August 10, 2022 16:09
@Pandapip1 Pandapip1 added bug Something isn't working priority: high labels Aug 10, 2022
@Pandapip1 Pandapip1 changed the title Require two editor approvals to merge unknown files Require multiple editor approvals to merge unknown files Aug 10, 2022
@Pandapip1 Pandapip1 requested a review from alita-moore August 10, 2022 18:08
@Pandapip1
Copy link
Member Author

This is going to get tested manually anyways. Merging.

@Pandapip1 Pandapip1 merged commit ede806e into ethereum:master Aug 10, 2022
@Pandapip1 Pandapip1 deleted the require-2-approvals branch August 10, 2022 18:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working priority: high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating workflow files should use stricter rules Editors as authors approves unknown file
3 participants