[AAP-85133] XLAB Fix: disambiguate duplicate label names by organization instead of de-duplication #389
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 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.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #389"
general
weight: 0.35
kcagran
[AAP-85133] Fix: disambiguate duplicate label names by organization instead of de-duplication
Description
<!-- Mandatory: Provide a clear, concise description of the changes and their purpose -->
- removed commit from https://github.com/ansible/metrics-service/pull/387
- modified label SQL query to also use organization name
- PR https://github.com/ansible/metrics-service/pull/387 didn't provide the correct fix of de-duplicating labels in response. Labels have a unique ID but a non-unique name, causing the label name duplications within response. For this a different solution has been proposed and this PR is trying to apply it.
- By removing the commit from https://github.com/ansible/metrics-service/pull/387 and modifying label SQL query to also use the organization name. The response is also modified to put
label-name (org1), label-name (org2)on the duplicate labels to avoid confusion (labels with the same name, different ID) , andlabel-namewhere there is a label which is the only one with that name (omitting the organization name)Type of Change
<!-- Mandatory: Check one or more boxes that apply -->
Self-Review Checklist
<!-- These items help ensure quality - they complement our automated CI checks -->
Testing Instructions
<!-- Optional for test-only changes. Mandatory for all other changes -->
<!-- Must be detailed enough for reviewers to reproduce -->
Prerequisites
<!-- List any specific setup required -->
Follow README.md to set up local environment. Make sure
metrics_serviceis running.1. Run a local instance (or docker compose) for AWX and Metrics Service databases with all recent migrations
2. Update your environment variables to match your local setup - https://github.com/ansible/metrics-service#quick-start-1
Steps to Test
1. Seed duplicate label rows in the awx DB (organization-scoped duplicates, mirrors the bug):
2. Curl to get a list of labels from the API
Expected Results
<!-- Describe what should happen after following the steps -->
As you can see, labels with duplicate names have an added organization name to which they belong while labels with no duplicates, only have their name without the organization name included.
Additional Context
NOTE: The backport of #387 will also need to be reverted on the downstream.
Required Actions
<!-- Check if changes require work in other areas -->
<!-- Remove section if no external actions needed -->
<!-- API docs, feature docs, deployment guides -->
<!-- Specify repos: django-ansible-base, eda-server, etc. -->
<!-- CI/CD, installer updates, new services -->
<!-- UI team, platform services, infrastructure -->
<!-- Reference blocking PRs/MRs with brief context -->