Skip to content

Commit 057e405

Browse files
authored
Merge branch 'main' into dev-issue-25
2 parents a36eef6 + 2ba2e46 commit 057e405

Some content is hidden

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

50 files changed

+1579
-992
lines changed

.github/workflows/alembic.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Alembic Upgrade Head
2+
on: pull_request
3+
4+
jobs:
5+
alembic_upgrade_head:
6+
runs-on: ubuntu-latest
7+
8+
services:
9+
postgres:
10+
image: postgres:15
11+
ports:
12+
- 5432:5432
13+
options: >-
14+
--health-cmd "pg_isready -U runner"
15+
--health-interval 10s
16+
--health-timeout 5s
17+
--health-retries 5
18+
env:
19+
POSTGRES_USER: runner
20+
POSTGRES_DB: main
21+
POSTGRES_HOST_AUTH_METHOD: trust
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Wait for PostgreSQL to be ready
27+
run: |
28+
until pg_isready -h localhost -p 5432 -U runner; do
29+
echo "Waiting for PostgreSQL..."
30+
sleep 1
31+
done
32+
33+
- name: Install dependencies
34+
run: |
35+
# for python3.11 (dear internet gods: we'll update to 3.13 or something in a year, i promise)
36+
sudo add-apt-repository ppa:deadsnakes/ppa
37+
sudo apt install python3.11 python3.11-venv
38+
python3.11 -m pip install --upgrade pip
39+
python3.11 -m venv venv
40+
source ./venv/bin/activate
41+
pip install -r requirements.txt
42+
43+
# This will fail if there are divergent heads and alembic gets confused;
44+
# e.g., un-sanitarily merging main into a dev branch.
45+
- name: Run alembic upgrade head
46+
run: |
47+
source ./venv/bin/activate
48+
cd src
49+
alembic upgrade head

.github/workflows/pytest_unit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Unit Tests
22
on: pull_request
33

44
jobs:
5-
test:
5+
unit_tests:
66
runs-on: ubuntu-latest
77
timeout-minutes: 5
88

@@ -31,4 +31,4 @@ jobs:
3131
- name: Run unit tests
3232
run: |
3333
source ./venv/bin/activate
34-
pytest ./tests/unit -v
34+
pytest ./tests/unit -v

.github/workflows/ruff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ jobs:
77
- uses: actions/checkout@v4
88
- uses: chartboost/ruff-action@v1
99
with:
10-
version: 0.4.4
10+
version: 0.6.9

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ google_key.json
99
__pycache__/
1010
*.py[cod]
1111
*$py.class
12+
13+
.venv
14+
.DS_Store

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ The backend & REST API for the CSSS website. Anything the website frontend does
88

99
## Local Development
1010

11-
See [the csss-backend wiki](https://github.com/CSSS/csss-site-backend/wiki/Local-Setup) for details on how to run the REST API locally on your own machine.
11+
See [the csss-backend wiki](https://github.com/CSSS/csss-site-backend/wiki/1.-Local-Setup) for details on how to run the REST API locally on your own machine.
1212

13-
If you're planning to read through the source code, please check out this project's [naming conventions](https://github.com/CSSS/csss-site-backend/wiki/Naming-conventions).
13+
If you're planning to read through the source code, please check out this project's [naming conventions](https://github.com/CSSS/csss-site-backend/wiki/Style-Guide#naming-conventions).
1414

1515
## Important Directories
1616

@@ -25,3 +25,7 @@ If you're planning to read through the source code, please check out this projec
2525
- `misc/` for anything that can't be easily categorized or is very small
2626
- `officers/` for officer contact information + photos
2727
- `test/` for html pages which interact with the backend's local api
28+
29+
## Linter
30+
31+
We use `ruff 0.6.9` as our linter, which you can run with `ruff check --fix`. If you use a different version, it may be inconsistent with our CI checks.

config/cron.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
# run the daily script at 1am every morning
44
# TODO: make sure timezone is PST
55
crontab -l | { cat; echo "0 1 * * * /home/csss-site/csss-site-backend/src/cron/daily.py"; } | crontab -
6-

config/csss-site.service

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

config/export_secrets.sh

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

config/nginx.conf

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

config/sudoers.conf

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

0 commit comments

Comments
 (0)