openwisp / openwisp/openwisp-utils

[qa] Simplify migration checks

Open
#111 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Hacktoberfest
Dominant language
Python
Stars
93
Forks
104
Avg merge
14h 10m
Merged PRs (30d)
22

Description

We currently have two migration checks:

  • one checks whether there are pending migrations to create (./manage.py makemigrations --dry-run)
  • one checks whether the names of the migration files have auto in them

The problem is that we have to specify both --migration-module and --migration-path.
I think we can avoid doing this and have only one command line flag.

I would get rid of --migration-path, keeping only --migration-module, although I would rename this flag to --migration-modules while keeping backward compatibility with the old flag.

--migration-path should be ignored (printing a deprecation warning).

We will need to upgrade the modules using this: https://github.com/search?q=org%3Aopenwisp+%27--migration-path%27&type=Code

Contributor guide

Open the contributing guide

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 with the migration-check entry point invoked through ./manage.py, then search the repository and linked OpenWisp modules for --migration-path and --migration-module. Done means one plural --migration-modules flag is supported with backward compatibility, --migration-path is ignored with a deprecation warning, and the affected modules no longer require both flags.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
testing-qa, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.