Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions openshift/configmap-agents-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ data:
# status-change comment produced by issue-verification is suppressed
# alongside the transition.
JIRA_ALLOW_STATUS_CHANGES: "false"
# 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"
Comment on lines +21 to +23

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

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

Comment on lines +21 to +23

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Informational

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

immutable: false
kind: ConfigMap
metadata:
Expand Down
Loading