Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 7 additions & 24 deletions frontend/src/apiDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,36 +496,19 @@ export interface OSHScan {
url: string | null;
}

// /api/log-detective
export interface LogDetectiveResultGroup {
packit_id: number;
analysis_id: string;
export interface LogDetectiveTarget {
id: number;
target_arch: string;
status: string;
chroot: string;
commit_sha: string;
log_detective_response: LogDetectiveResponse | null;
error_msg: string | null;
target_build: string | null;
run_ids: number[];
submitted_time: number | null;
branch_name: string | null;
pr_id: number | null;
issue_id: number | null;
release: string | null;
project_url: string;
repo_name: string;
repo_namespace: string;
anitya_version: string | null;
anitya_project_name: string | null;
anitya_package: string | null;
}

// /api/log-detective/groups/$id
// /api/log-detective/groups
export interface LogDetectiveGroup {
packit_id: number;
submitted_time: number | null;
run_ids: number[];
log_detective_target_ids: number[];
log_detective_targets: LogDetectiveTarget[];

@betulependule betulependule Sep 23, 2026

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.

Unless I'm mistaken, I think that you also need to replace log_detective_target_ids with log_detective_targets in LogDetectiveGroup.tsx. VS Code is complaining that log_detective_target_ids does not exist on type LogDetectiveGroup in that file.

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.

yeah forgot to fix this, but I feel like the group view is now redundant anyway, so I'll remove it completely. thx

commit_sha: string | null;
pr_id: number | null;
issue_id: number | null;
branch_name: string | null;
Expand All @@ -540,7 +523,6 @@ export interface LogDetectiveGroup {
repo_namespace: string;
}

// /api/log-detective/$id
export interface LogDetectiveExplanation {
text: string;
}
Expand All @@ -563,6 +545,7 @@ export interface LogDetectiveResponse {
snippets: LogDetectiveSnippet[] | null;
}

// /api/log-detective/$id
export interface LogDetectiveResult {
packit_id: number;
analysis_id: string;
Expand Down
128 changes: 0 additions & 128 deletions frontend/src/components/logdetective/LogDetectiveGroup.tsx

This file was deleted.

22 changes: 22 additions & 0 deletions frontend/src/components/logdetective/LogDetectiveResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ import { logDetectiveResultQueryOptions } from "../../queries/logdetective/logDe
import { Route as LogDetectiveRoute } from "../../routes/jobs_/log-detective.$id";
import { ErrorConnection } from "../errors/ErrorConnection";
import { Preloader } from "../shared/Preloader";
import { SHACopy } from "../shared/SHACopy";
import { Timestamp } from "../shared/Timestamp";
import { StatusLabel } from "../statusLabels/StatusLabel";
import { TriggerLink, TriggerSuffix } from "../trigger/TriggerLink";

// PF CodeBlock has very generous default padding; these overrides keep snippet rows compact.
// The `as` cast is needed because PF CSS custom properties aren't in the CSSProperties type.
Expand Down Expand Up @@ -173,6 +175,20 @@ export const LogDetectiveResult = () => {
<PageSection hasBodyWrapper={false}>
<Content>
<Content component="h1">Log Detective Results</Content>
{data ? (
<>
<strong>
<TriggerLink trigger={data}>
<TriggerSuffix trigger={data} />
</TriggerLink>
<SHACopy
project_url={data.project_url}
commit_sha={data.commit_sha}
/>
</strong>
<br />
</>
) : null}
</Content>
</PageSection>
<PageSection hasBodyWrapper={false}>
Expand Down Expand Up @@ -212,6 +228,12 @@ export const LogDetectiveResult = () => {
{data.analysis_id}
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Target arch</DescriptionListTerm>
<DescriptionListDescription>
{data.chroot}
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Status</DescriptionListTerm>
<DescriptionListDescription>
Expand Down
59 changes: 27 additions & 32 deletions frontend/src/components/logdetective/LogDetectiveResultsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ export const LogDetectiveResultsTable = () => {
const columnNames = {
forge: "Forge",
trigger: "Trigger",
packit_id: "Packit ID",
analysisId: "Analysis ID",
target: "Target",
packitId: "Packit ID",
targets: "Targets",
commitSha: "Commit SHA",
timeSubmitted: "Time Submitted",
};
Expand All @@ -45,25 +44,22 @@ export const LogDetectiveResultsTable = () => {
);

const TableHeads = [
<Th key={columnNames.forge} width={10}>
<Th key={columnNames.forge} width={5}>
{columnNames.forge}
</Th>,
<Th key={columnNames.trigger} width={15}>
{columnNames.trigger}
</Th>,
<Th key={columnNames.packit_id} width={10}>
{columnNames.packit_id}
<Th key={columnNames.packitId} width={5}>
{columnNames.packitId}
</Th>,
<Th key={columnNames.analysisId} width={15}>
{columnNames.analysisId}
<Th key={columnNames.targets} width={50}>
{columnNames.targets}
</Th>,
<Th key={columnNames.target} width={15}>
{columnNames.target}
</Th>,
<Th key={columnNames.commitSha} width={15}>
<Th key={columnNames.commitSha} width={10}>
{columnNames.commitSha}
</Th>,
<Th key={columnNames.timeSubmitted} width={15}>
<Th key={columnNames.timeSubmitted} width={10}>
{columnNames.timeSubmitted}
</Th>,
];
Expand All @@ -90,36 +86,35 @@ export const LogDetectiveResultsTable = () => {
<Tr>{TableHeads}</Tr>
</Thead>
<Tbody>
{data?.map((log_detective_result) => (
<Tr key={log_detective_result.packit_id}>
{data?.map((group) => (
<Tr key={group.packit_id}>
<Td dataLabel={columnNames.forge}>
<ForgeIcon url={log_detective_result.project_url} />
<ForgeIcon url={group.project_url} />
</Td>
<Td dataLabel={columnNames.trigger}>
<strong>
<TriggerLink trigger={log_detective_result}>
<TriggerSuffix trigger={log_detective_result} />
<TriggerLink trigger={group}>
<TriggerSuffix trigger={group} />
</TriggerLink>
</strong>
</Td>
<Td dataLabel={columnNames.packit_id}>
{log_detective_result.packit_id}
</Td>
<Td dataLabel={columnNames.analysisId}>
{log_detective_result.analysis_id}
</Td>
<Td dataLabel={columnNames.target}>
<StatusLabel
status={log_detective_result.status}
target={log_detective_result.chroot}
link={`/jobs/log-detective/${log_detective_result.packit_id}`}
/>
<Td dataLabel={columnNames.packitId}>{group.packit_id}</Td>
<Td dataLabel={columnNames.targets}>
{group.log_detective_targets.map((target) => (
<span key={target.id}>
<StatusLabel
status={target.status}
target={target.target_arch}
link={`/jobs/log-detective/${target.id}`}
/>
</span>
))}
</Td>
<Td dataLabel={columnNames.commitSha}>
{log_detective_result.commit_sha}
{group.commit_sha?.slice(0, 7)}

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'm wondering whether we could use the SHACopy component here. This just displays the commit SHA, but using SHACopy would create a clickable button next to it to enable users to copy it to clipboard very easily.

It is used for example here (both the trigger and commit SHA are below the "Koji Build Results" title)
https://dashboard.packit.dev/jobs/koji/46990

It might be nice to do this similarly for the "Log Detective Results" (to display both the trigger and commit SHA below the title), but I'm fine with keeping it the way it is if that's the visual look that what you prefer.

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.

agreed

</Td>
<Td dataLabel={columnNames.timeSubmitted}>
<Timestamp stamp={log_detective_result.submitted_time} />
<Timestamp stamp={group.submitted_time} />
</Td>
</Tr>
))}
Expand Down
28 changes: 0 additions & 28 deletions frontend/src/queries/logdetective/logDetectiveGroup.ts

This file was deleted.

17 changes: 0 additions & 17 deletions frontend/src/queries/logdetective/logDetectiveGroupQuery.ts

This file was deleted.

Loading
Loading