Repository navigation
Conversation
9b87c5d to
6397772
Compare
6397772 to
3908277
Compare
3908277 to
05e037c
Compare
f0e0c43 to
b2d556a
Compare
b2d556a to
bedbdd7
Compare
bedbdd7 to
fbd22e5
Compare
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the GitLab CI watch and the CI Runs page reuse the existing provider seams, and the one shared-vocabulary fix ( Notes
[DESIGN-REVIEWED] 16095fd Description read[DESCRIPTION-READ] 1219be5181024b7d46346a5f7c064a67fdfe2d9764887cfe2872efb320df669e That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The normalizer fix is a one-line change in the one place GitLab's spelling is set, and Azure already maps What this change shipsInventory (10 items) — 8 justifiedIntent: a GitLab team gets an alert when CI fails on their own MR, and sees their pipelines on CI Runs. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 16095fd Description read[DESCRIPTION-READ] bd49fde7e17a5698b34a4383330324a6f10f12a32497a2376ed8f7a0d8ae403b That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
1bc3f56 to
aae8624
Compare
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 14% chance that this change introduces a defect, above the 12% limit for approving on its own. Recommend approving: nothing blocks the merge. The PR extends the CI-failure watch and the /ci-runs page to GitLab through the existing provider client layer.
Tier: 2, held for a person: changes requested. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
A GitLab repo in Issue Radar got no CI signal: the CI-failure watch filtered every non-GitHub repo out, and the CI Runs page listed GitHub repos only. The CI-failure watch now dispatches by provider. GitLab projects are listed through the existing gitlab_client.search_pulls (state=open, author_username=<viewer>, host checked against the allowlist first), each row re-checked for author, number and head SHA, a list past PR_SEARCH_MAX keeping the tracked heads, and their head pipelines read with list_pr_workflow_runs, whose "failed" status is now normalized to the shared "failure" conclusion the watch and the PR pane's run actions test for. The signed-in user is read once per host per cycle. In-memory tags and GitLab group keys carry provider and host so a same-slug project never shares memory or a notification thread with a GitHub repo; notes spell an MR ref with "!". The settings toggle is shown for GitHub and GitLab in the forge's own words. /ci-runs lists GitHub and GitLab repos (CI_RUNS_PROVIDERS) through each provider client. gitlab_client_ci.list_recent_workflow_runs reads one page of projects/:id/pipelines into the GitHub row shape, reusing the pipeline normalizer and GitHub's row bounds; a merge-request pipeline carries its MR number from its ref. The page uses the forge's terms (!N, glab) and a glab_setup error code. Azure DevOps stays excluded from both.
aae8624 to
8ed091d
Compare
UX Review (Opus 5.5, fork) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the GitLab CI-failure notification. It is the first half of the PR's stated goal, and no screenshot shows it. All six committed screenshots show the settings toggle and the CI Runs page; none shows the alert itself. Evidence gaps
Notes
[UX-REVIEWED] 16095fd Description read[DESCRIPTION-READ] 4962c71ad403c0680222f9680ffad7750bafd2ceb57107f64ed8ab3d37af5b38 That sha256 names everything this verdict read: the PR description, plus the 9 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
|
This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here. To propose a design, follow the request-for-change process in CONTRIBUTING.md (docs/request-for-change/). Review result on this head: no blocking findings. The checks covered these points:
One thing done well: a watch test feeds the real Optional:
|
bolichen97
left a comment
There was a problem hiding this comment.
Thanks. I read the whole diff on this head, and all checks are green. Most of it is good to keep:
- The CI Runs page and the CI-failure watch now cover GitLab through the existing
glabtransport. The calls are GETs only, the host is checked against the allowlist before the listing and again at the spawn, and nothing is written to the forge. A failing project or host is skipped for the cycle without touching the other forge. _own_mr_rowsre-checks the author against the signed-in login, so a teammate's MR never reaches the watch. Titles and URLs use the GitHub caps.- The settled and failed-run tags now carry provider and host, so a same-slug GitHub repo and GitLab project never share memory. GitHub notes keep their old
group_key, so existing threads still stack. _PIPELINE_CONCLUSIONnow mapsfailedtofailure. I checked main: nothing in the app compares a GitLab conclusion tofailed, and every shared consumer tests forfailure, so this only makes the PR pane's run list agree with them.- The Azure
list_recent_workflow_runsrefusal is never reached, because the route lists GitHub and GitLab repos only. The run link now goes throughsafeHttpUrl.
I am requesting changes on one point: a new regex in product code. gitlab_client_ci.py adds _MR_REF_RE = re.compile(r"^refs/merge-requests/([1-9][0-9]{0,9})/(?:head|merge|train)$"). Product code takes no new regex here. Plain string checks do the same job:
_MR_REF_PREFIX = "refs/merge-requests/"
_MR_REF_SUFFIXES = ("head", "merge", "train")
def _mr_iid(ref: str) -> int | None:
if not ref.startswith(_MR_REF_PREFIX):
return None
iid, sep, tail = ref[len(_MR_REF_PREFIX):].partition("/")
if not sep or tail not in _MR_REF_SUFFIXES:
return None
if not (iid.isascii() and iid.isdigit()) or len(iid) > 10 or iid[0] == "0":
return None
return int(iid)Then import re can go. The reuse of the existing gitlab_client._SHA_RE is fine, since it is not new. Everything else can stay as it is, and I will approve once the regex is gone.
Addresses the review on kirodotdev#19824: the MR ref is parsed with plain prefix, partition and digit checks, and import re goes. A test pins the refs the old pattern accepted and rejected.
|
@bolichen97 thanks for the review. Done in 16095fd: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Thanks for the careful GitLab work. Two things block this head.
issue_radar/backend/ci_watch.py:1(and the other 12 non-test files under the issue-radar wheel copy, backend andwebsite/src/apps/issue-radar/). Since #36446,apps/adoption-pins.jsonon main (line 70) pins issue-radar to its app repository,kirocrew-app-issue-radarunder the KiroCrewCaptain account, at commit 8e57db85. A host that adopts the app runs that pinned tree and not this wheel copy. So those users get neither the GitLab CI alert nor the GitLab rows on CI Runs, and the wheel copy drifts from the pinned app. The body has noApp repo:line. PR Hygiene passed only because this PR's base commit (6a61c84) is from before the pin. Fix: port the change to the app repository first, or open a PR there. Then addApp repo: <owner>/<repo>@<sha>(or#<pr>) to the body and rebase onto current main, so the check runs against the pin.issue_radar/backend/ci_watch.py:504. The first half of the Goal is the alert itself (titleCI failed · owner/repo!Nand its body), and no committed screenshot shows it. The six PNGs undertemp-screenshots/issue-radar-gitlab-pipeline/show only the settings toggle and CI Runs states. The UX lane reported that it could not evaluate the notification. Fix: commit one screenshot of a GitLab CI-failure note in the notification list, next to a GitHub one (!Nbeside#N), then re-run the UX lane on the new head.
Once both are fixed, a maintainer still needs to sign off the design, because this changes a shipped experience.
Optional:
- The Tests section says a test keeps the GitHub group key byte-identical, but no test asserts it. Changing
_note_scope(ci_watch.py:318) to tag GitHub keys too leaves every test green. Addself.assertEqual(note["group_key"], "ci-failure:o/r#7")totest_failed_run_on_own_pr_notifies_once, or drop the claim. - The lines that keep tracked heads after a failed GitHub search (ci_watch.py:154) or an unreadable GitLab login (:196) are not pinned. Seeding a settled head first and asserting it survives the failing cycle would cover them. The same goes for the exact-cap case at :212.
- The branch that keeps a reported run while it runs again (ci_watch.py:363-369) also runs for GitHub. Please say in the spec row and the body that keeping the entry is a deliberate choice, so the maintainer can weigh the "GitLab Retry that fails again is not announced" tradeoff.
Problem / Motivation
Goal: Give a GitLab repo the same CI signal a GitHub repo gets in Issue Radar: a notification when CI fails on one of your own merge requests, and its recent pipelines on the CI Runs page.
Today the background CI watch filters every non-GitHub repo out before it looks at anything, and
/ci-runslists GitHub repos only. A team on self-managed GitLab never hears when CI fails on one of their own merge requests, even with the alert turned on, and the CI Runs page shows nothing for their project.Why it matters
With #17525 and #19820, GitLab repos get the dependency graph and working crews. CI is the last Issue Radar signal still hard-wired to GitHub, so a GitLab team's only CI news is the forge's own email.
Not a goal
glabtransport, or the token scope.What changed (motivation → approach → change)
ci_watch.pykey.provider == GITHUBfiltersearch_pulls, then their pipelines, oneGET /userper host per cycle/ci-runs(http_routes/ci_runs.py)CI_RUNS_PROVIDERS), each through its own provider client; a GitLab setup failure answersglab_setupgitlab_client_ci.py(new)list_recent_workflow_runs: one page ofprojects/:id/pipelinesin the GitHub row shape, with GitHub's row bounds;running/cancelingread asin_progress; an MR pipeline carries its MR number from its refgitlab_normalization.pyfailedfailure, GitHub's spelling, which every consumer already compares againstglab)owner/repoheaders!N,glab), the forge mark and self-managed host beside each repo, run links throughsafeHttpUrl; strings in the 12 locale catalogs +en.manual.jsonThe watch filters by
author_usernameand re-checks each row's author againstGET /userand its head SHA's format, mirroring the GitHub viewer filter; a list past the search cap keeps the tracked heads, as on GitHub. Every request is aGETthrough the existingglabtransport with the host re-verified at spawn; nothing is written to the forge and no prose leaves the host.The normalizer change is the one behaviour fix outside the GitLab-only paths: a failed GitLab pipeline used to come back as
failed, which the watch (and the PR pane's retry tooltip) never matched, so the GitLab alert could not fire. One spelling, one place, pinned by a test that runs the real normalizer output through the watch.Spec:
docs/system-specs/modules/issue-radar.mdgains "CI-failure alerts by forge", a "CI Runs page by forge" section and aGET /ci-runsroute row. TheProviderClientprotocol gainslist_recent_workflow_runs; the Azure client refuses it and the route never calls it there.Backwards compatibility
Compatible: the GitHub CI-watch group key, state file and
/ci-runsrow shape are unchanged, andci-watch-state.jsonwritten by the old code still loads. The GitLab conclusion rename only affects GitLab rows, which no consumer matched before. Three CI Runs i18n keys are renamed in the same component; nothing else referenced them.Tests
issue_radar/tests/test_ci_watch.py: own MR rows read, a teammate's row and a bad SHA dropped, a cut-off list keeps tracked heads, an unlisted host fails safely, provider dispatch, GitHub key byte-identical to before, a REAL_norm_pipeline_run({"status":"failed"})row produces one note, one/userper host, unreadable login skips only that host.issue_radar/tests/test_ci_runs.py(new): GitLab rows in the GitHub row shape, status and conclusion in GitHub's vocabulary, bounds clipped, endpoint and params, unlisted host refused before any call, the route lists a GitLab repo and excludes Azure, one repo'sglabfailure is an error row that leaves the others.RepoSettings.test.tsx(new): toggle shown for GitHub and GitLab in forge wording, hidden for Azure.CiRunsView.test.tsx: a GitLab row uses!Nandglab; a same-slug GitHub and GitLab repo get different marks and only the self-managed one a host; ajavascript:run link renders no link; GitHub unchanged./ci-runsback to GitHub-only → 2 fail;failed→failureorrunning→in_progressdropped → a test fails each;!Nback to#N→ 1 fails;safeHttpUrlor the host tag removed → 1 fails each; toggle gate back to GitHub-only → 1 fails; author or SHA check removed → 1 fails each.Backend: 3,178 Issue Radar and routes-facade tests pass. Frontend: 2,837 Issue Radar and i18n vitest pass,
tscclean. isort, flake8, mypy, black and the line-cap gate pass.Manual verification
Ran a throwaway standalone gateway on this head with offline fake
ghandglabCLIs:/ci-runsanswers 200 with a GitHub fixture repo and a GitLab fixture repo, and the GitLab rows come back already mapped (in_progress,!17), so the real route, client and normalizer ran. Earlier, the watch and toggle were run against a real self-managed GitLab 19.3.3 EE project. Screenshots use fixture names.Screenshots / video
Committed under
temp-screenshots/issue-radar-gitlab-pipeline/(fork PR,--attachis not available to me):CI Runs: error, empty, none connected, cut-off list
Related Issues
no linked issue: third PR of the GitLab Issue Radar series (#17525, #19820), not a standalone issue.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.