AAP-61789 Fix migration #196
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.60 · 213 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.321
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.060
Real PR Conversation Timeline
1 comments
"Review active on #196"
general
weight: 0.35
justinc1
This pull request introduces improvements to the Django migration scripts for the
clustersapp, focusing on code readability and data consistency. The main changes include refactoring for better formatting, and the addition of a new migration to ensure uniqueness of negativeexternal_idvalues across several models.Migration code readability improvements:
Reformatted long lines in the duplicate resolution functions (
resolve_duplicates,resolve_label_duplicates,resolve_host_duplicates, andresolve_aap_user_duplicates) to improve readability and maintainability in0015_auto_20251020_1008.py. [[1]](diffhunk://#diff-e7e29bf7cdc36ba0775692cab6a329a5b0f76ab850deeab4ba4c499ebbedb5eeL4-R5) [[2]](diffhunk://#diff-e7e29bf7cdc36ba0775692cab6a329a5b0f76ab850deeab4ba4c499ebbedb5eeL50-L69) [[3]](diffhunk://#diff-e7e29bf7cdc36ba0775692cab6a329a5b0f76ab850deeab4ba4c499ebbedb5eeL82-R75) [[4]](diffhunk://#diff-e7e29bf7cdc36ba0775692cab6a329a5b0f76ab850deeab4ba4c499ebbedb5eeL98-R88) [[5]](diffhunk://#diff-e7e29bf7cdc36ba0775692cab6a329a5b0f76ab850deeab4ba4c499ebbedb5eeL115-R113)New migration for unique negative external IDs:
Added a new migration
0016_alter_aapuser_index_together_and_more.pythat introduces theunique_negative_external_idsfunction. This function iterates over several models and ensures that all negativeexternal_idvalues are unique by reassigning them to new, decremented values. This helps maintain data integrity for objects imported or created with negative IDs.migrations.RunPythonto execute the uniqueness enforcement and alters theindex_togetherconstraint for theAAPUsermodel.