Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
bc4a577
Agrego templates para Issues y Pull Requests
ilitteri Aug 20, 2022
2519ffc
Add web server implementation
ilitteri Aug 21, 2022
5e33f71
Add help queue implementation
ilitteri Aug 21, 2022
bafb55b
Add main.rs & lib.rs
ilitteri Aug 21, 2022
eb41bf8
Update README.md
ilitteri Aug 21, 2022
52822ef
Add Makefile
ilitteri Aug 21, 2022
4a8b2d8
Add web server documentation
ilitteri Aug 21, 2022
3bf647f
Add help queue documentation
ilitteri Aug 21, 2022
03515a4
Add Cargo.toml
ilitteri Aug 21, 2022
51f14c4
Add Cargo.lock
ilitteri Aug 21, 2022
b05caac
Remove Cargo.lock from .gitignore
ilitteri Aug 21, 2022
00254c1
Refactor web server structure
ilitteri Aug 23, 2022
a9ab370
Add & refactor tests
ilitteri Aug 23, 2022
8896a4e
Update README.md
ilitteri Aug 23, 2022
98017d0
Refactor web server structure
ilitteri Aug 23, 2022
76f8aeb
Add directive for running tests
ilitteri Aug 23, 2022
ac6dd61
Update README.md
ilitteri Aug 23, 2022
20c66b9
Update README.md
ilitteri Aug 23, 2022
d7142cb
GitHub Workflow (#5)
ilitteri Aug 24, 2022
3f92cd8
Cargo fmt
ilitteri Aug 24, 2022
7f50df7
This test doesn't need to be async
ilitteri Aug 27, 2022
8304849
Fix default domain inconsistency
ilitteri Aug 27, 2022
8d54685
Add Dockerfile
ilitteri Aug 21, 2022
943de86
Update Makefile
ilitteri Aug 21, 2022
d681ab3
Update README.md
ilitteri Aug 21, 2022
0d426a1
Build without cache
ilitteri Aug 21, 2022
0148e07
Fix run command
ilitteri Aug 21, 2022
0af49b5
Remove --no-cache for building the docker image
ilitteri Aug 24, 2022
88c5758
Add build_image directive to the run_image directive
ilitteri Aug 24, 2022
2672069
Update README.md
ilitteri Aug 24, 2022
7fc1eec
Fix server IP
ilitteri Aug 24, 2022
805a192
Add new dependencies
ilitteri Aug 24, 2022
61dff8f
Add GoogleServices trait & SpeadsheetService implementation
ilitteri Aug 24, 2022
5fddbb4
Add /api/discord/v1/is_student implementation
ilitteri Aug 24, 2022
ef2d9e9
Add /api/discord/v1/group implementation
ilitteri Aug 24, 2022
5d53cdd
Add SpreadsheetService to routes
ilitteri Aug 24, 2022
37b2fc6
Update Makefile
ilitteri Aug 24, 2022
5388e33
Cargo fmt
ilitteri Aug 24, 2022
569a5ae
Update spreadsheet default value to 2c2022 id
ilitteri Aug 28, 2022
dc9df6d
Add help log
ilitteri Aug 28, 2022
b3a82b0
Add chrono as a dependencie
ilitteri Aug 28, 2022
4a6665a
Add test for append row
ilitteri Aug 28, 2022
d9a4d65
Update Makefile due to new arg
ilitteri Aug 28, 2022
ebcad0d
Update help queue next method
ilitteri Aug 28, 2022
0d20316
Update README.md
ilitteri Aug 28, 2022
2f3ec45
Fix SPREADSHEET_ID
ilitteri Aug 28, 2022
9e65d3e
Ignore spreadsheet append row test
ilitteri Aug 28, 2022
6e37243
Add Calendar Service
ilitteri Aug 28, 2022
62cb006
Add /api/discord/v1/next_class endpoint
ilitteri Aug 28, 2022
e2f1a40
Update Makefile
ilitteri Aug 28, 2022
d0717d7
Add summary & description to event
ilitteri Aug 28, 2022
6794b41
Implemented Deserialize for SpreadsheetValue
ilitteri Aug 28, 2022
721a8bf
Remove unused method
ilitteri Aug 28, 2022
4ad7d8f
Merge branch 'main' of github.com:algoritmos-iii/algo3_backend into f…
ilitteri Sep 6, 2022
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
731 changes: 685 additions & 46 deletions Cargo.lock

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ edition = "2021"
[dependencies.anyhow]
version = "1"

[dependencies.async-trait]
version = "0.1"

[dependencies.chrono]
version = "0.4"

[dependencies.clap]
version = "3"
features = ["derive"]
Expand All @@ -21,6 +27,13 @@ version = "1"
[dependencies.rayon]
version = "1"

[dependencies.reqwest]
version = "0.11"
features = ["json"]

[dev-dependencies.rusty-hook]
version = "0.11.2"

[dependencies.serde]
version = "1"
features = ["derive"]
Expand All @@ -36,5 +49,5 @@ features = ["full"]
[dependencies.warp]
version = "0.3"

[dev-dependencies.rusty-hook]
version = "0.11.2"
[dependencies.yup-oauth2]
version = "7"
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# STAGE 1
FROM rust:alpine3.15 AS builder

# Install dependencies
RUN apk add musl-dev --no-cache

# Copy source code.
COPY src /src
COPY Cargo.toml Cargo.lock /

# Build rust binaries.
RUN cargo build --release --manifest-path /Cargo.toml

Expand Down
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ PORT?=8080
GROUP?=0
HELPER?=Ayudante
FROM?=${PORT}
PADRON?=106223
[email protected]
SPREADSHEET_ID?=1jWXRFLamVmuAyTpv-n6737ze-8sgoAv1ZzHdyFXn4Rg
HELPSHEET_ID?=145qVyafYthG1dfCjbz-VcoABRqTkyGszqWK03Ax0L8A
CALENDAR_ID?=oeqsr7o5ftae7dav642rism2a4%40group.calendar.google.com

run:
cargo run --release -- --port=${PORT}
cargo run --release -- --domain=${DOMAIN} --port=${PORT} --spreadsheet-id=${SPREADSHEET_ID} --helpsheet-id=${HELPSHEET_ID}

test:
cargo test
Expand All @@ -25,6 +30,15 @@ test_clear:
test_get_queue:
curl --location --request GET "${DOMAIN}:${PORT}/api/discord/v1/help_queue"

test_is_student:
curl --location --request GET "${DOMAIN}:${PORT}/api/discord/v1/is_student" -H "Content-Type: application/json" -d '{"id": ${PADRON}, "email": "${EMAIL}"}'

test_get_group:
curl --location --request GET "${DOMAIN}:${PORT}/api/discord/v1/group" -H "Content-Type: application/json" -d '{"id": ${PADRON}, "email": "${EMAIL}"}'

test_get_next_class:
curl --location --request GET "${DOMAIN}:${PORT}/api/discord/v1/next_class"

build_docker:
docker build -t algo3_backend .

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Todas las directivas de arriba tienen como opciones opcionales `DOMAIN` y `PORT`
- `test_get_next` admite opcionalmente la opción `HELPER` para indicar el ayudante que brinda la ayuda. Por defecto es `Ayudante`.
- `test_dismiss_help` admite opcionalmente la opción `GROUP` para indicar el grupo que desestima la ayuda. Por defecto es `0`.

El loggeo de ayudas pueden verlo en [esta spreadsheet](https://docs.google.com/spreadsheets/d/145qVyafYthG1dfCjbz-VcoABRqTkyGszqWK03Ax0L8A/edit#gid=0) (acordate de borrar el log).
## Para correr los tests

Para correr la suite de tests corré el siguiente comando en consola:
Expand Down
Loading