Skip to content
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

Merge final a produccion #65

Merged
merged 298 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
298 commits
Select commit Hold shift + click to select a range
a29310f
Se arreglan mas condiciones para validar que una carta pueda ser desc…
ignabelitzky Oct 15, 2023
663a7f8
Tests CRUD cards finalizado y cambio en validacion
ezeluduena Oct 15, 2023
db6241a
Agregados test para la creación de mazos y reparto
ezeluduena Oct 15, 2023
972dc05
Se borró código repetido en los tests
ezeluduena Oct 15, 2023
0823d36
Merge pull request #29 from TukiLaCosa:feature/LC-134/endpoint-descarte
ezeluduena Oct 15, 2023
1f68989
Merge branch 'develop' of github.com:TukiLaCosa/backend into feature/…
ezeluduena Oct 15, 2023
a33b6d6
saqué comentarios
ezeluduena Oct 15, 2023
b7eafdc
Merge pull request #30 from TukiLaCosa/feature/LC-109/Deuda-tests-CRU…
ezeluduena Oct 15, 2023
533a5f9
Se agrega endpoint para obtener los ids de las cartas de un jugador
ignabelitzky Oct 16, 2023
d235a7c
Se agrega mas informacion a la mano del jugador
anelioalvarez Oct 17, 2023
999a218
Se agrega el subtipo a la tabla de cartas (CONTAGION, ACTION, DEFENSE…
ignabelitzky Oct 17, 2023
38508d8
Primer intento de implementacion para jugar cartas de accion, solo la…
ignabelitzky Oct 17, 2023
b6f8317
Implementado el envio por websocket del evento played_card cuando un …
ignabelitzky Oct 17, 2023
90906b8
Cambios en test_create_cards
ezeluduena Oct 17, 2023
fa67343
Merge pull request #31 from TukiLaCosa/feature/LC-150/endpoint-obtene…
ignabelitzky Oct 17, 2023
4411d8b
endpoint robar carta, se rompe cuando no hay mazo
ezeluduena Oct 17, 2023
7dec7d9
Se hace implementacon parcial cartas de: Analisis, Sospecha, Vigila t…
ignabelitzky Oct 18, 2023
602bb68
Modificacion menor
ignabelitzky Oct 18, 2023
4deed5b
Se comenta un poco el codigo para entender que hace el endpoint de ju…
ignabelitzky Oct 18, 2023
3f0b6f5
Modificacion menor
ignabelitzky Oct 18, 2023
dbb1649
Se mejora implementacion del endpoint
ignabelitzky Oct 18, 2023
4dfae85
se agregan 2 casos para verificar la finalizacion
anelioalvarez Oct 18, 2023
2d946ff
resolucion conflictos con develop
anelioalvarez Oct 18, 2023
c06a9c8
Merge pull request #32 from TukiLaCosa/feature/LC-77/Finalizacion-par…
ignabelitzky Oct 18, 2023
e7057a4
Cambios menores
ignabelitzky Oct 18, 2023
70b05ad
Se mergeo develop a esta rama.
ignabelitzky Oct 18, 2023
ee753be
Merge pull request #33 from TukiLaCosa/feature/LC-71/endpoint-play-ac…
ignabelitzky Oct 18, 2023
e20ed59
Se refactoriza codigo para el endpoint de jugar cartas de accion
ignabelitzky Oct 18, 2023
3a5293a
Se arregla problema que habia al querer eliminar carta de lanzallamas
ignabelitzky Oct 18, 2023
3fe8a95
Cambios menores
ignabelitzky Oct 18, 2023
1e17f9b
Se implemento que se mande los eventos cuando un jugador es eliminado…
ignabelitzky Oct 19, 2023
e23b224
Merge pull request #34 from TukiLaCosa/feature/LC-71/endpoint-play-ac…
anelioalvarez Oct 19, 2023
877d5bf
cambios finales
ezeluduena Oct 19, 2023
308cbc4
Merge branch 'develop' of github.com:TukiLaCosa/backend into feature/…
ezeluduena Oct 19, 2023
6d72528
hotfix
ezeluduena Oct 19, 2023
8b794bb
Merge pull request #35 from TukiLaCosa:feature/LC-70/take-card
ezeluduena Oct 19, 2023
28b43a9
Se agrega seed para crear 6 jugadores, y una partida con los 6 unidos
ignabelitzky Oct 19, 2023
a9fc5af
Se modifica al iniciar partida y se agrega un atributo mas con el ord…
ignabelitzky Oct 19, 2023
9671a6e
Funcionando el robo de cartas
ignabelitzky Oct 19, 2023
093e6bd
Se implemento el evento de NEW_TURN cuando se descarta o juega una ca…
ignabelitzky Oct 19, 2023
4f54cdb
Cambio menor en la funcion de la semilla de los datos
ignabelitzky Oct 19, 2023
b7454b3
Se soluciono bug que estaba pendiente cuando se rearma el mazo de robo
ignabelitzky Oct 20, 2023
a654ac1
Merge pull request #37 from TukiLaCosa/feature/LC-158/Seed-creacion-j…
ignabelitzky Oct 20, 2023
def534a
se envia por ws el evento game_ended
anelioalvarez Oct 20, 2023
a115f8d
se agregaga endpoint para obtener los resultados de una partida final…
anelioalvarez Oct 20, 2023
b20864c
Merge pull request #38 from TukiLaCosa/feature/LC-157/Mejora-finaliza…
ignabelitzky Oct 20, 2023
317f2be
Merge pull request #39 from TukiLaCosa/feature/LC-159/Obtener-resulta…
ignabelitzky Oct 20, 2023
857e3aa
Se arreglo problema en test de delete
ignabelitzky Oct 20, 2023
3371456
Actualizacion temp
ignabelitzky Oct 20, 2023
b2ec743
Se agregan 2 endpoints para el intercambio de cartas
ignabelitzky Oct 20, 2023
e443ae1
se agrega caso especial de finalizacion de partida y se mejora la logica
anelioalvarez Oct 20, 2023
5629df2
Se agregan verificaciones en los endpoints para el intercambio de cartas
ignabelitzky Oct 21, 2023
c55c9ba
se agrega endpoint para hardcodear eventos y enviarlos a los jugadore…
anelioalvarez Oct 21, 2023
69de2a0
se remueve verificacion al endpoint de game_result
anelioalvarez Oct 21, 2023
afedb74
Se corrige con sugerencia de Eze enviada por el comment de la PR
ignabelitzky Oct 21, 2023
977f31e
Se modifo con mas cambios para verificacion de que ocurre cuando se i…
ignabelitzky Oct 21, 2023
da68828
Se agrega que mande el evento que se descarto una carta a todos los j…
ignabelitzky Oct 21, 2023
baad53d
modificacion finish game
anelioalvarez Oct 21, 2023
dbca9ad
correccion en verificacion de finalizacion de partida
anelioalvarez Oct 21, 2023
0f12292
arreglos en finish_game
anelioalvarez Oct 21, 2023
67a3826
Merge pull request #41 from TukiLaCosa/feature/LC-159/Obtener-resulta…
anelioalvarez Oct 21, 2023
98141c8
Merge branch 'develop' into feature/LC-135/endpoint-intercambio-de-carta
ignabelitzky Oct 21, 2023
a6d1583
Esqueleto para la implementacion del endpoint de jugar cartas de panico
ignabelitzky Oct 22, 2023
b19cd08
Se modifico la tabla de jugadores para agregar el atributo isQuarenti…
ignabelitzky Oct 23, 2023
f537083
Se agrega logica para cuando se juega la carta 'Vuelta y vuelta'
ignabelitzky Oct 23, 2023
6045419
Se hace un cambio menor, donde se reemplaza codigo repetido por llama…
ignabelitzky Oct 23, 2023
a035047
Se modifico el evento de discard card para que envie el tipo de carta…
ignabelitzky Oct 23, 2023
a2073f4
Merge branch 'develop' of github.com:TukiLaCosa/backend into hardcode…
anelioalvarez Oct 23, 2023
c97e84b
se remueve los comentarios de la verificacion status!=ENDED
anelioalvarez Oct 23, 2023
2552499
Merge pull request #40 from TukiLaCosa/feature/LC-135/endpoint-interc…
ignabelitzky Oct 23, 2023
fa2b7c2
Merge pull request #42 from TukiLaCosa/hardcoded-eventes
ignabelitzky Oct 23, 2023
ca91117
Intento de fix provisorio
ignabelitzky Oct 23, 2023
b786afb
Cambio en PLAYE_CARD y PLAYER_ELIMINATED
ezeluduena Oct 24, 2023
e20b50b
cambio de orden
ezeluduena Oct 24, 2023
0b32560
hotfix ws
ezeluduena Oct 24, 2023
eb7c715
Merge pull request #43 from TukiLaCosa:temp
ezeluduena Oct 24, 2023
cdf1b58
Refactorizacion de codigo
ignabelitzky Oct 24, 2023
a786675
Merge temp to this branch
ignabelitzky Oct 24, 2023
96b0928
Se modifica codigo que estaba puesto cuando se jugaba una carta de an…
ignabelitzky Oct 24, 2023
13b73fc
Cambio menor
ignabelitzky Oct 24, 2023
eef5ac4
Merge pull request #45 from TukiLaCosa/temp
anelioalvarez Oct 25, 2023
e585639
Se agrega funcionalidad para la carta Revelaciones
ignabelitzky Oct 26, 2023
58eb81d
Se hace que se mande el evento de nuevo turno despues del evento de j…
ignabelitzky Oct 26, 2023
ca420aa
Codigo con 2 new_turn al jugar carta lanzallamas
ignabelitzky Oct 26, 2023
ab77a2b
Se agrega sleep de 4 segs
ignabelitzky Oct 26, 2023
5b6c3e2
Solo se manda un evento de new_turn al jugar la carta lanzallamas
ignabelitzky Oct 26, 2023
40f6280
Primera version del cheat lanzallamas
ignabelitzky Oct 26, 2023
d902250
Merge temp into this branch
ignabelitzky Oct 27, 2023
e5ba3e5
Se habilita para que el evento de nuevo turno se mande en la etapa de…
ignabelitzky Oct 27, 2023
1ec6b9c
Se mejora el cheat para el lanzallamas, ahora busca en mazo de robo c…
ignabelitzky Oct 27, 2023
987c2f8
Se agrega cheat para obtener carta whiskey
ignabelitzky Oct 27, 2023
4f41b34
Implementacion de la carta Cita a Ciegas hecha
ignabelitzky Oct 27, 2023
6ffad4c
Se agrega una ayuda de Loki para cuando queres saber que cheats tenes…
ignabelitzky Oct 27, 2023
27467af
Se quita evento new_turn del discard
ignabelitzky Oct 27, 2023
fc7808f
Se quita que pase a nuevo turno despues de jugar carta de accion o de…
ignabelitzky Oct 27, 2023
211161b
Cambio menor
ignabelitzky Oct 27, 2023
bc83bbe
se agrega dockerfile para el proyecto
anelioalvarez Oct 27, 2023
cbe8081
Se agrega la funcionalidad para la carta ooops
ignabelitzky Oct 27, 2023
fdcaaf2
Refactorizacion del codigo para usar los cheats
ignabelitzky Oct 27, 2023
a8f355e
Merge pull request #46 from TukiLaCosa/temp
ignabelitzky Oct 27, 2023
be87fd4
Merge pull request #47 from TukiLaCosa/feature/LC-236/cheats
ignabelitzky Oct 27, 2023
73cf70b
Merge branch 'develop' into feature/LC-154/endpoint-play-panic-card
ignabelitzky Oct 28, 2023
8b84d25
Se agrega imagen y sonido al iniciar el back
ignabelitzky Oct 28, 2023
89c7a9f
Se implemento la logica para la carta determinacion (resolute)
ignabelitzky Oct 28, 2023
1a85112
Implementacion de la carta olvidadizo y cheat para obtener esa carta …
ignabelitzky Oct 28, 2023
96c4c13
Cambio menor en el nombre de una funcion para que sea mas descriptiva
ignabelitzky Oct 28, 2023
73da466
Implementacion de la carta uno dos
ignabelitzky Oct 28, 2023
26fd8e2
Hotfix para la carta seducción
ignabelitzky Oct 28, 2023
952099d
Merge pull request #49 from TukiLaCosa/feature/LC-244/fix-seduction-card
ignabelitzky Oct 28, 2023
95a9e9d
Hotfix por un error con los cheats
ignabelitzky Oct 28, 2023
fd430bc
Merge de develop hacia esta rama
ignabelitzky Oct 28, 2023
eb4b19d
Merge branch 'develop' into feature/LC-237/resolute-card-implementation
ignabelitzky Oct 28, 2023
282d37d
se agrega docker-compose
anelioalvarez Oct 29, 2023
337b6c0
Se agrega ID del jugador que jugo lanzallamas en el evento player_eli…
ignabelitzky Oct 30, 2023
20a6ee4
Se agrega posibilidad de defenderse ante la carta seduccion
ignabelitzky Oct 30, 2023
17d34a4
Se pone sleep en funcion whisky
ignabelitzky Oct 30, 2023
3eb86b1
Se manda despues el evento de new_turn al jugar la carta whiskey
ignabelitzky Oct 30, 2023
2c3b8d1
modificacion menor en un import
ignabelitzky Oct 30, 2023
1fdb364
Merge pull request #50 from TukiLaCosa/temp
ignabelitzky Oct 30, 2023
32c59ae
Se agrega id y name en el evento PLAYER_ELIMINATED
ezeluduena Oct 31, 2023
aead93a
se agrega tabla intention y logica para carta de defensa
anelioalvarez Oct 31, 2023
1ed928e
reemplazo de la ejecucion del efecto a la creacion de la intencion
anelioalvarez Oct 31, 2023
d499fcd
Tests de spring pasado para el modulo players
ezeluduena Nov 3, 2023
ec830a9
100% coverage report alcanzado
ezeluduena Nov 3, 2023
294d66f
minifix
ezeluduena Nov 3, 2023
b0c20ac
agrego relacion Intention - Game
anelioalvarez Nov 3, 2023
34eaf6a
Merge pull request #51 from TukiLaCosa/deuda/LC-163/players-module
ezeluduena Nov 4, 2023
e4c7642
generar intencion de intercambio de cartas
anelioalvarez Nov 4, 2023
d281f57
deuda de tests y hotfix en evento seduction
ezeluduena Nov 4, 2023
f3a2968
Merge branch 'hotfix_para_el_front' of github.com:TukiLaCosa/backend …
ezeluduena Nov 4, 2023
b203c3b
Actualización de campos de evento
ezeluduena Nov 4, 2023
fab9776
renombre funcion
anelioalvarez Nov 5, 2023
7a97f74
endpoint para jugar carta de defensa
anelioalvarez Nov 5, 2023
5643a53
fix tremendo xd
anelioalvarez Nov 5, 2023
8065add
al jugar la carta de defensa se roba hasta tener una Alejate
anelioalvarez Nov 5, 2023
317f832
al finalizar el intercambio de cartas de borra la intencion
anelioalvarez Nov 6, 2023
ef4e578
agrego checkeo de intencion antes de intercambiar cartas
anelioalvarez Nov 6, 2023
5dffb77
merge con develop y correciones de envio de eventos
anelioalvarez Nov 6, 2023
23abc49
se comenta el borrado de la intencion en interchange_response
anelioalvarez Nov 6, 2023
1956c4f
Merge pull request #53 from TukiLaCosa/feature/LC-152/Jugar-carta-de-…
anelioalvarez Nov 6, 2023
6fe980f
Merge branch 'develop' of github.com:TukiLaCosa/backend into deuda-te…
ezeluduena Nov 6, 2023
713401b
Merge pull request #52 from TukiLaCosa/deuda-tecnica/LC-187/module-cards
anelioalvarez Nov 6, 2023
114c345
Merge con develop
ignabelitzky Nov 6, 2023
f3bf1a5
Se quita codigo que no sirve de la carta seduccion con respecto al in…
ignabelitzky Nov 6, 2023
8dafe9b
Nuevo turno ahora se hace en la etapa del intercambio y se elimino co…
ignabelitzky Nov 6, 2023
5fd2600
Merge de develop a esta rama
ignabelitzky Nov 6, 2023
3672dae
Merge branch 'develop' into feature/LC-237/resolute-card-implementation
ignabelitzky Nov 6, 2023
3d88c1a
Merge pull request #48 from TukiLaCosa/feature/LC-237/resolute-card-i…
ignabelitzky Nov 6, 2023
e5db3fd
Se actualiza la branch haciendo merge con develop
ignabelitzky Nov 6, 2023
d238153
Formato con autopep8
ignabelitzky Nov 6, 2023
bcb0ef2
Merge pull request #54 from TukiLaCosa/feature/LC-154/endpoint-play-p…
ignabelitzky Nov 6, 2023
f4715bd
Hotfix - Se agrega player_id en el evento de discard_card por pedido …
ignabelitzky Nov 6, 2023
57e06bb
Hotfix - Se manda nombre de la carta en evento de played_card, y se a…
ignabelitzky Nov 7, 2023
7701ea1
fix schema play_defense_card
anelioalvarez Nov 7, 2023
d10c064
Se agregan tests para el modulo de games, se modifica el archivo .cov…
ignabelitzky Nov 7, 2023
c758be9
Se agregaron tests para el modulo games, y se corrigieron bugs menore…
ignabelitzky Nov 7, 2023
833359f
Merge pull request #55 from TukiLaCosa/feature/LC-186/Tests-modulo-games
ignabelitzky Nov 7, 2023
2dbfac3
Se agregan test y se omiten archivos para el coverage
ignabelitzky Nov 7, 2023
5edb1d4
Merge pull request #56 from TukiLaCosa/feature/LC-186/tests-modulo-games
ignabelitzky Nov 7, 2023
3d8732a
Finalizado de partida actualizado para que la cosa declare la victoria
ezeluduena Nov 7, 2023
f522477
Merge branch 'develop' of github.com:TukiLaCosa/backend into feature…
ezeluduena Nov 7, 2023
e179512
hotfix
ezeluduena Nov 7, 2023
e2615ba
Hotfix - Se mandan los nombres de los jugadores que interacturan en e…
ignabelitzky Nov 7, 2023
fc54386
Hotfix - Se agrega player_id en el evento played_card por pedido del …
ignabelitzky Nov 7, 2023
5dac89a
Hotfix - Se agrega await en las funciones send_played_card_event + ch…
ignabelitzky Nov 7, 2023
2a7f7c4
actualización sobre los eventos.
ezeluduena Nov 7, 2023
8b0fa1d
autopep8
ezeluduena Nov 7, 2023
e3cf59c
fix: al jugar carta defensa no se agregaba al mazo de descarte
anelioalvarez Nov 8, 2023
2f7e23f
Merge branch 'develop' of github.com:TukiLaCosa/backend into dockeriz…
anelioalvarez Nov 8, 2023
dc6cb37
github action para correr los test siempre que se haga push
anelioalvarez Nov 8, 2023
3650acb
correccion en step de instalacion dependencias
anelioalvarez Nov 8, 2023
97decbc
se fuerza la falla de un test para corroborar el action
anelioalvarez Nov 8, 2023
cab9b3b
se fuerza la falla de un test para corroborar el action
anelioalvarez Nov 8, 2023
23b5d77
agrego step para testear modulo Game
anelioalvarez Nov 8, 2023
399375b
correccion en las variables de entorno
anelioalvarez Nov 8, 2023
2220530
Update testing-ci.yaml
anelioalvarez Nov 8, 2023
217a9b4
Update testing-ci.yaml
anelioalvarez Nov 8, 2023
17055fc
Update testing-ci.yaml
anelioalvarez Nov 8, 2023
78df92c
update pipeline
anelioalvarez Nov 8, 2023
490857e
Update testing-ci.yaml
anelioalvarez Nov 8, 2023
bbbdba1
Update testing-ci.yaml
anelioalvarez Nov 8, 2023
cf04be7
Update testing-ci.yaml
anelioalvarez Nov 8, 2023
2dfeb94
se agregan los demas steps para testear modulo player y card
anelioalvarez Nov 8, 2023
dcadcd1
se cachean las dependencias de poetry
anelioalvarez Nov 8, 2023
fbacbc4
instrucciones en el readme para correr la app en contenedores usando …
anelioalvarez Nov 8, 2023
fb68356
falla de test a proposito
anelioalvarez Nov 8, 2023
2c5eeb4
correction de test a proposito
anelioalvarez Nov 8, 2023
7e0a0de
Merge pull request #58 from TukiLaCosa/dockerize-app
anelioalvarez Nov 8, 2023
fbfe143
se comentó pygame para evitar warnings en test
ezeluduena Nov 8, 2023
acbb683
Merge pull request #57 from TukiLaCosa:feature/LC-213/new-finalizar-p…
ezeluduena Nov 8, 2023
86f4e17
Último infectado pierde al finalizar partida
ezeluduena Nov 8, 2023
ebce152
agregado el cambio de rol al intercambiar carta infectado
ezeluduena Nov 8, 2023
db4c951
hotfix
ezeluduena Nov 8, 2023
6ba453b
Update README.md
anelioalvarez Nov 8, 2023
4101222
correccion en el json_msg al jugar la carta de defensa
anelioalvarez Nov 9, 2023
82e346b
Hotfix - Se agrega cheat para la carta análisis
ignabelitzky Nov 9, 2023
2d9a398
Hotfix - Se arregla error menor en range de carta analisis para el cheat
ignabelitzky Nov 9, 2023
123f117
hotfix: verificacion al jugar defensa siempre falso por comparar obje…
anelioalvarez Nov 9, 2023
e4c6040
hotfix
ezeluduena Nov 10, 2023
5e9cfc8
se agrega nombre del player objetivo del analisis
ezeluduena Nov 10, 2023
a90166d
Hotfix - Se agrega cheat para nada de barbacoas
ignabelitzky Nov 10, 2023
ae5034b
Merge pull request #59 from TukiLaCosa/hotfix_analisis_card
anelioalvarez Nov 10, 2023
0bc005c
defense card ya no envia nombres
ishiaraen Nov 10, 2023
fbf133f
hotfix: finalizar partida puesta como asincrona innecesario no actual…
anelioalvarez Nov 10, 2023
fa7b086
se envian los eventos que restaban al procesar la intencion
anelioalvarez Nov 10, 2023
6856ac9
se quita rol que rompe los tests xd
anelioalvarez Nov 10, 2023
c71ac7b
Se actualiza el turno luego del cambio de lugar
ezeluduena Nov 11, 2023
7956e28
Arreglo de envio de mensajes al jugar seducción
ezeluduena Nov 11, 2023
0ac8b2f
cambio en envio de mensajes
ezeluduena Nov 11, 2023
6d08247
fix
ezeluduena Nov 11, 2023
930f16c
fix: cambio de turno lanzallamas
ezeluduena Nov 11, 2023
0e00476
fix: reacomodo de turno
ezeluduena Nov 11, 2023
9ca81e6
nuevo mensaje ws y sleep para no pisar eventos
ezeluduena Nov 11, 2023
e4d4dc4
refactorizacion intercambio de cartas con defensa
anelioalvarez Nov 11, 2023
fe0aa5c
ya ni se
anelioalvarez Nov 11, 2023
b3925e1
ahora anda to
ezeluduena Nov 12, 2023
631cf68
Merge con develop
ezeluduena Nov 12, 2023
1193426
hotfix
ezeluduena Nov 12, 2023
d2a90dc
hotfix en serio
ezeluduena Nov 12, 2023
3d0bedb
Merge pull request #60 from TukiLaCosa/feature/infect-players
ezeluduena Nov 12, 2023
c9dde31
correccion en card-interchange-response
anelioalvarez Nov 12, 2023
46089d1
Merge branch 'develop' of github.com:TukiLaCosa/backend into hotfix-c…
ezeluduena Nov 12, 2023
3d869db
Merge pull request #61 from TukiLaCosa/hotfix-change-places
ezeluduena Nov 12, 2023
4cb205d
Merge branch 'develop' of github.com:TukiLaCosa/backend into hotfix-s…
ezeluduena Nov 12, 2023
2780855
cambios en games, games/schemas, y /games/utils
ishiaraen Nov 12, 2023
54908f2
modificado schemas
ishiaraen Nov 12, 2023
3035873
hotfix
ezeluduena Nov 12, 2023
83f3db2
Merge branch 'develop' of github.com:TukiLaCosa/backend into intercam…
ezeluduena Nov 12, 2023
2457970
nuevo turno
ishiaraen Nov 12, 2023
5218033
cambios para la defensa con Aterrador
ishiaraen Nov 13, 2023
44278ce
autopep8 y borrar comentarios
ezeluduena Nov 13, 2023
5f0279f
Merge pull request #62 from TukiLaCosa/intercambio-con-intencion
ezeluduena Nov 13, 2023
375847d
Merge pull request #63 from TukiLaCosa/hotfix-sospecha
ezeluduena Nov 13, 2023
e6fcd5f
arreglo intercambio y fin de partida
ezeluduena Nov 13, 2023
fafc2fb
fix mensaje fin de partida
ezeluduena Nov 13, 2023
b03e2ba
finalización de partida auto y cambio en intention
ezeluduena Nov 13, 2023
fa94fed
cambio en el lanzallamas
ezeluduena Nov 13, 2023
4afca19
Evento análisis card
ezeluduena Nov 13, 2023
ede461e
fix
ezeluduena Nov 13, 2023
fb9f3b6
agrego ", " a la lista
ezeluduena Nov 13, 2023
67bc074
fix triste
ezeluduena Nov 13, 2023
073c25b
otro fix enorme
ezeluduena Nov 13, 2023
90f680a
fix eliminar partida
ezeluduena Nov 13, 2023
817b3e0
nuevo evento cuando se infecta
ezeluduena Nov 13, 2023
518ed2c
validación en el discard
ezeluduena Nov 13, 2023
221c281
tests hotfix: se corrige el mock de FakeGame agregando atributo inten…
anelioalvarez Nov 13, 2023
d97e9f6
Merge pull request #64 from TukiLaCosa:hotfix-intercambios
ezeluduena Nov 13, 2023
4912ead
cambio en el envio de mensaje infectado
ezeluduena Nov 13, 2023
dd24d32
sleeps
ishiaraen Nov 14, 2023
86e907f
chau sleep
ezeluduena Nov 14, 2023
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
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ omit =
app/routers/games/__init__.py
app/routers/players/__init__.py
app/tests/*
app/routers/websockets/*
app/utils.py
app/database/utils.py
app/database/initialize_data.py
app/routers/games/intention.py

[html]
directory = htmlcov
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Byte-compiled / optimized / DLL files
__pycache__
*.pyc
*.pyo
*.pyd

# Tests directory
./app/tests/

# Database file
./app/database/*.sqlite
38 changes: 38 additions & 0 deletions .github/workflows/testing-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tuki Testing CI
on: [push]

jobs:
test:
runs-on: ubuntu-latest

env:
ENVIRONMENT: test
TEST_DIRECTORY: ${{ github.workspace }}/app/tests
TEST_DB_FILE: ${{ github.workspace }}/app/database/database_test.sqlite

steps:
- uses: actions/checkout@v3

- name: Install and caching poetry dependencies
run: pipx install poetry

- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- run: poetry install

- name: Test Game module
run: |
poetry run coverage run -m pytest $TEST_DIRECTORY/game_tests
rm -f $TEST_DB_FILE

- name: Test Player module
run: |
poetry run coverage run -m pytest $TEST_DIRECTORY/player_tests
rm -f $TEST_DB_FILE

- name: Test Card module
run: |
poetry run coverage run -m pytest $TEST_DIRECTORY/card_tests
rm -f $TEST_DB_FILE
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.10-slim as requirements-stage

WORKDIR /tmp

RUN pip install poetry

COPY ./pyproject.toml ./poetry.lock* ./

RUN poetry export -f requirements.txt --output requirements.txt --without-hashes

FROM python:3.10-slim

WORKDIR /code

COPY --from=requirements-stage /tmp/requirements.txt ./requirements.txt

RUN pip install --no-cache-dir --upgrade -r ./requirements.txt

COPY ./app ./app

EXPOSE 8000

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
34 changes: 27 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,33 @@ COV_GAMES_FILE = .coverage.games
COV_CARDS_FILE = .coverage.cards

# Define the UVicorn command
UVICORN_CMD = uvicorn $(MAIN_FILE):$(APP_NAME) --port $(PORT) --reload

.PHONY: run delete-db coverage-report coverage-clean test-all test-players test-games
UVICORN_CMD = uvicorn $(MAIN_FILE):$(APP_NAME) --port $(PORT) --reload --ws websockets

.PHONY: run delete-db coverage-report coverage-clean test-all test-players test-games help

# Define the 'help' target to display Makefile usage information
help:
@echo "Usage: make [target]"
@echo "Targets:"
@echo " run - Run the UVicorn server"
@echo " create-seed-data - Seed to plant 6 players and 1 Game in the Database"
@echo " delete-db - Delete the database file"
@echo " coverage-report - Generate coverage reports"
@echo " coverage-clean - Remove coverage reports"
@echo " test-all - Run all tests sequentially"
@echo " test-players - Run player tests"
@echo " test-games - Run game tests"
@echo " test-cards - Run card tests"
@echo " autopep8 - Run autopep8 to format code"
@echo " install - Install dependencies and create virtual environment"

# Define the 'run' target to run the UVicorn server within the virtual environment
run: install
poetry run $(UVICORN_CMD)

create-seed-data: install
poetry run python -c "from app.database.utils import create_seed_data; create_seed_data()"

# Define the 'delete-db' target to delete the database file
delete-db:
@if [ -f $(DB_FILE) ]; then \
Expand All @@ -50,19 +69,19 @@ TEST_DIRECTORY = ./app/tests

# Define the 'test-games' target to run game tests in the test environment
test-games: install
ENVIRONMENT=test poetry run coverage run --data-file=$(COV_GAMES_FILE) -m pytest -vv $(TEST_DIRECTORY)/game_tests; true
ENVIRONMENT=test poetry run coverage run --data-file=$(COV_GAMES_FILE) -m pytest --tb=no -vv $(TEST_DIRECTORY)/game_tests; true
rm -f $(TEST_DB_FILE)
unset ENVIRONMENT

# Define the 'test-players' target to run player tests in the test environment
test-players: install
ENVIRONMENT=test poetry run coverage run --data-file=$(COV_PLAYERS_FILE) -m pytest -vv $(TEST_DIRECTORY)/player_tests; true
ENVIRONMENT=test poetry run coverage run --data-file=$(COV_PLAYERS_FILE) -m pytest --tb=no -vv $(TEST_DIRECTORY)/player_tests; true
rm -f $(TEST_DB_FILE)
unset ENVIRONMENT

# Define the 'test-cards' target to run cards tests in the test environment
test-cards: install
ENVIRONMENT=test poetry run coverage run --data-file=$(COV_CARDS_FILE) -m pytest -vv $(TEST_DIRECTORY)/card_tests; true
ENVIRONMENT=test poetry run coverage run --data-file=$(COV_CARDS_FILE) -m pytest --tb=no -vv $(TEST_DIRECTORY)/card_tests; true
rm -f $(TEST_DB_FILE)
unset ENVIRONMENT

Expand Down Expand Up @@ -90,7 +109,8 @@ coverage-clean:

# Define the 'autopep8' target for running autopep8
autopep8:
poetry run autopep8 --in-place --recursive .
@echo "Standarizing all files to pep8..."
@poetry run autopep8 --in-place --recursive .

# Define the 'install' target to install dependencies and create the virtual environment
install: pyproject.toml
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ In the Makefile, you have the following targets:

`make run` starts the Uvicorn server with the application. If it's not defined in the .env file, de default port is 8000.

`make create-seed-data` Populates the database with 6 players and 1 game.

`make delete-db` deletes the application's database file if it exists. It will request confirmation before deletion.

`make test-all` runs the application's tests using pytest and tracks code coverage.
Expand All @@ -56,3 +58,15 @@ In the Makefile, you have the following targets:

**Remember to create a .env file with the necessary environment variables before using the Makefile**
**To know the necessary environment variables you can see the `.env.example` file.**


## Running the Application in Containers - Docker

### Building the Docker Image
`docker build -t backend-tuki .`

### Run a container based on the built image
`docker run --name backend-tuki-container -p 8000:8000 backend-tuki`

## Running the Application in Containers - Docker Compose
`docker-compose up --build`
1 change: 1 addition & 0 deletions app/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class Settings(BaseSettings):
environment: Literal["test", "production", "development"] = "development"
CORS_origins: List[str] = ["*"]
CARDS_CSV_FILE_PTAH: str = "app/resources/cartas.csv"

model_config = SettingsConfigDict(env_file=".env", extra='allow')

Expand Down
10 changes: 5 additions & 5 deletions app/database/initialize_data.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from pony.orm import db_session
from .models import Card
import csv
from app.config.config import settings


@db_session
def populate_card_table():
if Card.select().count() > 0:
print("Los datos de cartas ya estan en la base de datos. No se realizará la inicialización")
return
cartas = 'app/resources/cartas.csv'
with open(cartas, newline='') as csvfile:

with open(settings.CARDS_CSV_FILE_PTAH, newline='') as csvfile:
csvreader = csv.reader(csvfile, delimiter=';')
for row in csvreader:
number, card_type, name, description = row
Card(number=number, type=card_type,
number, card_type, card_subtype, name, description = row
Card(number=number, type=card_type, subtype=card_subtype,
name=name, description=description)
20 changes: 19 additions & 1 deletion app/database/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pony.orm import PrimaryKey, Required, Set, Optional
from pony.orm import PrimaryKey, Required, Set, Optional, Json
from app.database import db
from app.routers.games.schemas import GameStatus, RoundDirection

Expand All @@ -9,8 +9,13 @@ class Player(db.Entity):
game_hosting = Optional('Game', reverse='host', cascade_delete=True)
name = Required(str)
rol = Optional(str, nullable=True)
isQuarentined = Optional(bool, default=False)
position = Required(int, default="-1")
hand = Set('Card')
intention_creator = Optional('Intention', reverse='player')
intention_objective = Optional('Intention', reverse='objective_player')
game_last_infected = Optional(
'Game', reverse='last_infected', nullable=True)


class Game(db.Entity):
Expand All @@ -24,15 +29,28 @@ class Game(db.Entity):
status = Required(str, default=GameStatus.UNSTARTED)
discard_deck = Set('Card', reverse='games_discard_deck')
draw_deck = Set('Card', reverse='games_draw_deck')
draw_deck_order = Required(Json, default=[])
round_direction = Required(str, default=RoundDirection.CLOCKWISE)
intention = Optional('Intention', reverse='game')
last_infected = Optional(
Player, reverse='game_last_infected', nullable=True)


class Card(db.Entity):
id = PrimaryKey(int, auto=True)
number = Required(int)
type = Required(str)
subtype = Required(str)
name = Required(str)
description = Required(str)
games_discard_deck = Set(Game, reverse='discard_deck')
games_draw_deck = Set(Game, reverse='draw_deck')
players_hand = Set(Player)


class Intention(db.Entity):
game = Required(Game)
player = Required(Player)
objective_player = Required(Player)
action_type = Required(str)
exchange_payload = Optional(Json, default={})
23 changes: 23 additions & 0 deletions app/database/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from pony.orm import db_session, commit
from .models import Player, Game


@db_session
def create_seed_data():
players = []
for i in range(1, 7):
player = Player(name=f"Player{i}")
players.append(player)
commit()

game = Game(name="TestGame",
min_players=4,
max_players=12,
password='secure',
host=players[0],
)
commit()
players[0].game = game.name
commit()
for i in range(1, 6):
game.players.add(players[i])
12 changes: 7 additions & 5 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
from app.routers.players import players
from app.routers.games import games
from app.routers.cards import cards
from pony.orm import *
from app.routers.websockets import websockets
# from .utils import show_initial_image
# import threading

app = FastAPI()

Expand All @@ -21,8 +23,8 @@
app.include_router(players.router)
app.include_router(games.router)
app.include_router(cards.router)
app.include_router(websockets.router)


@app.get("/")
async def root():
return {"message": "Hello World"}
# This displays the initial image with the sound
# t = threading.Thread(target=show_initial_image)
# t.start()
Loading