Open
Conversation
Create a single reusable data repair management command for data repair operations happening outside of migrations. Specifically in this case the motivation is to resolve the repository version memoization issues, but it can be reused in the future. re pulp#7272
mdellweg
reviewed
Feb 16, 2026
Member
mdellweg
left a comment
There was a problem hiding this comment.
I like the idea.
And added whatever came first to my mind.
| print() | ||
|
|
||
| if not number_broken: | ||
| print("Finished. (OK)") |
Member
There was a problem hiding this comment.
Django want's us to use self.stdout.write here.
https://docs.djangoproject.com/en/4.2/howto/custom-management-commands/
|
|
||
| def add_arguments(self, parser): | ||
| """Set up arguments.""" | ||
| parser.add_argument("issue", help=_("The github issue # of the issue to be fixed.")) |
Member
There was a problem hiding this comment.
Would it be possible for plugins to add datarepair operations, and how would we avoid name clashes?
Comment on lines
+27
to
+30
| help=_( | ||
| "Don't modify anything, just show the results of what would happen if this " | ||
| "command were run." | ||
| ), |
Member
There was a problem hiding this comment.
Maybe another option. But wouldn't it be nice to print some info paragraph about the selected repair?
It could sum up for example after what type of upgrade the data is expected to need repair (whenever we have that detail).
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.
Create a single reusable data repair management command for data repair operations happening outside of migrations.
Specifically in this case the motivation is to resolve the repository version memoization issues, but it can be reused in the future.
re #7272
Usage (ignore the warnings):