ADORSYS-GIS / ADORSYS-GIS/converse-frontends
[Ticket]: Trigger reference on runs pages should link to the source pull/merge request
- Ngôn ngữ chính
- TypeScript
- Star
- 0
- Fork
- 0
- Merge trung bình
- 1 giờ 49 phút
- Pull request đã merge (30 ngày)
- 253
Mô tả
### Type
Feature
### Summary
We need the "Trigger" reference shown on the runs pages (e.g. "review · PR #649") to be clickable and open the actual pull/merge request it names, because right now it's plain text with no way to reach the PR/MR from the run.
Expected result: on a run's detail page (`/runs/[id]`) and in the runs list (`/runs`), a trigger that names a real pull/merge request opens it in a new tab; a non-PR trigger (e.g. a repository index run) stays plain text.
### Intent
Reported directly by the maintainer while reviewing the runs pages: the trigger reference reads like a link but isn't one, so getting from a run to the PR that caused it requires leaving the console and searching GitHub/GitLab by hand.
### Source of truth (links)
Reported directly by the maintainer (@leghadjeu-christian) in this session's chat.
### Current Behavior
`triggerLabel(task)` (`apps/lci/src/lib/domain/tasks.ts`) formats the trigger as plain text (`"review · PR #649"`), rendered as inert text in the run detail page's "Trigger" fact and the runs list's "Trigger" column.
### Expected Behavior
Both render locations show the same text as an anchor to `https://github.com///pull/` (GitHub) or `https://gitlab.com///-/merge_requests/` (GitLab), opening in a new tab, whenever the trigger names a real pull/merge request and the repo join has real owner/name data. Everything else (repository-index runs, or a run whose repo join came back empty) stays plain text, unchanged.
### Acceptance Criteria
- [ ] Given a run triggered by a GitHub pull request, when its Trigger fact/column renders, then it is a link to `https://github.com///pull/`.
- [ ] Given a run triggered by a GitLab merge request, when its Trigger fact/column renders, then it is a link to `https://gitlab.com///-/merge_requests/`.
- [ ] Given a run not triggered by a pull/merge request (e.g. a repository index), when its Trigger renders, then it stays plain text, not a link.
- [ ] In the runs list, clicking the trigger link opens the PR/MR and does not also navigate the row to the run detail page.
- [ ] Existing tests pass; new tests cover the link/no-link cases and the row-click-vs-link-click distinction.
### Out of Scope
- Self-hosted GitLab instances with a non-`gitlab.com` base URL — the control plane already exposes a `GET /config` endpoint with the right base URL for this (`gitlab_base_url`/`gitlab_project_base_urls`), but the frontend doesn't consume it anywhere yet. This ticket hardcodes `gitlab.com`, matching the assumption already baked into this codebase's existing tests/fixtures for `Review.review_url`; wiring up `/config` for self-hosted GitLab is a separate, larger piece of work.
- The Overview page's "Recent runs" list — its row is already a link to the run detail page itself, and nesting a second link inside it would be invalid markup; out of scope for this ticket.
### Technical Context
- `apps/lci/src/lib/domain/tasks.ts` — `triggerLabel`/new `triggerUrl`.
- `apps/lci/src/containers/run-detail-centre.tsx` — the "Trigger" `Fact` row.
- `apps/lci/src/containers/runs-centre.tsx` — the "Trigger" `LedgerTable` column; rows are click-to-open via `onSelectRow`, so the link needs to stop click propagation.
### Risks
None — additive, gated on `target_type === 'pull_request'` plus non-null `repo_owner`/`repo_name`; falls back to the existing plain-text rendering otherwise.
### Test Plan
- `vitest run` (`apps/lci`) — new `triggerUrl` unit tests plus component tests for both render sites.
- Storybook visual check of the RunDetail and Runs stories.
### Verification evidence
Test output: `vitest run` — 27 files / 181 tests passed (`apps/lci`).
Manual verification steps: Storybook `Pages/LCI/RunDetail/Default` and `Pages/LCI/Runs/Default` — confirmed the Trigger fact/column render as real anchors with correct `href`s for GitHub and GitLab fixtures, and that a non-PR trigger ("index · repository #1") stays plain text.
### Human accountable owner
@leghadjeu-christian
### AI Usage Declaration
Drafting the ticket, Understanding code, Proposing implementation, Generating code, Generating tests, Reviewing the diff
### Human verification completed
- [x] I understood the intent
- [x] I checked the source of truth
Hướng dẫn đóng góp
Hướng nghiên cứu
Start with apps/lci/src/lib/domain/tasks.ts, then trace the Trigger renderers in apps/lci/src/containers/run-detail-centre.tsx and apps/lci/src/containers/runs-centre.tsx. Run vitest in apps/lci and add coverage for GitHub/GitLab links, plain-text non-PR triggers, and preventing a trigger click from selecting the runs-table row; done means all existing and new tests pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend, testing
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 48/100