Skip to content

Drop failure_info column from job_run table#4855

Merged
dejanzele merged 1 commit intoarmadaproject:masterfrom
dejanzele:slim-failure-drop-column
Apr 29, 2026
Merged

Drop failure_info column from job_run table#4855
dejanzele merged 1 commit intoarmadaproject:masterfrom
dejanzele:slim-failure-drop-column

Conversation

@dejanzele
Copy link
Copy Markdown
Member

@dejanzele dejanzele commented Apr 21, 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.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR completes the removal of the failure_info jsonb column from the job_run table by adding a lookout migration (033), removing it from the consolidated lookouthc initial schema, and dropping the corresponding field from the sqlc-generated Go model and queries. The previous P1 concern about failure_info still being present in lookouthc/001_initial_schema.sql has been addressed in this PR.

Confidence Score: 5/5

Safe to merge once prerequisite PRs (#4843, #4853) have been deployed; all four changed files are consistent and correct.

Clean, narrow column-removal change. Migration uses IF EXISTS, generated SQL explicitly omits failure_info (safe to deploy before migration), and both DB stacks (lookout incremental + lookouthc consolidated) are updated consistently. No logic errors, security concerns, or missing side-effects found.

No files require special attention.

Important Files Changed

Filename Overview
internal/lookout/schema/migrations/033_drop_failure_info_from_job_run.sql New migration that safely drops the failure_info column using IF EXISTS; correctly sequenced after 031 (add) and 032 (add category).
internal/lookouthc/schema/migrations/001_initial_schema.sql Consolidated (single-file) schema for lookouthc updated to remove failure_info column, keeping it consistent with the lookout migration path; no separate migration needed since this is the only schema file for lookouthc.
internal/server/queryapi/database/models.go Removes FailureInfo []byte field from JobRun struct, consistent with the schema change.
internal/server/queryapi/database/query.sql.go Regenerated sqlc output removes failure_info from both GetJobRunsByJobIds and GetJobRunsByRunIds SELECT lists and scan targets; explicit column list means safe to deploy before or after migration runs.

Sequence Diagram

sequenceDiagram
    participant Dev as Deploy Pipeline
    participant LO as Lookout DB (incremental)
    participant LOHC as LookoutHC DB (fresh)
    participant App as QueryAPI (Go)

    Note over Dev: After #4843 & #4853 deployed
    Dev->>LO: Run migration 033_drop_failure_info_from_job_run.sql
    LO-->>Dev: ALTER TABLE job_run DROP COLUMN IF EXISTS failure_info ✓
    Dev->>LOHC: Fresh deploy uses 001_initial_schema.sql (no failure_info)
    LOHC-->>Dev: Schema created without failure_info ✓
    Dev->>App: Deploy updated binary (models.go + query.sql.go)
    App->>LO: SELECT run_id,...,ingress_addresses,failure_category,failure_subcategory FROM job_run
    LO-->>App: Rows without failure_info ✓
    App->>LOHC: Same explicit SELECT (no failure_info)
    LOHC-->>App: Rows without failure_info ✓
Loading

Reviews (8): Last reviewed commit: "Drop failure_info column from job_run ta..." | Re-trigger Greptile

@dejanzele
Copy link
Copy Markdown
Member Author

@greptileai

@dejanzele dejanzele force-pushed the slim-failure-drop-column branch 2 times, most recently from b9bd686 to e4cddc6 Compare April 28, 2026 14:14
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
@dejanzele dejanzele force-pushed the slim-failure-drop-column branch from e4cddc6 to bb7f431 Compare April 29, 2026 13:16
@dejanzele dejanzele merged commit c56104d into armadaproject:master Apr 29, 2026
18 checks passed
YHines004 pushed a commit that referenced this pull request May 4, 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>
Signed-off-by: Yasmine Hines <yhines004@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