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

Command check #9

Open
sveetch opened this issue Mar 24, 2024 · 2 comments
Open

Command check #9

sveetch opened this issue Mar 24, 2024 · 2 comments
Labels
idea Idea about feature or new concept

Comments

@sveetch
Copy link
Member

sveetch commented Mar 24, 2024

Is your feature request related to a problem? Please describe.

Currently, the diskette configuration settings are only validated when dumping or loading.

Describe the solution you'd like

Current behavior is working but it could be more helpful to diagnostic invalid configuration without to dump or load anything.

New command diskette_check would be able to:

  • Inspect application definitions to find invalid configuration;
  • Inspect storage definitions to find invalid storage paths;
  • Hint about storage sizes that would be dumped (this can help when writing storage exclude patterns);

This will never try to hint about data size since it could be stressful for database to count on everything.

@sveetch sveetch added the feature For new feature development label Mar 24, 2024
@sveetch sveetch changed the title [diskette_check] Check command Command check Mar 27, 2024
@sveetch
Copy link
Member Author

sveetch commented Mar 27, 2024

Adding a new command for this was impractical and not very DRY to implement.

So instead, the existing command dump and load will include a new option --check to perform a dry-run.

Since these command already perform validations, we can use the same routine but without writing, querying or loading anything.

The check option for dump has been implemented and tested in v0.3.3-pre.1

@sveetch sveetch closed this as completed Oct 19, 2024
@sveetch sveetch reopened this Nov 5, 2024
@sveetch
Copy link
Member Author

sveetch commented Nov 5, 2024

Finally reopening this since i found a check command would nice in some situations for debugging.

It should easily find all installed app models then check if there are excluded from dump so in last resort user can explicitly see that some useful model are ignored.

For context, i've faced loading failures from a dump because the app was defining explicitely models. But since the definition creation the app has evolved with new models that were so excluded from dump.

Since these models were used in foreignkey from other models, the loading failed with a laconic message "Integrity Error: Foreign key etc..", that it took me too much time and effort to understand that i was missing new models in definitions. A check command that made me listing all defined models would have helped.

Also we could check about migrations. And maybe a somewhat hardcoded check about permissions and contenttypes.

@sveetch sveetch added idea Idea about feature or new concept and removed feature For new feature development labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Idea about feature or new concept
Projects
None yet
Development

No branches or pull requests

1 participant