FAForever / faf-league-service

The league service of Forged Alliance Forever
GNU General Public License v3.0
0 stars 0 forks source link

Automated seasons #55

Closed BlackYps closed 1 year ago

BlackYps commented 1 year ago

This adds a migration that should be executed automatically to generate the new season before the old one ends. However, I don't know how to properly set up a task that repeatedly runs this migration. I guess flyway can help here? I looked into the db repo, but I couldn't figure out where flyway gets configured to handle the repeatable migrations there.

codecov[bot] commented 1 year ago

Codecov Report

Base: 95.73% // Head: 96.00% // Increases project coverage by +0.27% :tada:

Coverage data is based on head (085e2fa) compared to base (f253b9e). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #55 +/- ## =========================================== + Coverage 95.73% 96.00% +0.27% =========================================== Files 11 11 Lines 422 451 +29 =========================================== + Hits 404 433 +29 Misses 18 18 ``` | [Impacted Files](https://codecov.io/gh/FAForever/faf-league-service/pull/55?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FAForever) | Coverage Δ | | |---|---|---| | [service/db/models.py](https://codecov.io/gh/FAForever/faf-league-service/pull/55/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FAForever#diff-c2VydmljZS9kYi9tb2RlbHMucHk=) | `100.00% <ø> (ø)` | | | [service/config.py](https://codecov.io/gh/FAForever/faf-league-service/pull/55/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FAForever#diff-c2VydmljZS9jb25maWcucHk=) | `100.00% <100.00%> (ø)` | | | [service/season\_generator.py](https://codecov.io/gh/FAForever/faf-league-service/pull/55/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FAForever#diff-c2VydmljZS9zZWFzb25fZ2VuZXJhdG9yLnB5) | `100.00% <100.00%> (ø)` | | | [service/\_\_init\_\_.py](https://codecov.io/gh/FAForever/faf-league-service/pull/55/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FAForever#diff-c2VydmljZS9fX2luaXRfXy5weQ==) | | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FAForever). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FAForever)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

bukajsytlos commented 1 year ago

I don't think this is the right way. Flyway should be used for schema and static data. Cannot league service have some cron job that would execute upsertion logic?

BlackYps commented 1 year ago

cronjob would also be possible. There are many tools for automation and I don't have the knowledge to identify which one would be suitable. That's why I'm asking.

BlackYps commented 1 year ago

I just tested the cron job on my machine and everything works as expected!