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

[Issue #2976] Run analytics migrations like the API does them #2978

Merged
merged 9 commits into from
Nov 21, 2024

Conversation

coilysiren
Copy link
Collaborator

@coilysiren coilysiren commented Nov 21, 2024

Summary

Fixes #2976

Time to review: 5 mins

Changes proposed

  • Adds "db migrate" poetry command
  • Renames "db init" to "db migrate"
  • Removes init-etldb cronjob since we are now running that same logic on merge
  • Starts running migrations on merge (infra/analytics/app-config/outputs.tf activates this)

Testing

https://github.com/HHS/simpler-grants-gov/actions/runs/11960219381/job/33346703132#step:5:256

image

@coilysiren coilysiren marked this pull request as ready for review November 21, 2024 20:40
mdragon
mdragon previously approved these changes Nov 21, 2024
Copy link
Collaborator

@mdragon mdragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@@ -18,7 +18,7 @@
VERBOSE = False


def initialize_database() -> None:
def db_migrate() -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: please change this to migrate_database

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

84ec4d7

def initialize_database() -> None:
@etl_app.command(name="db_migrate")
@ecs_background_task("db_migrate")
def db_migrate() -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: please change this to migrate_database

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

84ec4d7

@coilysiren coilysiren merged commit fcf7b2f into main Nov 21, 2024
12 checks passed
@coilysiren coilysiren deleted the kai/analytics-migrations branch November 21, 2024 22:59
coilysiren added a commit that referenced this pull request Nov 22, 2024
## Summary

Fixes #2976

### Time to review: __0 mins__

## Context for reviewers

Followup to #2978
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.

Run database migrations for the analytics application automatically
3 participants