Filter out Releases with missing tags
What does this MR do?
As identified in https://gitlab.com/gitlab-org/gitlab/-/issues/211988 there are Release entries in gitlab.com (and possibly self-hosted instances) with a NULL
value for releases.tag
. This is causing the Releases page to error.
The tag is an essential piece of information and used in multiple places. This MR removes rows with missing tags from a single location in the code - the ReleaseFinder
. Using a where.not
will most likely force a table scan on releases
, but the alternative is to change the code in many places to 'code around' this issue.
There are ~910285 releases
rows on gitlab.com.
This is a temporary measure until https://gitlab.com/gitlab-org/gitlab/-/issues/211988 is actioned to properly clean up this erroneous data.
DB benchmark
explain select * from releases where tag IS NOT NULL and project_id = 278964;
Time: 11.910 ms
- planning: 0.123 ms
- execution: 11.787 ms
- I/O read: 11.549 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 0 from the buffer pool
- reads: 6 (~48.00 KiB) from the OS file cache, including disk I/O
- dirtied: 0
- writes: 0
Plan: https://explain.depesz.com/s/hDk8
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Closes #211394 (closed)