Skip to content

Commit

Permalink
Modify flakes table for jobs
Browse files Browse the repository at this point in the history
This adds a generated column for extracting the version from the job
name. It will read anything that matches `PG<number><alphanumeric>` or
`PG<number>.<number>` and generate a version string. If the first
pattern matches, it will generate `<number>.x` as string, signifying
that this is an unknown minor version.
  • Loading branch information
mkindahl committed Dec 5, 2024
1 parent f1d201e commit 71d0d66
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions scripts/upload_ci_stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ create table job(
url text,
run_attempt int,
run_id bigint,
run_number int
run_number int,
pg_version text generated always as (
regexp_replace(
substring(job_name from 'PG([0-9]+[.a-z0-9]*)'),
'^([0-9]+)(snapshot)?$',
'\1.x')
) stored
);
create unique index on job(job_date);
Expand Down Expand Up @@ -75,7 +81,13 @@ JOB_NAME="${JOB_NAME:-test-job}"
export JOB_NAME

JOB_DATE=$("${PSQL[@]}" -c "
insert into job values (
insert into job(
job_date, commit_sha, job_name,
repository, ref_name, event_name,
pr_number, job_status,
url,
run_attempt, run_id, run_number
) values (
now(), '$COMMIT_SHA', '$JOB_NAME',
'$GITHUB_REPOSITORY', '$GITHUB_REF_NAME', '$GITHUB_EVENT_NAME',
'$GITHUB_PR_NUMBER', '$JOB_STATUS',
Expand Down

0 comments on commit 71d0d66

Please sign in to comment.