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

Preseed all the databases #8468

Merged
merged 8 commits into from Sep 27, 2021

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented Sep 24, 2021

Summary

  • We started preseeding SQLite db files to improve first time startup
  • We then added a bunch of new DB files to improve write concurrency
  • This PR generalizes our preseeding logic to handle all defined additional SQLite databases
  • It also allows preseeding of 'new' databases that are added at version upgrades, rather than only on fresh installations

References

Follow up from #8442 and #8351

Reviewer guidance

Does everything run fine? Do new databases get copied in and migrations avoided?


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

@rtibbles rtibbles added the TODO: needs review Waiting for review label Sep 24, 2021
@rtibbles rtibbles added this to the 0.15.0 milestone Sep 24, 2021
)
confirm_or_exit(
"ARE YOU SURE? If you do this, there is no way to recover the user data on this device."
)
Copy link
Member

Choose a reason for hiding this comment

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

We had previously made the explicit choice not to make it that easy to deprovision without warnings, given how destructive it is.

If a one-liner is really needed, we've suggested yes yes|kolibri manage deprovision in the past. I guess that doesn't work on Windows, though.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see it's for the purposes of call_command, though -- I wonder about using a nonstandard name like --accept-data-loss or something to make it a bit harder to do accidentally.

I'm probably being paranoid. Except if there's anything we've learned from what users do.....

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I only added it because of the python invocation, happy to make it something ridiculous!

Copy link
Member

Choose a reason for hiding this comment

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

Throw some unicode for a few different languages in there and we should be good, then!

Copy link
Member

@jredrejo jredrejo left a comment

Choose a reason for hiding this comment

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

I've found a couple of problems with the current code.
Also, I haven't found any where where
make preseeddb is called, so I wonder what's the idea of this when used with the different installers (Debian, pex, Windows, etc.)

build_tools/preseed_home.py Outdated Show resolved Hide resolved
kolibri/utils/main.py Outdated Show resolved Hide resolved
Copy link
Member

@jredrejo jredrejo left a comment

Choose a reason for hiding this comment

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

Everything looks fine, made some tests and it all worked without any problem

@rtibbles rtibbles merged commit f37c16e into learningequality:develop Sep 27, 2021
@rtibbles rtibbles deleted the preseed_all_the_dbs branch September 27, 2021 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants