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

feat_: implement PR review workflow #5877

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

siddarthkay
Copy link
Contributor

@siddarthkay siddarthkay commented Sep 25, 2024

Summary

This PR Implements a PR review workflow like this :

  • This action will check if breaking change label exists on PR.
  • if it does then @status-im/desktop-qa and @status-im/mobile-qa are asked for review on this PR.
  • Unless 1 person from @status-im/desktop-qa and @status-im/mobile-qa approve that PR the Github action will block the PR.
  • Only after these conditions match the Github action will allow merging of this PR.

@siddarthkay siddarthkay self-assigned this Sep 25, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Sep 25, 2024

Jenkins Builds

Click to see older builds (134)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ bfe0b66 #1 2024-09-25 10:53:55 ~1 min tests-rpc 📄log
✔️ bfe0b66 #1 2024-09-25 10:56:08 ~3 min linux 📦zip
✔️ bfe0b66 #1 2024-09-25 10:56:51 ~4 min ios 📦zip
✔️ bfe0b66 #1 2024-09-25 10:57:13 ~5 min android 📦aar
✔️ bfe0b66 #1 2024-09-25 11:25:05 ~32 min tests 📄log
✔️ 8a90758 #2 2024-09-25 10:57:23 ~1 min tests-rpc 📄log
✔️ 8a90758 #2 2024-09-25 10:58:54 ~1 min android 📦aar
✔️ 8a90758 #2 2024-09-25 10:59:54 ~2 min ios 📦zip
✔️ 8a90758 #2 2024-09-25 11:00:35 ~4 min linux 📦zip
✔️ da41420 #3 2024-09-25 11:00:09 ~1 min tests-rpc 📄log
✔️ da41420 #3 2024-09-25 11:00:48 ~1 min android 📦aar
✔️ da41420 #3 2024-09-25 11:02:48 ~1 min linux 📦zip
✔️ da41420 #3 2024-09-25 11:02:57 ~2 min ios 📦zip
✔️ 54ff2e6 #4 2024-09-25 11:08:00 ~1 min android 📦aar
✔️ 54ff2e6 #4 2024-09-25 11:08:22 ~1 min tests-rpc 📄log
✔️ 54ff2e6 #4 2024-09-25 11:08:33 ~1 min linux 📦zip
✔️ 54ff2e6 #4 2024-09-25 11:09:22 ~2 min ios 📦zip
✔️ 54ff2e6 #2 2024-09-25 11:57:42 ~32 min tests 📄log
✔️ 49a9364 #5 2024-09-25 12:38:22 ~1 min android 📦aar
✔️ 49a9364 #5 2024-09-25 12:38:33 ~1 min tests-rpc 📄log
✔️ 49a9364 #5 2024-09-25 12:38:52 ~2 min linux 📦zip
✔️ 49a9364 #5 2024-09-25 12:41:56 ~5 min ios 📦zip
✔️ 49a9364 #3 2024-09-25 13:09:28 ~32 min tests 📄log
✔️ 0b606e4 #6 2024-09-25 13:47:51 ~1 min tests-rpc 📄log
✔️ 0b606e4 #6 2024-09-25 13:47:52 ~1 min android 📦aar
✔️ 0b606e4 #6 2024-09-25 13:48:17 ~2 min linux 📦zip
✔️ 0b606e4 #6 2024-09-25 13:49:12 ~3 min ios 📦zip
✔️ 0b606e4 #4 2024-09-25 14:16:11 ~29 min tests 📄log
✔️ 6b552c1 #7 2024-09-25 15:56:19 ~1 min android 📦aar
✔️ 6b552c1 #7 2024-09-25 15:56:28 ~1 min tests-rpc 📄log
✔️ 6b552c1 #7 2024-09-25 15:56:58 ~2 min linux 📦zip
✔️ 6b552c1 #7 2024-09-25 15:58:00 ~3 min ios 📦zip
✔️ 6b552c1 #5 2024-09-25 16:27:33 ~32 min tests 📄log
✔️ 1fb7f36 #8 2024-09-29 16:24:03 ~1 min android 📦aar
✔️ 1fb7f36 #8 2024-09-29 16:24:19 ~1 min tests-rpc 📄log
✔️ 1fb7f36 #8 2024-09-29 16:24:33 ~2 min linux 📦zip
✔️ 1fb7f36 #8 2024-09-29 16:25:40 ~3 min ios 📦zip
✔️ 1fb7f36 #6 2024-09-29 16:54:17 ~31 min tests 📄log
✔️ 03dc775 #9 2024-09-29 16:26:58 ~2 min android 📦aar
✔️ 03dc775 #9 2024-09-29 16:27:15 ~2 min tests-rpc 📄log
✔️ 03dc775 #9 2024-09-29 16:27:26 ~2 min linux 📦zip
✔️ 03dc775 #9 2024-09-29 16:29:05 ~3 min ios 📦zip
✔️ a3ef631 #10 2024-09-29 16:33:07 ~1 min android 📦aar
✔️ a3ef631 #10 2024-09-29 16:33:18 ~1 min tests-rpc 📄log
✔️ a3ef631 #10 2024-09-29 16:33:38 ~1 min linux 📦zip
✔️ a3ef631 #10 2024-09-29 16:34:24 ~2 min ios 📦zip
✔️ a3ef631 #7 2024-09-29 17:26:16 ~31 min tests 📄log
✔️ 3af26d0 #11 2024-09-30 02:45:47 ~1 min android 📦aar
✔️ 3af26d0 #11 2024-09-30 02:45:57 ~1 min tests-rpc 📄log
✔️ 3af26d0 #11 2024-09-30 02:46:24 ~1 min linux 📦zip
✔️ 3af26d0 #11 2024-09-30 02:47:28 ~3 min ios 📦zip
✖️ 3af26d0 #8 2024-09-30 03:02:06 ~17 min tests 📄log
✔️ f551c6f #12 2024-09-30 03:00:28 ~1 min android 📦aar
✔️ f551c6f #12 2024-09-30 03:00:30 ~1 min tests-rpc 📄log
✔️ f551c6f #12 2024-09-30 03:01:00 ~1 min linux 📦zip
✔️ f551c6f #12 2024-09-30 03:01:56 ~2 min ios 📦zip
✔️ 0daf1a4 #13 2024-09-30 03:02:42 ~1 min android 📦aar
✔️ 0daf1a4 #13 2024-09-30 03:02:48 ~1 min tests-rpc 📄log
✔️ 0daf1a4 #13 2024-09-30 03:03:26 ~2 min linux 📦zip
✔️ 0daf1a4 #13 2024-09-30 03:05:04 ~2 min ios 📦zip
✔️ 0daf1a4 #9 2024-09-30 03:34:09 ~31 min tests 📄log
✖️ 09d1d76 #10 2024-09-30 06:23:38 ~1 min tests 📄log
✔️ 09d1d76 #14 2024-09-30 06:23:59 ~1 min android 📦aar
✔️ 09d1d76 #14 2024-09-30 06:23:59 ~1 min tests-rpc 📄log
✔️ 09d1d76 #14 2024-09-30 06:24:24 ~1 min linux 📦zip
✔️ 09d1d76 #14 2024-09-30 06:25:22 ~2 min ios 📦zip
✖️ 3e1e6ce #11 2024-09-30 06:25:12 ~56 sec tests 📄log
✔️ 3e1e6ce #15 2024-09-30 06:25:47 ~1 min tests-rpc 📄log
✔️ 3e1e6ce #15 2024-09-30 06:25:56 ~1 min android 📦aar
✔️ 3e1e6ce #15 2024-09-30 06:26:32 ~1 min linux 📦zip
✔️ 3e1e6ce #15 2024-09-30 06:28:23 ~2 min ios 📦zip
✔️ 3dcc754 #16 2024-09-30 06:54:18 ~1 min android 📦aar
✔️ 3dcc754 #16 2024-09-30 06:54:21 ~1 min tests-rpc 📄log
✔️ 3dcc754 #16 2024-09-30 06:54:51 ~1 min linux 📦zip
✔️ 3dcc754 #16 2024-09-30 06:55:49 ~3 min ios 📦zip
✔️ 3dcc754 #12 2024-09-30 07:24:23 ~31 min tests 📄log
✔️ 8a787ca #17 2024-09-30 06:56:11 ~1 min android 📦aar
✔️ 8a787ca #17 2024-09-30 06:56:18 ~1 min tests-rpc 📄log
✔️ 8a787ca #17 2024-09-30 06:57:05 ~2 min linux 📦zip
✔️ 8a787ca #17 2024-09-30 06:58:59 ~2 min ios 📦zip
✔️ 84ae517 #18 2024-09-30 06:58:26 ~1 min android 📦aar
✔️ 84ae517 #18 2024-09-30 06:58:32 ~1 min tests-rpc 📄log
✔️ 84ae517 #18 2024-09-30 06:59:18 ~1 min linux 📦zip
✔️ 84ae517 #18 2024-09-30 07:02:00 ~2 min ios 📦zip
✔️ a85f68c #19 2024-09-30 07:03:49 ~1 min android 📦aar
✔️ a85f68c #19 2024-09-30 07:03:59 ~1 min tests-rpc 📄log
✔️ a85f68c #19 2024-09-30 07:04:29 ~1 min linux 📦zip
✔️ a85f68c #19 2024-09-30 07:05:26 ~2 min ios 📦zip
✔️ a85f68c #13 2024-09-30 07:55:25 ~30 min tests 📄log
✔️ 1183e55 #20 2024-10-01 03:54:38 ~1 min android 📦aar
✔️ 1183e55 #20 2024-10-01 03:54:54 ~1 min tests-rpc 📄log
✔️ 1183e55 #20 2024-10-01 03:55:21 ~2 min linux 📦zip
✔️ 1183e55 #20 2024-10-01 03:56:26 ~3 min ios 📦zip
✔️ 1183e55 #14 2024-10-01 04:24:23 ~31 min tests 📄log
✔️ 70086b5 #21 2024-10-01 04:02:27 ~1 min android 📦aar
✔️ 70086b5 #21 2024-10-01 04:03:03 ~1 min linux 📦zip
✔️ 70086b5 #21 2024-10-01 04:03:42 ~2 min tests-rpc 📄log
✔️ 70086b5 #21 2024-10-01 04:04:56 ~3 min ios 📦zip
✔️ 301fe0d #22 2024-10-01 04:05:34 ~1 min android 📦aar
✔️ 301fe0d #22 2024-10-01 04:05:45 ~1 min tests-rpc 📄log
✔️ 301fe0d #22 2024-10-01 04:06:05 ~1 min linux 📦zip
✔️ 301fe0d #22 2024-10-01 04:08:19 ~3 min ios 📦zip
✔️ be28875 #23 2024-10-01 04:10:40 ~1 min android 📦aar
✔️ be28875 #23 2024-10-01 04:10:51 ~1 min tests-rpc 📄log
✔️ be28875 #23 2024-10-01 04:11:28 ~2 min linux 📦zip
✔️ be28875 #23 2024-10-01 04:12:31 ~3 min ios 📦zip
✔️ 455c661 #24 2024-10-01 04:21:50 ~1 min android 📦aar
✔️ 455c661 #24 2024-10-01 04:22:32 ~2 min linux 📦zip
✔️ 455c661 #24 2024-10-01 04:22:59 ~2 min tests-rpc 📄log
✔️ 455c661 #24 2024-10-01 04:23:07 ~2 min ios 📦zip
✔️ 455c661 #15 2024-10-01 04:54:51 ~30 min tests 📄log
✔️ 79e8afc #25 2024-10-01 04:29:24 ~1 min tests-rpc 📄log
✔️ 79e8afc #25 2024-10-01 04:29:33 ~1 min android 📦aar
✔️ 79e8afc #25 2024-10-01 04:30:50 ~3 min ios 📦zip
✔️ 79e8afc #25 2024-10-01 04:31:22 ~3 min linux 📦zip
✔️ 0d81b86 #26 2024-10-01 04:43:25 ~1 min tests-rpc 📄log
✔️ 0d81b86 #26 2024-10-01 04:43:39 ~1 min android 📦aar
✔️ 0d81b86 #26 2024-10-01 04:43:58 ~1 min linux 📦zip
✔️ 0d81b86 #26 2024-10-01 04:44:47 ~2 min ios 📦zip
✔️ a677c76 #27 2024-10-01 04:45:12 ~1 min tests-rpc 📄log
✔️ a677c76 #27 2024-10-01 04:45:32 ~1 min android 📦aar
✔️ a677c76 #27 2024-10-01 04:46:10 ~1 min linux 📦zip
✔️ a677c76 #27 2024-10-01 04:48:02 ~3 min ios 📦zip
✔️ a677c76 #16 2024-10-01 05:25:33 ~30 min tests 📄log
✔️ b56e69d #28 2024-10-03 10:40:23 ~2 min android 📦aar
✔️ b56e69d #28 2024-10-03 10:40:31 ~2 min linux 📦zip
✔️ b56e69d #28 2024-10-03 10:41:18 ~3 min tests-rpc 📄log
✔️ b56e69d #28 2024-10-03 10:42:24 ~4 min ios 📦zip
✔️ b56e69d #17 2024-10-03 11:10:48 ~32 min tests 📄log
✔️ 23a73a7 #29 2024-10-03 11:31:59 ~1 min android 📦aar
✔️ 23a73a7 #29 2024-10-03 11:32:46 ~2 min tests-rpc 📄log
✔️ 23a73a7 #29 2024-10-03 11:32:58 ~2 min linux 📦zip
✔️ 23a73a7 #29 2024-10-03 11:33:34 ~2 min ios 📦zip
✖️ 23a73a7 #18 2024-10-03 12:04:11 ~33 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f2438bb #30 2024-10-03 11:34:44 ~1 min android 📦aar
✔️ f2438bb #30 2024-10-03 11:35:23 ~2 min linux 📦zip
✔️ f2438bb #30 2024-10-03 11:36:21 ~2 min ios 📦zip
✔️ f2438bb #30 2024-10-03 11:36:26 ~3 min tests-rpc 📄log
✔️ fc73ab2 #31 2024-10-03 11:45:28 ~1 min android 📦aar
✔️ fc73ab2 #31 2024-10-03 11:45:48 ~1 min tests-rpc 📄log
✔️ fc73ab2 #31 2024-10-03 11:46:02 ~2 min linux 📦zip
✔️ fc73ab2 #31 2024-10-03 11:46:38 ~2 min ios 📦zip
✔️ fc73ab2 #19 2024-10-03 12:35:47 ~31 min tests 📄log

Copy link

github-actions bot commented Sep 25, 2024

Looks like you have BREAKING CHANGES in your PR.
Please make sure to follow 💔How to introduce breaking changes guide:

Check-list

@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.09%. Comparing base (04784d1) to head (fc73ab2).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5877      +/-   ##
===========================================
+ Coverage    45.42%   46.09%   +0.67%     
===========================================
  Files          891      891              
  Lines       158084   158082       -2     
===========================================
+ Hits         71808    72869    +1061     
+ Misses       78201    76848    -1353     
- Partials      8075     8365     +290     
Flag Coverage Δ
functional 11.85% <ø> (?)
unit 45.49% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 134 files with indirect coverage changes

@siddarthkay
Copy link
Contributor Author

Hmmm

One or more of the teams you specified is not a collaborator of the status-im/status-go repository.

So it seems we will have to make the relevant teams inside status-go repository first.
At the moment I see teams are made at Org level.

@igor-sirotin
Copy link
Collaborator

igor-sirotin commented Sep 25, 2024

@siddarthkay is it time to review this? Or are you still testing?

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Breaking changes have been approved by Mobile and Desktop QA. This PR can now be merged.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Breaking changes have been approved by Mobile and Desktop QA. This PR can now be merged.

name: 'QA Approval Check',
head_sha: context.payload.pull_request.head.sha,
status: 'completed',
conclusion: 'failure',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@igor-sirotin : added a failing check as discussed, the github-actions bot will no longer request changes, It will just add a comment with an appropriate message.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this create a separate status check? Maybe we could just use this check itself?
Something like this should be enough I think 🤔

core.setFailed("Some commit messages are ill-formed")

The reason is not to bloat the checks list. It's already 12 😅

And the comment can be implemented as "sticky comment", I did it in the commit-check. Can be a single comment in the PR that will be edited when reviews received/lost.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Breaking changes have been approved by Mobile and Desktop QA. This PR can now be merged.

@siddarthkay siddarthkay marked this pull request as ready for review October 1, 2024 04:27
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Breaking changes have been approved by Mobile and Desktop QA. This PR can now be merged.

@siddarthkay siddarthkay force-pushed the pr-review-workflow-automation branch 2 times, most recently from 0d81b86 to a677c76 Compare October 1, 2024 04:42
@siddarthkay
Copy link
Contributor Author

added a check to prevent the bot from approving the PR multiple times.

@siddarthkay siddarthkay requested a review from a team October 1, 2024 04:45
@igor-sirotin igor-sirotin self-requested a review October 1, 2024 12:08
@@ -0,0 +1,145 @@
name: PR Review Workflow for Breaking Changes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shorter name would be better I think

Suggested change
name: PR Review Workflow for Breaking Changes
name: PR Review Workflow

- synchronize

jobs:
check_breaking_change:
Copy link
Collaborator

Choose a reason for hiding this comment

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

A human-readable name would be nice as well:

Suggested change
check_breaking_change:
check_breaking_change:
name: Require QA review

This is what we have for conventional commits:

image

id: set_reviewers
run: |
echo "mobile_qa=churik,yevh-berdnyk,VolodLytvynenko,pavloburykh,mariia-skrypnyk,Horupa-Olena" >> $GITHUB_OUTPUT
echo "desktop_qa=anastasiyaig,virginiabalducci,glitchminer,antdanchenko" >> $GITHUB_OUTPUT
Copy link
Collaborator

Choose a reason for hiding this comment

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

This works ofc, if it's simpler 👍 We can improve in future.

Though I'm worried about pinging all QAs, we end up with the list like this:
image

Imagine what will happen when we add devs reviews as well 🥲
So I think the "randomise" logic is required before merging this. Otherwise we'll die in tons of notifications.

const desktopQA = '${{ steps.set_reviewers.outputs.desktop_qa }}'.split(',');
const reviewers = [...mobileQA, ...desktopQA];

await github.rest.pulls.requestReviewers({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might this re-request reviews, if already approved? I think we don't want such behaviour?

}
});

- name: Allow PR merge if conditions are met
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need the bot approval at all, if we have the status check already? It's kinda duplication 🤔

name: 'QA Approval Check',
head_sha: context.payload.pull_request.head.sha,
status: 'completed',
conclusion: 'failure',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this create a separate status check? Maybe we could just use this check itself?
Something like this should be enough I think 🤔

core.setFailed("Some commit messages are ill-formed")

The reason is not to bloat the checks list. It's already 12 😅

And the comment can be implemented as "sticky comment", I did it in the commit-check. Can be a single comment in the PR that will be edited when reviews received/lost.

Comment on lines 97 to 103
if (!mobileQAApproved && !desktopQAApproved) {
message += 'Both mobile-qa and desktop-qa teams have not approved this PR yet.';
} else if (!mobileQAApproved) {
message += 'The mobile-qa team has not approved this PR yet.';
} else if (!desktopQAApproved) {
message += 'The desktop-qa team has not approved this PR yet.';
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (!mobileQAApproved && !desktopQAApproved) {
message += 'Both mobile-qa and desktop-qa teams have not approved this PR yet.';
} else if (!mobileQAApproved) {
message += 'The mobile-qa team has not approved this PR yet.';
} else if (!desktopQAApproved) {
message += 'The desktop-qa team has not approved this PR yet.';
}
message += `- ${mobileQAApproved ? '[ ]' : '[x]'} Mobile QA team review`
message += `- ${desktopQAApproved ? '[ ]' : '[x]'} Desktop QA team review`

This commit Implements a PR review workflow like this :

- This action will check if `breaking change` label exists on PR.
- if it does then `@status-im/desktop-qa` and `@status-im/mobile-qa` are asked for review on this PR.
- Unless 1 person from `@status-im/desktop-qa` and `@status-im/mobile-qa` approve that PR the Github action will block the PR.
- Only after these conditions match the Github action will allow merging of this PR.
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.

8 participants