Skip to content

feat(issue-details): per-tree incidents and first good checkout - #2050

Open
alanpeixinho wants to merge 1 commit into
kernelci:mainfrom
profusion:feat/issues-per-tree-info
Open

feat(issue-details): per-tree incidents and first good checkout#2050
alanpeixinho wants to merge 1 commit into
kernelci:mainfrom
profusion:feat/issues-per-tree-info

Conversation

@alanpeixinho

@alanpeixinho alanpeixinho commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What it is

Per-tree incidents on the issue details page (/issue/$issueId): first seen, last seen, and first good checkout (earliest later checkout on that tree with no incident for the issue).

Backend adds group_by=tree on seen queries and a single LATERAL first-good-checkout query. Wired only on /api/issue/{id} so extras/listing stay unchanged.

Closes #1957

How to test

  1. Open an issue details page with incidents on multiple trees (e.g. one that previously showed only global first/last).
  2. Confirm Incidents per Tree appears before the global first/last sections.
  3. Expand a tree: check first/last links and dates; if recovered, First Good Checkout; if not, Still failing.
  4. Spot-check an issue still failing on a tree and one that recovered.
  5. Confirm issue listing / extras endpoints still work and do not gain the expensive per-tree work.
per-tree-incidents

- Add per-tree first/last seen and first good checkout on issue details
- Extend seen queries with group_by=tree and LATERAL first-good-checkout
- Wire per-tree data only on /api/issue/{id}; keep extras/listing unchanged
- Add IncidentsSection UI, types, locales, and OpenAPI schema updates

Closes kernelci#1957

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Comment on lines +297 to +305
AND C.git_repository_branch IS NOT NULL
ORDER BY
IC.issue_id,
C.tree_name,
C.git_repository_url,
C.git_repository_branch,
IC.issue_version {order_direction},
IC._timestamp {order_direction}
)
SELECT
IC.id,
IC.issue_id,
IC._timestamp AS first_seen,
IC.issue_version,
C.git_commit_hash,
C.git_repository_url,
C.git_repository_branch,
C.git_commit_name,
C.tree_name,
C.id as checkout_id
FROM
incidents IC
LEFT JOIN tests T ON IC.test_id = T.id
LEFT JOIN builds B ON (
IC.build_id = B.id
OR T.build_id = B.id
)
LEFT JOIN checkouts C ON B.checkout_id = C.id
JOIN target_incident TI ON IC.id = TI.id
"""
"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ranking by issue_version before _timestamp, so “last seen” is the highest/lowest version, not the latest failure. Is that right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am keeping the behavior of the global "last seen" here, prioritizing latest version of the issue, and then using timestamp.
For what I see issue versioning is mostly used here as a way to make immutable data updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issue-detail: per-tree "last seen" and "first good checkout"

2 participants