Skip to content

Json #11

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

Merged
merged 17 commits into from
Jan 13, 2025
Merged

Json #11

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: "en-US"
early_access: false
reviews:
profile: "chill"
request_changes_workflow: true
high_level_summary: true
poem: true
review_status: true
collapse_walkthrough: false
auto_review:
enabled: true
drafts: false
base_branches:
- develop
- main
chat:
auto_reply: true
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
ignore = E402,E722,E203,F401,W503
max-line-length = 80
7 changes: 7 additions & 0 deletions .github/workflows/auto-label.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"labelsSynonyms": {
"dependencies": ["dependabot", "dependency", "dependencies"],
"security": ["security"],
},
"defaultLabels": ["unapproved"],
}
66 changes: 66 additions & 0 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
##############################################################################
##############################################################################
#
# NOTE!
#
# Please read the README.md file in this directory that defines what should
# be placed in this file
#
##############################################################################
##############################################################################

name: Issue Workflow
on:
issues:
types: ['opened']
jobs:
Opened-issue-label:
name: Adding Issue Label
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github/workflows/auto-label.json5
sparse-checkout-cone-mode: false
- uses: Renato66/auto-label@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
script: |
const { owner, repo } = context.repo;
const issue_number = context.issue.number;
const apiParams = {
owner,
repo,
issue_number
};
const labels = await github.rest.issues.listLabelsOnIssue(apiParams);
if(labels.data.reduce((a, c)=>a||["dependencies"].includes(c.name), false))
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ["good first issue", "security"]
});
else if(labels.data.reduce((a, c)=>a||["security", "ui/ux"].includes(c.name), false))
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ["good first issue"]
});


Issue-Greeting:
name: Greeting Message to User
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
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."

89 changes: 86 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,31 @@ jobs:
echo "Source Branch ${{ github.event.pull_request.head.ref }}"
echo "Target Branch ${{ github.event.pull_request.base.ref }}"
echo "Error: Source and Target Branches are the same. Please ensure they are different."
echo "Error: Close this PR and try again."
exit 1

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black pydocstyle flake8-docstrings

- name: Run Black Formatter Check
run: |
black --check .

- name: Run Flake8 Linter
run: |
flake8 --docstring-convention google switchmap bin setup tests .github --ignore E402,E722,E203,F401,W503

- name: Run pydocstyle
run: |
pydocstyle switchmap setup bin tests --convention=google --add-ignore=D415,D205

Check-Sensitive-Files:
if: ${{ github.actor != 'dependabot[bot]' && !contains(github.event.pull_request.labels.*.name, 'ignore-sensitive-files-pr') }}
name: Checks if sensitive files have been changed without authorization
Expand All @@ -57,21 +80,28 @@ jobs:
.github/**
package.json
package-lock.json
yaml.lock
.gitignore
.nojekyll
CODEOWNERS
LICENSE
.coderabbit.yaml
./*.md
docs/CNAME
docs/static/CNAME
docs/package.json
docs/sidebar*.js
docs/docusaurus.config.js
docs/babel.config.js
docs/tsconfig.json
.coderabbit.yaml

CODE_OF_CONDUCT.md
CODE_STYLE.md
CONTRIBUTING.md
DOCUMENTATION.md
INSTALLATION.md
ISSUE_GUIDELINES.md
PR_GUIDELINES.md
README.md
requirements.txt
- name: List all changed unauthorized files
if: steps.changed-unauth-files.outputs.any_changed == 'true' || steps.changed-unauth-files.outputs.any_deleted == 'true'
env:
Expand Down Expand Up @@ -142,4 +172,57 @@ jobs:
if: github.event.pull_request.base.ref != 'develop'
run: |
echo "Error: Pull request target branch must be 'develop'. Please refer PR_GUIDELINES.md"
echo "Error: Close this PR and try again."
exit 1

Validate-CodeRabbit:
name: Validate CodeRabbit Approval
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
needs: [Code-Quality-Checks, Test-Docusaurus-Deployment]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate CodeRabbit.ai Approval
run: |
chmod +x $GITHUB_WORKSPACE/.github/workflows/scripts/validate-coderabbit.sh
$GITHUB_WORKSPACE/.github/workflows/scripts/validate-coderabbit.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_REPOSITORY: ${{ github.repository }}

Docstring-Compliance:
name: Check Docstring Compliance
runs-on: ubuntu-latest
needs: [Code-Quality-Checks]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run docstring compliance check
run: |
source venv/bin/activate
python .github/workflows/scripts/check_docstrings.py --directories switchmap setup bin tests .github
Loading
Loading