Skip to content

Feat/1956/issue details last seen#1965

Open
felipebergamin wants to merge 2 commits into
kernelci:mainfrom
profusion:feat/1956/issue-details-last-seen
Open

Feat/1956/issue details last seen#1965
felipebergamin wants to merge 2 commits into
kernelci:mainfrom
profusion:feat/1956/issue-details-last-seen

Conversation

@felipebergamin

@felipebergamin felipebergamin commented Jun 30, 2026

Copy link
Copy Markdown
  • Implements last_seen information on issue details

Closes issue #1956

Example of how it looks:

image

Comment thread dashboard/src/locales/messages/index.ts Outdated
'issueDetails.issueDetails': 'Issue Details',
'issueDetails.issueListingInfo':
'The culprit for all issues listed is code',
'issueDetails.lastIncident': 'Last incident',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to keep the same pattern, we could go with 'Last Incident Data'

Comment thread dashboard/src/types/issueExtras.ts Outdated
issue_version?: string;
};

export type LastIncident = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need a new type here? If there is no new data, we could just change to a type named Incident

checkout_id: Optional[str]


class LastIncident(BaseModel):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to differentiate types for first and last incident?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

not exactly. Now the only difference are the "last_seen" and "first_seen" properties. But I agree we can have an unified Incident type with this data

Comment thread backend/kernelCI_app/queries/issues.py Outdated
if len(issue_id_list) == 1:
comparison = "= %s"
else:
placeholders = ", ".join(["%s"] * len(issue_id_list))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we dont need to do this trick here. We might be able to pass as a list parameter.
There is an example of the commits parameter (a list) on get_hardware_details_summary.

"""
Assigns the last seen data to the processed_issues_table by querying with the issue_key_list.
"""
issue_id_set: set[str] = set()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just a nit: we might be able to get the same with issue_id_set = {*issue_key_list.keys()}

@felipebergamin felipebergamin marked this pull request as ready for review July 2, 2026 17:47
Comment thread backend/kernelCI_app/queries/issues.py Outdated
return records


def get_issue_last_seen_data(*, issue_id_list: list[str]) -> list[dict]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can be factored out with get_issue_first_seen_data into a single function with a toggle for asc/desc

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done

class ExtraIssuesData(BaseModel):
first_incident: FirstIncident
first_incident: Incident
last_incident: Optional[Incident] = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

last incident should not be optional

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

last incident should not be optional

Agreed. It was optional before because ExtraIssuesData was being instantiated without last_incident, which was assigned later on. I changed backend/kernelCI_app/helpers/issueExtras.py to assign last_incident from the start.

},
];

export const getFirstIncidentSection = ({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lingering "First" in name - this gets first and last incidents

'issueDetails.issueDetails': 'Issue Details',
'issueDetails.issueListingInfo':
'The culprit for all issues listed is code',
'issueDetails.lastIncident': 'Last Incident Data',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: I prefer "Latest Incident", as in "the issue might or might not be finished"

'hardwareListing.treeSelectorSearchPlaceholder': 'Search tree...',
'issue.alsoPresentTooltip': 'Issue also present in {tree}',
'issue.firstSeen': 'First seen',
'issue.lastSeen': 'Last seen',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No need to specify "last" when we are inside a "last incident" section. Ditto for "first seen"

Part of kernelci#1956

Signed-off-by: Felipe <felipebergamin@profusion.mobi>
Closes kernelci#1956

Signed-off-by: Felipe <felipebergamin@profusion.mobi>
@felipebergamin felipebergamin force-pushed the feat/1956/issue-details-last-seen branch from 5e2d10a to d2ea2cf Compare July 3, 2026 17:12
@felipebergamin felipebergamin requested a review from mentonin July 3, 2026 17:24
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.

3 participants