Phase 1# of postponed issues reprocessing - #746
Conversation
PR Summary by QodoAdd categorized postponed resolutions and sweep jobs to reprocess blocked issues
AI Description
Diagram
High-Level Assessment
Files changed (40)
|
Code Review by Qodo
1.
|
3f80e7a to
a15d4fa
Compare
b558595 to
041c13b
Compare
lbarcziova
left a comment
There was a problem hiding this comment.
I see some great improvements here, I really like the prompt changes; just few (hopefully last) notes, and something raised by Claude:
1. GitLab Bearer token sent to any gitlab.* host (security, low-severity)
_GITLAB_MR_RE = re.compile(r"https://(gitlab\.[^/]+)/...") still accepts any gitlab.* domain. The extracted host is passed to gitlab_api_get(gitlab_url=f"https://{host}"), which appends the Bearer token to
the request. A crafted blocker_reference pointing to a rogue gitlab.attacker.com host would exfiltrate the token. jpodivin deflected to the supervisor layer but the risk sits in pr_pending.py — the regex
is where the host is extracted and trusted. Since blocker_reference values come from Jira comments written by the LLM (not from a curated allowlist), this is exploitable if a Jira comment is compromised or
the LLM hallucinates a hostile URL.
We could have a whitelist for this. But it will add to the maintenance burden. |
633f2a3 to
f47352b
Compare
majamassarini
left a comment
There was a problem hiding this comment.
Beside the comment below and this small finding from Claude, this LGTM.
PostponedData.blocker_references semantically required but schema-optional (ymir/common/models.py:1167)
Field is list[str] | None with default=None, but PRPendingSweep returns an error if None for postponed_pr_pending issues. The schema doesn't enforce the semantic requirement.
Fix: Either make the field required in the schema or handle None gracefully in PRPendingSweep.
| @@ -0,0 +1,9 @@ | |||
| # Required: Jira instance URL | |||
There was a problem hiding this comment.
I am wondering if, instead of creating this new secret file, we should reuse the jira-issue-fetcher.env and potentially rename it - if clearer. This would limit the places that need to be updated.
There was a problem hiding this comment.
But some of the vars in that file, like QUERY, have nothing to do in sweep jobs.
Using a single file for both, would lead to confusion regarding what the cronjobs need. Not just for people, agents too.
Having a single file for two services, would also mean that variables for issue fetcher, would get in sweep containers. Finally, while there is already divergence today, there is no guarantee that it won't be even greater in the future. And then we would have to create a new file anyway.
That is not entirely correct. The |
a8386e8 to
6ccf63f
Compare
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Add ymir_abandoned label Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Sweep cronjob is using a container image, similar to the one for supervisor. Signed-off-by: Jiri Podivin <jpodivin@redhat.com> Assisted-by: Claude Opus 4.6 via Claude Code
Signed-off-by: Jiri Podivin <jpodivin@redhat.com> Assisted-by: Claude Sonnet 4.6 via Claude Code
Implementing design from research by @majamassarini .
Postponed issues are now split into several categories, depending on the reason for postponement. In each of these cases, a comment, in a well defined format, is posted under the given JIRA item. This comment is later processed by the
comment_parserand used to determine if the postponement label can be removed, and processing resumed.Sweep is executed using one of 4 strategies:
check_build_in_buildroot.ymir.supervisor.gitlab_utils.gitlab_api_getto check state of MRs. If they are merged, the issue is pushed back into triage queue.ymir_postponed_no_patchback into triage queue, subject to limit of 20 per run.check_build_in_buildrootAll with their own cronjobs.
Notes:
gitlab_api_getfunction, so it can be used by sweep jobs.ymir_abandonedlabel has been implemented as part of this PR, although it is going to be used only in phase 2#.