Skip to content

Commit 2b8bed5

Browse files
authored
Updated guidelines pr (#113)
* Updated CodeRabbit test. Added PR filtering * Added PR filtering * Added PR filtering v2 * Added PR issue filter user list * Fixed CodeRabbit Check. Added No Issue PR Check 1764267502
1 parent f9cf972 commit 2b8bed5

4 files changed

Lines changed: 50 additions & 49 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
palisadoes
2+
noman2002

.github/workflows/pull-request-review.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ jobs:
2424
});
2525
2626
// Filter reviews that have a user login containing "coderabbit" (case-insensitive)
27+
// and exclude COMMENTED states.
2728
const codeRabbitReviews = reviews.filter(review =>
28-
review.user.login.toLowerCase().includes('coderabbit') || review.user.login.toLowerCase().includes('coderabbitai')
29+
(review.user.login.toLowerCase().includes('coderabbit') ||
30+
review.user.login.toLowerCase().includes('coderabbitai')) &&
31+
review.state !== 'COMMENTED'
2932
);
3033
3134
// Fail if no CodeRabbit reviews are found

.github/workflows/pull-request-target.yml

Lines changed: 28 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@
33
#
44
# NOTE!
55
#
6-
# Please read the README.md file in this directory that defines what should
6+
# Please read the README.md file in this directory that defines what should
77
# be placed in this file
88
#
99
##############################################################################
1010
##############################################################################
1111

1212
name: PR Target Workflow
13-
on:
13+
on:
1414
pull_request_target:
15-
15+
16+
# Required for arkid15r/check-pr-issue-action
17+
permissions:
18+
contents: read
19+
issues: read
20+
pull-requests: write
21+
1622
jobs:
1723
PR-Greeting:
1824
name: Pull Request Target
@@ -24,53 +30,28 @@ jobs:
2430
comment-tag: pr_review_policy
2531
message: |
2632
## Our Pull Request Approval Process
27-
28-
Thanks for contributing!
29-
30-
### Testing Your Code
31-
Remember, your PRs won't be reviewed until these criteria are met:
32-
33-
1. We don't merge PRs with poor code quality.
34-
1. Follow coding best practices such that CodeRabbit.ai approves your PR.
35-
1. We don't merge PRs with failed tests.
36-
1. When tests fail, click on the `Details` link to learn more.
37-
1. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
38-
1. Tests may fail if you edit sensitive files. Ask to add the `ignore-sensitive-files-pr` label if the edits are necessary.
39-
1. We cannot merge PRs with conflicting files. These must be fixed.
40-
41-
Our policies make our code better.
42-
43-
### Reviewers
44-
45-
Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
46-
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:
47-
48-
1. comments in this PR or
49-
1. our slack channel
50-
51-
#### Reviewing Your Code
52-
53-
Your reviewer(s) will have the following roles:
5433
55-
1. arbitrators of future discussions with other contributors about the validity of your changes
56-
2. point of contact for evaluating the validity of your work
57-
3. person who verifies matching issues by others that should be closed.
58-
4. person who gives general guidance in fixing your tests
34+
This PR will be reviewed according to the [Palisadoes Contributing Guidelines](https://developer.palisadoes.org/docs/contributor-guide/contributing)
5935
60-
### CONTRIBUTING.md
61-
62-
Read our CONTRIBUTING.md file. Most importantly:
63-
64-
1. PRs with issues not assigned to you will be closed by the reviewer
65-
1. Fix the first comment in the PR so that each issue listed automatically closes
66-
67-
### Other
68-
69-
1. :dart: Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
70-
2. Read the CONTRIBUTING.md file make
36+
Thanks for contributing!
7137
7238
- name: Greeting Message to User
73-
uses: actions/first-interaction@v1
39+
uses: actions/first-interaction@v3
7440
with:
7541
repo-token: ${{ secrets.GITHUB_TOKEN }}
76-
pr-message: "Congratulations on making your first PR! :confetti_ball: If you haven't already, check out our [Contributing Guidelines](https://github.com/PalisadoesFoundation/talawa-admin/blob/-/CONTRIBUTING.md) and [PR Reporting Guidelines](https://github.com/PalisadoesFoundation/talawa-admin/blob/-/PR_GUIDELINES.md) to ensure that you are following our guidelines for contributing and creating PR."
42+
pr-message: 'Congratulations on making your first PR!'
43+
44+
Check-PR-Issue:
45+
runs-on: ubuntu-latest
46+
needs: [PR-Greeting]
47+
steps:
48+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
49+
- name: Check PR linked issue and assignee
50+
uses: arkid15r/check-pr-issue-action@f2c2ac3b8c73b5da96294af9ac3ec174098cf513
51+
with:
52+
close_pr_on_failure: 'true'
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
no_assignee_message: 'The linked issue must be assigned to the PR author.'
55+
no_issue_message: 'The PR must be linked to an issue assigned to the PR author.'
56+
require_assignee: 'true'
57+
skip_users_file_path: '.github/workflows/config/check-pr-issue-skip-usernames.txt'

docs/contributor-guide/pr-guidelines.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ If you are concerned that a larger design will be lost in a string of small PRs,
6262

6363
Note all commits in a PR are squashed when merged to the main branch so there is one commit per PR after merge.
6464

65+
## The Role of Reviewers
66+
67+
Your reviewer(s) will have the following roles:
68+
69+
1. arbitrators of future discussions with other contributors about the validity of your changes
70+
2. point of contact for evaluating the validity of your work
71+
3. person who verifies matching issues by others that should be closed.
72+
4. person who gives general guidance in fixing your tests
73+
74+
Please follow thier advice and discuss the rationale if you feel the requests are not in the best long term interest of the code base or don't meet any best practices.
75+
6576
## Pull Request Best Practices
6677

6778
In order to give everyone a chance to submit a pull request and contribute to our repositories please be aware of the guidelines we abide by:
@@ -74,7 +85,11 @@ In order to give everyone a chance to submit a pull request and contribute to ou
7485
1. Do not start working on any open issue and raise a PR unless the issue is assigned to you. PRs that don't meet these guidelines will be closed.
7586

7687
1. All pull requests must have test units.
77-
- Valid tests must cover at least 95% of the submitted code and 100% is preferred. If, for some reason, it is not possible to add tests, please let us know and explain why. In that case, you'll need to tell us what steps you followed to manually test your changes.
88+
1. Valid tests must cover at least 95% of the submitted code and 100% is preferred. If, for some reason, it is not possible to add tests, please let us know and explain why. In that case, you'll need to tell us what steps you followed to manually test your changes.
89+
90+
2. We don't merge PRs with failed tests. When tests fail, click on the `Details` link of the test to learn more.
91+
92+
3. Tests may fail if you edit sensitive files. Ask to add the `ignore-sensitive-files-pr` label if the edits are necessary.
7893

7994
1. [Use this method to automatically close the issue when the PR is completed.](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue)
8095

0 commit comments

Comments
 (0)