CI: Reduce MR test matrix to speed up pipelines
Problem
The bash-test jobs run on self-hosted shell runners with only 2 runners available. This creates a catastrophic bottleneck:
- 10 bash-test jobs (PG 9.6 through 18) all compete for 2 runners
- Queue times reach up to 19+ minutes for later jobs
- Total queue time: ~35 minutes for jobs that only take ~5 minutes each
Analysis
| Job | Queue Time | Actual Duration |
|---|---|---|
| bash-test-9-6 | 0.3s | 320s |
| bash-test-16 | 0.7s | 297s |
| bash-test-10 | 297s | 232s |
| bash-test-11 | 320s | 296s |
| bash-test-12 | 529s | 267s |
| bash-test-13 | 616s | 283s |
| bash-test-14 | 795s | 286s |
| bash-test-15 | 898s | 268s |
| bash-test-17 | 1084s | 259s |
| bash-test-18 | 1168s | 237s |
Solution
Reduce the test matrix for MR pipelines from 10 versions to 2 versions (PG 16 + PG 17):
- PG 16: Latest stable version
- PG 17: Latest development version
Full test matrix (all 10 versions) will only run on:
- Main branch commits
- Tag releases
Expected Impact
- ~80% reduction in queue time (~28 minutes saved per MR pipeline)
- Faster developer feedback
- Same test coverage on main branch
Labels
ci, performance
Acceptance Criteria
- MR pipelines run a reduced test matrix of 2 PostgreSQL versions (PG 16 + PG 17) instead of all 10 versions (PG 9.6 through 18)
- Main branch commits and tag releases continue to run the full 10-version test matrix
- Expected pipeline time reduction: ~80% less queue time (~28 minutes saved per MR pipeline)
- CI configuration clearly documents which conditions trigger full vs. reduced test matrix
Definition of Done
-
.gitlab-ci.ymlupdated with conditional test matrix logic (rules for MR vs. main/tag) - MR pipeline verified to run only PG 16 + PG 17 bash-test jobs
- Main branch pipeline verified to run all 10 PostgreSQL version jobs
- No test coverage regression on main branch (all versions still tested before release)
- Pipeline time improvements measured and documented
Edited by Nikolay Samokhvalov