Skip to content

feat: add terminated generated column to runs table and optimize join queries#4642

Merged
dejanzele merged 2 commits intoarmadaproject:masterfrom
dejanzele:feat/add-runs-terminated-column
Jan 29, 2026
Merged

feat: add terminated generated column to runs table and optimize join queries#4642
dejanzele merged 2 commits intoarmadaproject:masterfrom
dejanzele:feat/add-runs-terminated-column

Conversation

@dejanzele
Copy link
Member

@dejanzele dejanzele commented Jan 29, 2026

What type of PR is this?

Enhancement

What this PR does / why we need it

Added a terminated auto-generated column to the runs table, computed as cancelled OR succeeded OR failed. The jobs table already had this pattern.

This consolidates terminal-state checks into a single column, eliminating the risk of queries checking an inconsistent subset of booleans.

Join queries were also updated to filter on the runs table before joining to jobs, and new indexes on terminated replace the old multi-boolean indexes.

Which issue(s) this PR fixes

Fixes #

Special notes for your reviewer

@dejanzele dejanzele force-pushed the feat/add-runs-terminated-column branch 5 times, most recently from 147d252 to 58c9a1d Compare January 29, 2026 14:35
JamesMurkin
JamesMurkin previously approved these changes Jan 29, 2026
… queries

Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
@dejanzele dejanzele enabled auto-merge (squash) January 29, 2026 22:08
@dejanzele dejanzele merged commit 8d666ba into armadaproject:master Jan 29, 2026
15 of 25 checks passed
williamvega added a commit to williamvega/armada that referenced this pull request Jan 30, 2026
commit fb2d1d8
Author: Ian Hockett <32877705+ianhockett@users.noreply.github.com>
Date:   Fri Jan 30 06:04:17 2026 -0600

    fix: mage checkDeps false positive docker suffix (armadaproject#4636)
    Bug fix
    Previously, the mage target `checkDeps` would fail on the docker version
    if there is _any_ suffix. This is the default behavior of the `semver`
    package, which ignores prereleases. This meant that a valid version of
    docker that was using a build _variant_ (rancher desktop, community
    edition, enterprise edition) would fail, even though the version is well
    within the constraint. This change updates the version of the `semver`
    package to `3.4.0` which enables setting `IncludePrerelease` to true on
    the constraints object, which includes prerelease versions in the
    version check.

    Signed-off-by: Ian Hockett <ian@hockett.net>
    Co-authored-by: Maurice Yap <mauriceyap@hotmail.co.uk>

commit 8d666ba
Author: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
Date:   Thu Jan 29 22:15:59 2026 +0000

    feat: add terminated generated column to runs table and optimize join queries (armadaproject#4642)

    <!-- Thanks for sending a pull request! Here are some tips for you: -->

    Enhancement

    Added a `terminated` auto-generated column to the `runs` table, computed
    as `cancelled OR succeeded OR failed`. The `jobs` table already had this
    pattern.

    This consolidates terminal-state checks into a single column,
    eliminating the risk of queries checking an inconsistent subset of
    booleans.

    Join queries were also updated to filter on the `runs` table before
    joining to `jobs`, and new indexes on terminated replace the old
    multi-boolean indexes.
    <!--
    *Automatically closes linked issue when PR is merged.
    Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
    _If PR is about `failing-tests or flakes`, please post the related
    issues/tests in a comment and do not use `Fixes`_*
    -->
    Fixes #

Signed-off-by: williamvega <williamvega1006@gmail.com>
dslear pushed a commit to dslear/armada that referenced this pull request Feb 9, 2026
… queries (armadaproject#4642)

<!-- Thanks for sending a pull request! Here are some tips for you: -->

#### What type of PR is this?

Enhancement

#### What this PR does / why we need it

Added a `terminated` auto-generated column to the `runs` table, computed
as `cancelled OR succeeded OR failed`. The `jobs` table already had this
pattern.

This consolidates terminal-state checks into a single column,
eliminating the risk of queries checking an inconsistent subset of
booleans.

Join queries were also updated to filter on the `runs` table before
joining to `jobs`, and new indexes on terminated replace the old
multi-boolean indexes.

#### Which issue(s) this PR fixes
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related
issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #

#### Special notes for your reviewer

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.

3 participants