Skip to content

Display failure_category/failure_subcategory in Lookout UI#4853

Merged
dejanzele merged 1 commit intoarmadaproject:masterfrom
dejanzele:slim-failure-read
Apr 23, 2026
Merged

Display failure_category/failure_subcategory in Lookout UI#4853
dejanzele merged 1 commit intoarmadaproject:masterfrom
dejanzele:slim-failure-read

Conversation

@dejanzele
Copy link
Copy Markdown
Member

@dejanzele dejanzele commented Apr 21, 2026

Reads the flat failure_category and failure_subcategory columns added in #4843 instead of the failure_info jsonb blob. Updates the querybuilder SQL, the internal Go model, swagger and its generated code, the conversion layer, and the jobs sidebar.

Depends on #4843.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR replaces the failure_info JSON blob in the job_run table with the two flat string columns failure_category and failure_subcategory introduced in #4843. Changes span the SQL query builder, the internal Go Run model and its swagger-generated counterpart, the conversion layer, and the React UI (sidebar and jobs-table columns).

Confidence Score: 5/5

Safe to merge — the refactor is straightforward, all layers are updated consistently, and no correctness issues were found.

All findings are P2 or below. The SQL, Go model, swagger/codegen, conversion, and UI layers are updated in lock-step. JSON null handling via json_strip_nulls is correct, omitempty tags are properly applied, and the ensurePreferencesAreConsistent migration path handles users with the old errorCategories column ID.

No files require special attention.

Important Files Changed

Filename Overview
internal/lookout/repository/querybuilder.go SQL json_build_object updated to select failure_category and failure_subcategory flat columns; json_strip_nulls handles NULL DB values correctly so Go zero-values are populated as empty strings.
internal/lookout/conversions/convert.go Removed failureInfoToSwagger helper; now maps flat FailureCategory/FailureSubcategory string fields directly — clean and correct.
internal/lookout/gen/models/run.go Generated model updated: RunFailureInfo struct and its validation/context methods removed; new string fields have correct omitempty tags matching the x-omitempty swagger annotation.
internal/lookoutui/src/common/jobsTableColumns.tsx ErrorCategories column split into two separate columns (FailureCategory, FailureSubcategory) with enableColumnFilter: false; all maps/enums updated consistently.
internal/lookoutui/src/pages/jobs/components/sidebar/JobRunDetails.tsx Sidebar updated to display Failure Category and Failure Subcategory rows; exitCode display retained; old containerName and terminationMessage fields intentionally dropped as those came from the removed JSON blob.

Sequence Diagram

sequenceDiagram
    participant DB as PostgreSQL (job_run)
    participant QB as QueryBuilder
    participant GJ as GetJobs handler
    participant CV as conversions.ToSwaggerRun
    participant UI as Lookout UI

    DB->>QB: failure_category, failure_subcategory columns
    QB->>QB: json_build_object with failureCategory/failureSubcategory keys
    QB->>QB: json_strip_nulls (removes NULL cols)
    QB->>GJ: JSON runs array
    GJ->>GJ: json.Unmarshal into model.Run{FailureCategory, FailureSubcategory}
    GJ->>CV: *model.Run
    CV->>UI: models.Run{FailureCategory: string, FailureSubcategory: string}
    UI->>UI: JobRun.failureCategory / .failureSubcategory
    UI->>UI: JobRunDetails sidebar rows
    UI->>UI: FailureCategory + FailureSubcategory table columns
Loading

Reviews (9): Last reviewed commit: "Display failure_category/failure_subcate..." | Re-trigger Greptile

@dejanzele
Copy link
Copy Markdown
Member Author

@greptileai

Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
@dejanzele dejanzele merged commit 7b59c02 into armadaproject:master Apr 23, 2026
17 checks passed
dejanzele added a commit that referenced this pull request Apr 29, 2026
Drops the failure_info jsonb column from job_run. Nothing writes or
reads it after #4843 and #4853, and the column was never populated in
production outside the opt-in flag path anyway.

Also drops the unused FailureInfo field from the queryapi sqlc model.

Only merge after #4843 and #4853 have been deployed long enough that we
are sure no consumer still depends on the column.

Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
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.

2 participants