Skip to content

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

Availability and Testing

Related to #336590 (closed)

Edited by Adam Cohen

Merge request reports

Loading