Link legacy unauthored tasks to a virtual "anonyme" user profile#39
Merged
Conversation
- Implement AppBundle:LinkAnonymousTasksCommand to bind orphan tasks to an 'anonyme' user - Update Task entity mapping to enforce 'nullable=false' on the user relation - Update LoadData fixtures to automatically assign the virtual anonymous account to legacy items - Add LinkAnonymousTasksCommandTest to secure the CLI execution behavior
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
- Implement LinkAnonymousTasksCommandTest under tests/AppBundle/Command/ - Properly boot Symfony 3.4 Kernel using self:: reference - Add assertions to ensure command completion outputs expected success status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request introduces a data migration and schema hardening process for the
Taskentity, resolving the core structural issues of legacy unauthored tasks. To support global security ownership features and clean up legacy MVP records, all tasks without an explicit author are now safely associated with a default virtual user namedanonyme.Changes Made
1. Data Hardening (
src/AppBundle/Entity/Task.php)user_idcolumn configuration fromnullable=truetonullable=falseto guarantee absolute data integrity at the database layer.onDelete="SET NULL"database triggers to avoid integrity conflicts with the new strictNOT NULLconstraint.2. Maintenance Command (
src/AppBundle/Command/LinkAnonymousTasksCommand.php)app:tasks:link-anonymous) that checks for (or initializes) the virtualanonymeaccount with a secure, randomized password.3. Fixtures Synchronization (
src/AppBundle/DataFixtures/ORM/LoadData.php)anonymeuser account as a parent reference for unauthored legacy data instead.4. Tests Added (
tests/AppBundle/Command/LinkAnonymousTasksCommandTest.php)LinkAnonymousTasksCommandTestusing Symfony'sKernelTestCaseandCommandTesterto prevent command execution crashes during automated CI workflows.How to Test / Review