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

Solo game data export #921

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Solo game data export #921

merged 2 commits into from
Dec 6, 2023

Conversation

sgfost
Copy link
Contributor

@sgfost sgfost commented Dec 6, 2023

PR to triple-check since this involves some complicated data migration

exporting is relatively straightforward but there were 2 problems:

  • bug causing redundant solo_game_round records
  • need for additional game state data (initial points and initial system health for each round) that we ideally wouldn't rely on inferring with a fragile routine in the future

@alee
Copy link
Member

alee commented Dec 6, 2023

can you rebase and refactor this to use a dump solo subcommand instead? sorry I didn't see this up there while working on making the data analysis workflow less crappy

when a game ended mid-round by a hull breach (- system health) card, the
apply card command would keep running and create extra solo_game_round records
in the db since we have a 3s timeout before officially ending the game.
fixed by checking the system health before instead of just the game
status

* also adds missing m21 between game round and game

* migration included does a small amount of cleanup before forming the
relationships, more to follow
usage: `yarn cli dump solo [--start <YYYY-MM-DD>] [--end <YYYY-MM-DD>]`

now tracking initialSystemHealth and initialPoints values per solo game
round. instead of relying on being able to accurately infer this in the
future, a (large) migration computes these values for all existing rounds and
future games will simply keep track of them at runtime

* migration also does some further cleanup of existing rounds by deleting
  all extra duplicate records in order for the initial values inference to
  take place

resolves virtualcommons/planning#60
@sgfost
Copy link
Contributor Author

sgfost commented Dec 6, 2023

no issues running on prod data/staging env

@sgfost sgfost merged commit 10c2f64 into main Dec 6, 2023
6 checks passed
@alee alee deleted the solo-export branch January 31, 2024 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants