Skip to content
Merged
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
4 changes: 2 additions & 2 deletions lnt/util/convert_v4_mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
_METRIC_BUILTINS = {'run_id', 'test_id', 'repetition', 'machine_id'}
_MACHINE_FIELD_BUILTINS = {'id', 'name', 'display_name', 'tracked',
'first_seen_at', 'delete_after_inactive_days'}
_COMMIT_FIELD_BUILTINS = {'id', 'commit', 'ordinal', 'tag', 'first_seen_at',
'delete_after_inactive_days'}
_COMMIT_FIELD_BUILTINS = {'id', 'commit', 'ordinal', 'tag', 'branch',
'first_seen_at', 'delete_after_inactive_days'}

# The length v5 allows for machine names, commit values and test names.
_IDENTIFIER_MAX = 256
Expand Down
4 changes: 3 additions & 1 deletion tests/lnttool/convert-v4-mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,15 @@ def metric_id(schema):
def reserved_commit_fields(schema):
schema['commit_fields'] = [
{'name': 'first_seen_at', 'type': 'datetime'},
{'name': 'delete_after_inactive_days', 'type': 'integer'}]
{'name': 'delete_after_inactive_days', 'type': 'integer'},
{'name': 'branch', 'type': 'text'}]


run_cli(override_mirror, '--suite', 'nts', '--target-suite', 'target',
'--schema', override('reserved-commit-fields', reserved_commit_fields))
# CHECK: error: commit_fields entry 'first_seen_at': the name is reserved by v5
# CHECK-NEXT: error: commit_fields entry 'delete_after_inactive_days': the name is reserved by v5
# CHECK-NEXT: error: commit_fields entry 'branch': the name is reserved by v5
# CHECK-NEXT: written: {{[0-9]+}}, exit: 1


Expand Down
4 changes: 2 additions & 2 deletions v5/client/src/api/commits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export function resolvedCommitKey(suite: SuiteRef, value: string) {

/** `detail`, without its neighbours: the commit as a list or `commits/resolve` gives it. */
export function withoutNeighbours(detail: Schemas['CommitDetail']): Commit {
const { value, ordinal, tag, delete_after_inactive_days, fields } = detail
return { value, ordinal, tag, delete_after_inactive_days, fields }
const { value, ordinal, tag, branch, delete_after_inactive_days, fields } = detail
return { value, ordinal, tag, branch, delete_after_inactive_days, fields }
}

/** Store `detail` as the commit resolved, which a page about it then need not ask for again. */
Expand Down
126 changes: 90 additions & 36 deletions v5/client/src/api/schema.d.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions v5/client/src/api/series.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const pointAt = (commit: string, ordinal: number, value: number): Schemas['DataP
submitted_at: '2026-08-25T14:22:41Z',
measured_at: '2026-08-25T14:22:41Z',
tag: null,
branch: null,
})

describe('fetchSeries', () => {
Expand Down
1 change: 1 addition & 0 deletions v5/client/src/components/combobox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ function commit(value: string, shortSha: string | null = null): Commit {
value,
ordinal: null,
tag: null,
branch: null,
delete_after_inactive_days: null,
fields: { short_sha: shortSha },
}
Expand Down
1 change: 1 addition & 0 deletions v5/client/src/pages/graph/graph-world.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const pointOf = (
submitted_at: '2026-08-25T14:22:41Z',
measured_at: measuredAt,
tag: null,
branch: null,
}) satisfies Schemas['DataPoint']

/** What the page asked of the API. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('nameProblems', () => {
for (const name of ['machine_id', 'repetition', 'test_id']) {
expect(problemOf('metrics', name)).toBeDefined()
}
for (const name of ['id', 'commit', 'ordinal', 'tag']) {
for (const name of ['id', 'commit', 'ordinal', 'tag', 'branch']) {
expect(problemOf('commit_fields', name)).toBeDefined()
}
for (const name of ['id', 'name', 'tracked', 'display_name']) {
Expand Down
10 changes: 9 additions & 1 deletion v5/client/src/pages/test-suites/schema/schema-lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@ export const LIST_INFO: Record<ListName, ListInfo> = {
noun: 'commit field',
keys: ['display_name', 'searchable', 'display', 'listed'],
type: 'text',
reserved: ['commit', 'delete_after_inactive_days', 'first_seen_at', 'id', 'ordinal', 'tag'],
reserved: [
'branch',
'commit',
'delete_after_inactive_days',
'first_seen_at',
'id',
'ordinal',
'tag',
],
},
machine_fields: {
heading: 'Machine Fields',
Expand Down
1 change: 1 addition & 0 deletions v5/client/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export function displayValueOf(
value,
ordinal: null,
tag,
branch: null,
delete_after_inactive_days: null,
fields: {},
}
Expand Down
2 changes: 2 additions & 0 deletions v5/client/src/test/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export function commit(value: string, overrides: Partial<Commit> = {}): Commit {
value,
ordinal: null,
tag: null,
branch: null,
delete_after_inactive_days: null,
fields: { svn_revision: null, commit_info: null },
...overrides,
Expand Down Expand Up @@ -207,6 +208,7 @@ export function trendPoint(
ordinal,
measured_at: '2026-08-25T14:22:41Z',
tag: null,
branch: null,
value,
...overrides,
}
Expand Down
20 changes: 11 additions & 9 deletions v5/docs/design/client/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,12 @@ machine, with only this run selected (`runs_a={uuid}`), and the metric selected
the commit before it on the same machine: side A is the previous commit (see below) on this
run's machine, with all of its runs, side B is this run's commit and machine with only this
run selected (`runs_b={uuid}`), and the metric is the one selected on this page. The previous
commit is the one with the nearest lower ordinal at which this machine has runs
(`GET commits?machine={name}&before_commit={value}&sort=-ordinal&limit=1`), not the commit's
`previous` neighbour, which may have no runs on this machine. The button is disabled, with a
tooltip saying why, when the run's commit has no ordinal or the machine has no earlier commit,
and while the previous commit is being looked up or could not be.
commit is the one on the same branch with the nearest lower ordinal at which this machine has
runs (`GET commits?machine={name}&before_commit={value}&sort=-ordinal&limit=1`, whose bound keeps
only the commit's branch, see E3), not the commit's `previous` neighbour, which may have no runs
on this machine. The button is disabled, with a tooltip saying why, when the run's commit has no
ordinal or the machine has no earlier commit on its branch, and while the previous commit is
being looked up or could not be.

Both are links, so a modified click opens the comparison in a new tab (see AR2 "Routing"),
unless "Compare with previous commit" is disabled (see AR8).
Expand Down Expand Up @@ -322,9 +323,9 @@ cleared.

### Navigation

Previous / next buttons allow navigating to the previous or next commit based on ordinals.
Each is greyed out when there is no such commit: when the commit has no ordinal, and at
either end of the ordered range.
Previous / next buttons allow navigating to the previous or next commit on the same branch
based on ordinals (see E3). Each is greyed out when there is no such commit: when the commit has
no ordinal, and at either end of its branch's ordered range.

"View on {label}" (see AR20) follows them, as a button like them. The changes since the previous
commit are left to the Graph and Compare pages.
Expand Down Expand Up @@ -360,7 +361,8 @@ Each row has a "Compare with previous" link, which does what the Run Detail page
with previous commit" does for that row's run (see DT2). Since this page has no metric
selector, the link carries the metric Run Detail would select by default. The previous commit
is looked up once per machine rather than once per run. The link is disabled, with a tooltip
saying why, when this commit has no ordinal or the row's machine has no earlier commit.
saying why, when this commit has no ordinal or the row's machine has no earlier commit on its
branch.


## DT4: Regression Detail -- `/projects/{p}/suites/{s}/regressions/{uuid}`
Expand Down
31 changes: 25 additions & 6 deletions v5/docs/design/server/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ v5 "Commit" concept separates them.
`"experiment-vectorizer-v2"`), and it is the commit's identity. By default
the UI also displays it, but a `commit_field` marked `display: true`
overrides what is shown (see D4). Every run must have a commit.
- **Ordinal**: an optional integer that places the commit in a total order. It
can be set inline in a run submission, at creation via
- **Ordinal**: an optional integer that places the commit in the total order of
its branch. It can be set inline in a run submission, at creation via
`POST /api/projects/{project}/suites/{suite}/commits`, or at any later time
via PATCH. It is never inferred from the commit string, even if the string is
numeric. `NULL` means unordered.
- **Branch**: an optional free-form string naming the line of history the
commit is on, such as `main` or `release/19.x`, set in the same ways as the
ordinal. Ordinals only order the commits of one branch: two commits on
different branches may have the same ordinal, and what comes before or after
a commit (its neighbours, a range of commits) is only looked for on its own
branch. The commits without a branch behave as one branch of their own. The
branch is an attribute of the commit, not part of its identity: the commit
string stays unique across the suite, and still addresses the commit alone. A
commit reachable from several branches, such as a branch point, is on only
one of them. Nothing relates branches to each other.

Runs therefore come in two tiers:
1. A run on an ordered commit (ordinal set) takes full part in time series.
Expand Down Expand Up @@ -571,17 +581,26 @@ and the tables below are named that way.
|--------|------|-------------|
| id | INTEGER | PK |
| commit | VARCHAR(256) | unique, not null |
| ordinal | INTEGER | nullable, unique |
| ordinal | INTEGER | nullable, indexed |
| tag | VARCHAR(256) | nullable, indexed (partial: WHERE tag IS NOT NULL) |
| branch | VARCHAR(256) | nullable |
| first_seen_at | TIMESTAMP WITH TIME ZONE | not null, default `now()` |
| delete_after_inactive_days | INTEGER | nullable, between 1 and 36500, indexed (partial: WHERE delete_after_inactive_days IS NOT NULL) |
| _(dynamic)_ | per commit_fields | nullable |

- `commit` is the identity string, submitted as `commit.value` (see O1).
- `ordinal` has a regular unique constraint.
- `(branch, ordinal)` has a regular unique index, `NULLS NOT DISTINCT` and
partial (`WHERE ordinal IS NOT NULL`): ordinals are unique within a branch,
the commits without a branch counting as one, and any number of commits of a
branch may have no ordinal (see O6). It is also what the lookups by ordinal
within a branch use. `ordinal` has an index of its own, for listing the
commits of every branch by ordinal (see E3).
- `tag` is an optional human-readable label (e.g. `release-18.1`), which can be
set on every commit write path (see O2). Several commits may share a tag. The
tag is always included in `?search=` substring matching (see O4).
- `branch` is the line of history the commit is on (see D1), which can be set
on every commit write path (see O2). Like the tag, it is always included in
`?search=` substring matching (see O4).
- `first_seen_at` is when the server created the commit, from the database's
clock. It is internal: no API response includes it. O10 counts it as
activity. It is not what E3's `first_seen` order sorts by: that order is
Expand All @@ -598,8 +617,8 @@ and the tables below are named that way.
regressions attributed to it are kept, with no commit (see
`{suite}.regression`).
- `commit_fields` names must not collide with the built-in column names (`id`,
`commit`, `ordinal`, `tag`, `first_seen_at`, `delete_after_inactive_days`);
the schema parser rejects them.
`commit`, `ordinal`, `tag`, `branch`, `first_seen_at`,
`delete_after_inactive_days`); the schema parser rejects them.

#### `{suite}.machine`

Expand Down
Loading
Loading