-
Notifications
You must be signed in to change notification settings - Fork 391
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
feat: Heal all identities with blank traits #4908
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
Docker builds report
|
Uffizzi Preview |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4908 +/- ##
=======================================
Coverage 97.38% 97.39%
=======================================
Files 1189 1190 +1
Lines 41453 41527 +74
=======================================
+ Hits 40371 40445 +74
Misses 1082 1082 ☔ View full report in Codecov by Sentry. |
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 with a couple of minor comments.
We should also remove the unrelated code (from the other PR here)
api/edge_api/management/commands/ensure_identity_traits_blanks.py
Outdated
Show resolved
Hide resolved
self.stdout.write( | ||
f"Fixed identity id={identity_document['identity_uuid']}", | ||
) |
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.
Maybe we should add some more log messages like this one to show some indication of progress?
I guess we don't want to write a message for every identity we iterate over, but perhaps we should add a counter, and log a message every 100k or something?
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.
If we had standardised stats export like Prometheus, sure.
At this point in time I prefer not to do this.
Besides, I don't expect that many corrupted identities.
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.
Besides, I don't expect that many corrupted identities.
This is exactly the reason that I think we should do this. Because it might be the case that, when it's running, it looks like nothing is happening.
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.
Okay, added some additional counting logging.
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.
NB: I've decided to re-implement it using structlog.
b2a6137
to
b2db8b4
Compare
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.
Looks good though you're missing some code coverage for a small section of the command.
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
Adds a management command that scans through all identities and restores previously deleted blank traits.
Additionally, updates local pre-commit version to play nice with recently updated hooks.
Additionally, adds
structlog
and logs the command progress with structured events.How did you test this code?
The code is covered by a new unit test. The test ensures only the fixed identities get written.