Persist ci_feature_usage when saving artifacts
What does this MR do?
This MR upserts a new record into the project_ci_feature_usages
table when a security_report
artifact is created
Screenshots or Screencasts (strongly suggested)
After running a pipeline on the default branch:
gitlabhq_development=# select * from project_ci_feature_usages;
id | project_id | feature | default_branch
----+------------+---------+----------------
5 | 118 | 2 | t
(1 row)
After running a pipeline on a feature branch:
gitlabhq_development=# select * from project_ci_feature_usages;
id | project_id | feature | default_branch
----+------------+---------+----------------
5 | 118 | 2 | t
9 | 118 | 2 | f
(2 rows)
How to setup and validate locally (strongly suggested)
Run a pipeline for a project which saves security reports, then select from the project_ci_feature_usages
table:
$ gdk psql -d gitlabhq_development
gitlabhq_development=# select * from project_ci_feature_usages;
Todo
Backfill existing entries in the database
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.)
Related to #336590 (closed)
Edited by Adam Cohen