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

Don't deprovision within running Kolibri to create preseeded DBs #12184

Merged
merged 4 commits into from
May 21, 2024

Conversation

bjester
Copy link
Member

@bjester bjester commented May 17, 2024

Summary

Background

In order to speed up initial startup of Kolibri, we bundle pre-migrated SQLite databases within the WHL file. We use the deprovision management command to create these database files, although we executed it through a script that is 'running' Kolibri.

The issue

The prior approach created SQLite databases that retained data, such as Morango's Database ID model records, meaning it isn't randomly generated during startup as is desired.

What's changed

By running the management command directly, we instead produce databases that align with the intended result-- they do not have any data records but are pre-migrated. The existing process has turned into a bash script, which also verifies a few important database tables are empty.

References

https://learningequality.slack.com/archives/CB37UM23A/p1715957359298019

Reviewer guidance

  1. Run make preseeddb
  2. Check that kolibri/dist/home/db.sqlite3 does not have any records in morango_databaseidmodel

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@github-actions github-actions bot added DEV: backend Python, databases, networking, filesystem... SIZE: small labels May 17, 2024
@github-actions github-actions bot added the DEV: dev-ops Continuous integration & deployment label May 21, 2024
@bjester bjester marked this pull request as ready for review May 21, 2024 17:30
@bjester bjester added the TODO: needs review Waiting for review label May 21, 2024
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

Code looks good, all databases appear to be present and correct, and the query checks appear to be doing their job, as they agree with the contents of the manually inspected databases.

@rtibbles rtibbles merged commit a5ec048 into learningequality:release-v0.16.x May 21, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: backend Python, databases, networking, filesystem... DEV: dev-ops Continuous integration & deployment SIZE: small TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants