-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove makemigrations from scripts #11638
Remove makemigrations from scripts #11638
Conversation
DryRun Security SummaryThe pull request focuses on enhancing the Defect Dojo project's security, maintainability, and development processes through improvements in database migrations, password generation, API schema validation, and comprehensive testing. Expand for full summarySummary: The code changes in this pull request cover various aspects of the Defect Dojo project, with a strong focus on improving the application's security, maintainability, and development processes. The changes include updates to the contribution guidelines, enhancements to the Docker-based application initialization and testing setup, and improvements to the overall application integrity. From an application security perspective, the key highlights are:
Files Changed:
Overall, the code changes in this pull request demonstrate a strong commitment to improving the security, maintainability, and development processes of the Defect Dojo project, which is a positive step towards ensuring the long-term stability and security of the application. Code AnalysisWe ran |
This is a good move. I'll add an approval once you're happy with the PR and take it out of draft 😄 |
Ah, forgot to undraft it 😀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Description
Historically the
initializer
and other scripts automatically made new migration files for any changes made to the database model. This is practical for (first time) users making modifications to the Defect Dojo codebase.But when these migrations end up in production or even staging environments, it may prevent these user from ever being able to upgrade to new upstream releases.
It's possible to merge custom migration with upstream migrations and keep upgrading to newer upstream Defect Dojo releases. But this requires a bit of Django knowledge, which users might not realize until they're stuck in production with an out of sync data model.
This PR (suggests to) remove(s) the
makemigrations
step and instead warns the users if the datamodel was changed without proper/versioned migrations. This makes users aware of the risks and make a more conscious decision about having custom migrations which could diverge from official Defect Dojo releases.The PR also adds a bit of documentation to explain how to generate new migrations.
Test results
It just works ;-)
Documentation
Please update any documentation when needed in the documentation folder)
Checklist
This checklist is for your information.
dev
.dev
.bugfix
branch.Extra information
Possibly we could go one step further and let the defect dojo startup script fail if there are changes detected in the datamodel that have no migrations.