Skip to content

Commit 06f286e

Browse files
committed
Merge branch 'origin/feature/Offline-Indicator-Banner' to resolve conflict in backend/app.py
2 parents d63229c + a4f2317 commit 06f286e

179 files changed

Lines changed: 35434 additions & 2462 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.DS_Store‎

8 KB
Binary file not shown.

‎.github/ISSUE_TEMPLATE/blank.yml‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎.github/labels.yml‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
- name: "quality:clean"
2+
color: "c5f0ed"
3+
description: "PR follows all coding standards and is well-structured (for GSSoC'26)"
4+
- name: "quality:exceptional"
5+
color: "c5f0ed"
6+
description: "PR goes above and beyond in terms of quality and optimization (for GSSoC'26)"
7+
- name: "type:docs"
8+
color: "f1f2f6"
9+
description: "Additions or updates to documentation (for GSSoC'26)"
10+
- name: "type:testing"
11+
color: "f1f2f6"
12+
description: "Adding or improving tests (for GSSoC'26)"
13+
- name: "type:accessibility"
14+
color: "f1f2f6"
15+
description: "Improvements related to web accessibility (for GSSoC'26)"
16+
- name: "type:performance"
17+
color: "f1f2f6"
18+
description: "Changes that improve speed or resource usage (for GSSoC'26)"
19+
- name: "type:security"
20+
color: "f1f2f6"
21+
description: "Security-related fixes or enhancements (for GSSoC'26)"
22+
- name: "type:design"
23+
color: "f1f2f6"
24+
description: "Changes to UI, layout, or visual elements (for GSSoC'26)"
25+
- name: "type:refactor"
26+
color: "f1f2f6"
27+
description: "Code changes that neither fix a bug nor add a feature (for GSSoC'26)"
28+
- name: "type:devops"
29+
color: "f1f2f6"
30+
description: "Changes to CI/CD, build scripts, or infrastructure (for GSSoC'26)"
31+
- name: "type:bug"
32+
color: "f1f2f6"
33+
description: "Fixes for identified issues or errors (for GSSoC'26)"
34+
- name: "type:feature"
35+
color: "f1f2f6"
36+
description: "Introduction of new functionality (for GSSoC'26)"
37+
- name: "gssoc:approved"
38+
color: "c5f0ed"
39+
description: "PR has been reviewed and is eligible for GSSoC points (for GSSoC'26)"
40+
- name: "gssoc:invalid"
41+
color: "ffcccb"
42+
description: "PR does not meet requirements or is out of scope (for GSSoC'26)"
43+
- name: "gssoc:spam"
44+
color: "ffcccb"
45+
description: "PR is low-effort or automated spam (for GSSoC'26)"
46+
- name: "gssoc:ai-slop"
47+
color: "ffcccb"
48+
description: "PR contains low-quality AI-generated content (for GSSoC'26)"

‎.github/pull_request_template.md‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,5 @@ Explain how you tested it.
2626
- [ ] Docs updated
2727
- [ ] PR title includes the relevant event tag or a general contribution label
2828

29-
## NSoC'26 Rule
30-
For event-based contributions, include the relevant event tag in the t itle, such as **NSoC'26**, **Apertre 3.0**,**GSSoC'26**, etc.
31-
3229
Example:
3330
[NSoC'26] Add authentication system

‎.github/workflows/ci.yml‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI – Run Tests & Lint
2+
3+
on:
4+
push:
5+
branches: ["main", "master"]
6+
pull_request:
7+
branches: ["main", "master"]
8+
9+
jobs:
10+
lint:
11+
name: Lint Python
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.11"
18+
cache: "pip"
19+
- name: Install linters
20+
run: pip install flake8 black
21+
- name: Check code formatting with Black
22+
run: black --check backend tests || true
23+
- name: Lint with flake8
24+
run: |
25+
# Stop the build if there are Python syntax errors or undefined names
26+
flake8 backend tests --count --select=E9,F63,F7,F82 --show-source --statistics
27+
# exit-zero treats all other errors as warnings
28+
flake8 backend tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
29+
30+
test:
31+
name: pytest
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- uses: actions/setup-python@v5
38+
with:
39+
python-version: "3.11"
40+
cache: "pip"
41+
42+
- name: Install dependencies
43+
run: |
44+
pip install --upgrade pip
45+
pip install torch --index-url https://download.pytorch.org/whl/cpu
46+
pip install -r backend/requirements.txt
47+
pip install pytest pytest-cov
48+
pip install flask-wtf bleach Pillow beautifulsoup4 "pydantic[email]"
49+
50+
- name: Run pytest
51+
env:
52+
GOOGLE_BOOKS_API_KEY: "ci-fake-key"
53+
OPENAI_API_KEY: "ci-fake-key"
54+
GROQ_API_KEY: "ci-fake-key"
55+
GEMINI_API_KEY: "ci-fake-key"
56+
FLASK_ENV: testing
57+
PYTHONPATH: ".:backend"
58+
run: |
59+
python -m pytest tests/ \
60+
--ignore=tests/test_llm.py \
61+
--ignore=tests/test_mood_improvements.py \
62+
--ignore=tests/test_mood_cache_db.py \
63+
--ignore=tests/test_category_cache.py \
64+
--ignore=tests/test_env_validation.py \
65+
--ignore=tests/test_purchase_links.py \
66+
-v --tb=short --cov=backend
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Generate Contributors
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
schedule:
7+
- cron: '0 0,8,16 * * *' # three times a day at 00:00, 08:00, and 16:00 UTC
8+
workflow_dispatch: {}
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
generate:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
persist-credentials: true
21+
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '18'
26+
27+
- name: Install (none required)
28+
run: node -v
29+
30+
- name: Run generator
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
OWNER: devanshi14malhotra
34+
REPO: BiblioDrift
35+
PER_PAGE: '100'
36+
run: |
37+
node scripts/generate_contributors.js
38+
39+
- name: Commit and push if changed
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
git add frontend/data/contributors.json
44+
if ! git diff --cached --quiet; then
45+
git commit -m "chore: update contributors.json"
46+
git push
47+
else
48+
echo "No changes to commit"
49+
fi

‎.github/workflows/labeller.yml‎

Lines changed: 0 additions & 64 deletions
This file was deleted.

‎.github/workflows/labels-setup.yml‎

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Setup GSSOC Labels
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- '.github/workflows/labels-setup.yml'
10+
11+
permissions:
12+
contents: read
13+
issues: write
14+
15+
jobs:
16+
setup-labels:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Create or Update Labels
20+
uses: actions/github-script@v6
21+
with:
22+
script: |
23+
const labels = [
24+
// QUALITY (OPTIONAL) - Teal
25+
{ name: "quality:clean", color: "c5f0ed", description: "PR follows all coding standards and is well-structured (for GSSoC'26)" },
26+
{ name: "quality:exceptional", color: "c5f0ed", description: "PR goes above and beyond in terms of quality and optimization (for GSSoC'26)" },
27+
28+
// TYPE BONUS (OPTIONAL) - Gray
29+
{ name: "type:docs", color: "f1f2f6", description: "Additions or updates to documentation (for GSSoC'26)" },
30+
{ name: "type:testing", color: "f1f2f6", description: "Adding or improving tests (for GSSoC'26)" },
31+
{ name: "type:accessibility", color: "f1f2f6", description: "Improvements related to web accessibility (for GSSoC'26)" },
32+
{ name: "type:performance", color: "f1f2f6", description: "Changes that improve speed or resource usage (for GSSoC'26)" },
33+
{ name: "type:security", color: "f1f2f6", description: "Security-related fixes or enhancements (for GSSoC'26)" },
34+
{ name: "type:design", color: "f1f2f6", description: "Changes to UI, layout, or visual elements (for GSSoC'26)" },
35+
{ name: "type:refactor", color: "f1f2f6", description: "Code changes that neither fix a bug nor add a feature (for GSSoC'26)" },
36+
{ name: "type:devops", color: "f1f2f6", description: "Changes to CI/CD, build scripts, or infrastructure (for GSSoC'26)" },
37+
{ name: "type:bug", color: "f1f2f6", description: "Fixes for identified issues or errors (for GSSoC'26)" },
38+
{ name: "type:feature", color: "f1f2f6", description: "Introduction of new functionality (for GSSoC'26)" },
39+
40+
// VALIDATION (ADMIN DECIDES)
41+
{ name: "gssoc:approved", color: "c5f0ed", description: "PR has been reviewed and is eligible for GSSoC points (for GSSoC'26)" },
42+
{ name: "gssoc:invalid", color: "ffcccb", description: "PR does not meet requirements or is out of scope (for GSSoC'26)" },
43+
{ name: "gssoc:spam", color: "ffcccb", description: "PR is low-effort or automated spam (for GSSoC'26)" },
44+
{ name: "gssoc:ai-slop", color: "ffcccb", description: "PR contains low-quality AI-generated content (for GSSoC'26)" },
45+
];
46+
47+
for (const label of labels) {
48+
try {
49+
const { data: existingLabel } = await github.rest.issues.getLabel({
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
name: label.name
53+
});
54+
55+
console.log(`Updating label: ${label.name}`);
56+
await github.rest.issues.updateLabel({
57+
owner: context.repo.owner,
58+
repo: context.repo.repo,
59+
name: label.name,
60+
new_name: label.name,
61+
color: label.color,
62+
description: label.description
63+
});
64+
} catch (error) {
65+
if (error.status === 404) {
66+
console.log(`Creating label: ${label.name}`);
67+
await github.rest.issues.createLabel({
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
name: label.name,
71+
color: label.color,
72+
description: label.description
73+
});
74+
} else {
75+
console.error(`Error processing label ${label.name}:`, error);
76+
}
77+
}
78+
}

0 commit comments

Comments
 (0)