MR Pipeline should run tests against PG12 when changing database files
Currently our MR pipelines do not run tests against PG12, even though it is being used by some users. This is typically safe since most application code is touching the database at an abstracted level, where the database behaves the same across major versions.
Much of the database-specific code under lib/gitlab/database
interacts with the database through less public API like the system catalog, which does change between major versions. On a couple occasions we have merged MRs, only to have them cause other pipeline failures later when the tests were run against PG12.
Going forward, a change to any files under the database directory (or the matching spec
directory) should trigger the MR pipeline to also run tests against all officially supported PG versions.
Proposal
- Add
{,ee/}spec/support/helpers/database/**/*
to.db-patterns
- Add a new
.db-lowlevel-patterns
pattern config for the following file regexs:"{,ee/}{,spec/}lib/{,ee/}gitlab/database/**/*"
,"{,ee/}{,spec/}lib/{,ee/}gitlab/database{,_spec}.rb"
,"{,ee/}spec/support/helpers/database/**/*"
- Add a new
rspec db-lowlevel-code pg12
job that runs tests for low-level DB code against PG12 (note that these are already tested against PG11 in therspec unit pg11
/rspec-ee unit pg11
jobs).