Skip to content

Commit 55a92e6

Browse files
Json (#11)
* Added markdown files * Updated markdown (#5) * feat-UI: SM-Docs-API-website (#8) * Update pull-request.yml * Update pull-request.yml * Update pull-request.yml * Update pull-request.yml * Update pull-request.yml * Update pull-request.yml * Update pull-request.yml * Create .coderabbit.yaml * Added linters to the pull request GitHub action workflows (#9) * Added linters to the pull request GitHub action workflows * Added linters to the pull request GitHub action workflows * Fixed flake error * Fixed black error * Fixed black error v2 * Update check_docstrings.py * Json (#10) * JSON * Test * JSON --------- Co-authored-by: Karthik <[email protected]>
1 parent a585676 commit 55a92e6

26 files changed

+1333
-53
lines changed

.coderabbit.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: "en-US"
3+
early_access: false
4+
reviews:
5+
profile: "chill"
6+
request_changes_workflow: true
7+
high_level_summary: true
8+
poem: true
9+
review_status: true
10+
collapse_walkthrough: false
11+
auto_review:
12+
enabled: true
13+
drafts: false
14+
base_branches:
15+
- develop
16+
- main
17+
chat:
18+
auto_reply: true

.flake8

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
ignore = E402,E722,E203,F401,W503
3+
max-line-length = 80

.github/workflows/auto-label.json5

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"labelsSynonyms": {
3+
"dependencies": ["dependabot", "dependency", "dependencies"],
4+
"security": ["security"],
5+
},
6+
"defaultLabels": ["unapproved"],
7+
}

.github/workflows/issue.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
##############################################################################
2+
##############################################################################
3+
#
4+
# NOTE!
5+
#
6+
# Please read the README.md file in this directory that defines what should
7+
# be placed in this file
8+
#
9+
##############################################################################
10+
##############################################################################
11+
12+
name: Issue Workflow
13+
on:
14+
issues:
15+
types: ['opened']
16+
jobs:
17+
Opened-issue-label:
18+
name: Adding Issue Label
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
sparse-checkout: |
24+
.github/workflows/auto-label.json5
25+
sparse-checkout-cone-mode: false
26+
- uses: Renato66/auto-label@v3
27+
with:
28+
repo-token: ${{ secrets.GITHUB_TOKEN }}
29+
- uses: actions/github-script@v7
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
script: |
34+
const { owner, repo } = context.repo;
35+
const issue_number = context.issue.number;
36+
const apiParams = {
37+
owner,
38+
repo,
39+
issue_number
40+
};
41+
const labels = await github.rest.issues.listLabelsOnIssue(apiParams);
42+
if(labels.data.reduce((a, c)=>a||["dependencies"].includes(c.name), false))
43+
await github.rest.issues.addLabels({
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
issue_number: context.issue.number,
47+
labels: ["good first issue", "security"]
48+
});
49+
else if(labels.data.reduce((a, c)=>a||["security", "ui/ux"].includes(c.name), false))
50+
await github.rest.issues.addLabels({
51+
owner: context.repo.owner,
52+
repo: context.repo.repo,
53+
issue_number: context.issue.number,
54+
labels: ["good first issue"]
55+
});
56+
57+
58+
Issue-Greeting:
59+
name: Greeting Message to User
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/first-interaction@v1
63+
with:
64+
repo-token: ${{ secrets.GITHUB_TOKEN }}
65+
issue-message: "Congratulations on making your first Issue! :confetti_ball: If you haven't already, check out our [Contributing Guidelines](https://github.com/PalisadoesFoundation/talawa-admin/blob/develop/CONTRIBUTING.md) and [Issue Reporting Guidelines](https://github.com/PalisadoesFoundation/talawa-admin/blob/develop/ISSUE_GUIDELINES.md) to ensure that you are following our guidelines for contributing and making issues."
66+

.github/workflows/pull-request.yml

+86-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,31 @@ jobs:
3838
echo "Source Branch ${{ github.event.pull_request.head.ref }}"
3939
echo "Target Branch ${{ github.event.pull_request.base.ref }}"
4040
echo "Error: Source and Target Branches are the same. Please ensure they are different."
41+
echo "Error: Close this PR and try again."
4142
exit 1
4243
44+
- name: Set up Python
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: 3.9
48+
49+
- name: Install dependencies
50+
run: |
51+
python -m pip install --upgrade pip
52+
pip install flake8 black pydocstyle flake8-docstrings
53+
54+
- name: Run Black Formatter Check
55+
run: |
56+
black --check .
57+
58+
- name: Run Flake8 Linter
59+
run: |
60+
flake8 --docstring-convention google switchmap bin setup tests .github --ignore E402,E722,E203,F401,W503
61+
62+
- name: Run pydocstyle
63+
run: |
64+
pydocstyle switchmap setup bin tests --convention=google --add-ignore=D415,D205
65+
4366
Check-Sensitive-Files:
4467
if: ${{ github.actor != 'dependabot[bot]' && !contains(github.event.pull_request.labels.*.name, 'ignore-sensitive-files-pr') }}
4568
name: Checks if sensitive files have been changed without authorization
@@ -57,21 +80,28 @@ jobs:
5780
.github/**
5881
package.json
5982
package-lock.json
83+
yaml.lock
6084
.gitignore
6185
.nojekyll
6286
CODEOWNERS
6387
LICENSE
6488
.coderabbit.yaml
65-
./*.md
6689
docs/CNAME
6790
docs/static/CNAME
6891
docs/package.json
6992
docs/sidebar*.js
7093
docs/docusaurus.config.js
7194
docs/babel.config.js
7295
docs/tsconfig.json
73-
.coderabbit.yaml
74-
96+
CODE_OF_CONDUCT.md
97+
CODE_STYLE.md
98+
CONTRIBUTING.md
99+
DOCUMENTATION.md
100+
INSTALLATION.md
101+
ISSUE_GUIDELINES.md
102+
PR_GUIDELINES.md
103+
README.md
104+
requirements.txt
75105
- name: List all changed unauthorized files
76106
if: steps.changed-unauth-files.outputs.any_changed == 'true' || steps.changed-unauth-files.outputs.any_deleted == 'true'
77107
env:
@@ -142,4 +172,57 @@ jobs:
142172
if: github.event.pull_request.base.ref != 'develop'
143173
run: |
144174
echo "Error: Pull request target branch must be 'develop'. Please refer PR_GUIDELINES.md"
175+
echo "Error: Close this PR and try again."
145176
exit 1
177+
178+
Validate-CodeRabbit:
179+
name: Validate CodeRabbit Approval
180+
runs-on: ubuntu-latest
181+
if: github.actor != 'dependabot[bot]'
182+
needs: [Code-Quality-Checks, Test-Docusaurus-Deployment]
183+
steps:
184+
- name: Checkout Repository
185+
uses: actions/checkout@v4
186+
- name: Validate CodeRabbit.ai Approval
187+
run: |
188+
chmod +x $GITHUB_WORKSPACE/.github/workflows/scripts/validate-coderabbit.sh
189+
$GITHUB_WORKSPACE/.github/workflows/scripts/validate-coderabbit.sh
190+
env:
191+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
192+
PR_NUMBER: ${{ github.event.pull_request.number }}
193+
GITHUB_REPOSITORY: ${{ github.repository }}
194+
195+
Docstring-Compliance:
196+
name: Check Docstring Compliance
197+
runs-on: ubuntu-latest
198+
needs: [Code-Quality-Checks]
199+
steps:
200+
- name: Checkout
201+
uses: actions/checkout@v4
202+
with:
203+
fetch-depth: 0
204+
205+
- name: Set up Python 3.11
206+
uses: actions/setup-python@v4
207+
with:
208+
python-version: 3.11
209+
210+
- name: Cache pip packages
211+
uses: actions/cache@v4
212+
with:
213+
path: ~/.cache/pip
214+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
215+
restore-keys: |
216+
${{ runner.os }}-pip-
217+
218+
- name: Install dependencies
219+
run: |
220+
python3 -m venv venv
221+
source venv/bin/activate
222+
python -m pip install --upgrade pip
223+
pip install -r requirements.txt
224+
225+
- name: Run docstring compliance check
226+
run: |
227+
source venv/bin/activate
228+
python .github/workflows/scripts/check_docstrings.py --directories switchmap setup bin tests .github

0 commit comments

Comments
 (0)