Skip to content

Ensure that stage name and record are in sync for page deployments

What does this MR do and why?

Related to gitlab-com/gl-infra/production#7774 (closed)

We use GenericCommitStatus for showing page deployments in the pipeline's tab and we're in the process of migrating the ci_builds.stage column to the ci_stages table. A recent change introduced a discrepancy between those two values:

gitlabhq_dblab=# select id, name, stage, stage_id from ci_builds where id in(3046420005, '3052314243');
     id     |     name     |  stage   |  stage_id
------------+--------------+----------+------------
 3046420005 | pages:deploy | external | 1366573933
 3052314243 | pages:deploy | external | 1369172135
(2 rows)

gitlabhq_dblab=# select id, name from ci_stages where id in (1366573933, 1369172135);
     id     |  name
------------+--------
 1366573933 | deploy
 1369172135 | deploy
(2 rows)

For the GraphQL endpoint we batch load the stages by names their names and because we don't have the external stage present in the ci_stages table, the stage will be returned as NULL.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marius Bobin

Merge request reports

Loading