Repository navigation
Enable setting of reviewers in Ymir's MRs - #723
Conversation
PR Summary by QodoEnable automatic reviewer assignment for new Ymir merge requests
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
7 rules 1. Reviewer assignment blocks workflow
|
| # When "true", agents assign reviewers to newly created MRs based on | ||
| # the package's bugzilla component contacts (Default Assignee + QA Contact). | ||
| ASSIGN_MR_REVIEWERS: "true" |
There was a problem hiding this comment.
1. Reviewer assignment blocks workflow 🐞 Bug ➹ Performance
Enabling ASSIGN_MR_REVIEWERS makes newly-created MR flows await reviewer resolution and assignment, which can add noticeable latency when GitLab/bugzilla-data/LDAP are slow (multiple calls have 30s timeouts). This can extend the critical path of MR creation for every new MR and increase the chance of step-level timeouts under transient network/LDAP issues.
Agent Prompt
### Issue description
`ASSIGN_MR_REVIEWERS` is enabled in the cluster ConfigMap, which activates `request_mr_reviews()` on every newly-created MR. That function performs multiple network requests (bugzilla-data fetch, GitLab user lookups, and potentially an LDAP lookup) with 30s timeouts, and it is currently awaited in the MR creation path, adding avoidable latency.
### Issue Context
Reviewer assignment is already best-effort (exceptions are swallowed), so it can be safely moved off the critical path without changing correctness of the core MR creation workflow.
### Fix Focus Areas
- openshift/configmap-agents-env.yml[21-23]
- ymir/agents/tasks.py[291-379]
- ymir/tools/constants.py[1-6]
- ymir/tools/privileged/reviewer_resolver.py[36-75]
- ymir/tools/privileged/reviewer_resolver.py[156-203]
### Suggested change
- In `ymir/agents/tasks.py`, avoid blocking MR creation on reviewer assignment (e.g., `asyncio.create_task(request_mr_reviews(...))` with an error-logging done-callback), *or* gate the LDAP fallback / reduce timeouts so the worst-case delay is bounded.
- If you need a safer rollout, consider leaving `ASSIGN_MR_REVIEWERS` disabled by default in the ConfigMap and enabling it per-environment/canary once latency and dependencies (LDAP/Kerberos) are confirmed.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # When "true", agents assign reviewers to newly created MRs based on | ||
| # the package's bugzilla component contacts (Default Assignee + QA Contact). | ||
| ASSIGN_MR_REVIEWERS: "true" |
There was a problem hiding this comment.
2. Reviewer errors lack traceback 🐞 Bug ◔ Observability
With ASSIGN_MR_REVIEWERS enabled, failures during reviewer resolution/assignment will be logged without a stack trace in request_mr_reviews, making production failures harder to diagnose. This reduces observability exactly on a newly-activated integration path (bugzilla-data, GitLab user lookup, LDAP).
Agent Prompt
### Issue description
When reviewer assignment fails, `request_mr_reviews()` logs only the exception message, not the traceback. With `ASSIGN_MR_REVIEWERS` enabled by default, this will make it harder to identify whether failures come from bugzilla-data fetch, GitLab API calls, or LDAP/Kerberos.
### Issue Context
The function is explicitly best-effort (it should not raise), so improving logs is the main way to debug real failures.
### Fix Focus Areas
- ymir/agents/tasks.py[291-319]
- openshift/configmap-agents-env.yml[21-23]
### Suggested change
- Change the exception handler to include traceback details (e.g., `logger.warning("...", exc_info=True)`), and optionally include which tool call failed (resolve vs set reviewers) to speed up diagnosis.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
No description provided.