opensafely-core / opensafely-core/opencodelists

Consider handling `db.sqlite3` failure cases better in `build-dbs-for-local-development`

Open
#2,482 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
60
Forks
16
Avg merge
4d 12h
Merged PRs (30d)
17

Description

I was trying this out today and noticed:

  • it absolutely requires that a db.sqlite3 exists before running
    • you have to touch db.sqlite3 if it doesn't exist
    • if the command subsequently fails, you have to touch db.sqlite3 again, because the empty file you create then ends up as db.sqlite3.backup
  • if you do have an existing db.sqlite3.backup, it overwrites this without prompting
    • failing loudly if the backup exists already is one option
    • another option might be creating a file with a unique suffix to avoid overwriting the existing file

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the build-dbs-for-local-development entry point and reproduce the missing db.sqlite3 and existing db.sqlite3.backup cases described in the issue. Done means the command handles failures without requiring repeated manual file creation and does not silently overwrite an existing backup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.