Skip to content

Fix related environments on pipeline

Shinya Maeda requested to merge fix-environment-query-on-pipeline into master

What does this MR do and why?

In !71894 (merged), we've fixed the environments_in_self_and_descendants for DB decomposition. However, since the new query fetches an empty environment, it could result in 500 error or unexpected UX issue. This MR fixes the problem to fetch non-empty environments, just like it used to be.

Close #345659 (closed)

Screenshots or screen recordings

Before the fix (avoid_cross_joins_environments_in_self_and_descendants must be enabled)

Peek_2021-11-15_11-49

After the fix

Peek_2021-11-15_12-04

How to set up and validate locally

Run a pipeline with the following change:

build-deployment:
  script: echo
  environment:
    name: production
    action: prepare    # This does not create a deployment record, but only environment record.

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 Shinya Maeda

Merge request reports

Loading