Skip to content

Blob refactor: Display environment button

Jacques Erasmus requested to merge 350457-display-environment-button into master

What does this MR do and why?

Display a View on Environment button in the refactored blob viewer when an environment is available.

Note, changes in this MR are behind the :refactor_blob_viewer feature flag.

Screenshots or screen recordings

Screenshot_2022-01-24_at_10.24.48

Raw SQL

SELECT
  "environments".*
FROM
  "environments"
WHERE
  "environments"."project_id" = 278964
  AND ("environments"."state" IN ('available'))
  AND (EXISTS (
      SELECT
        "deployments".*
      FROM
        "deployments"
      WHERE
        "deployments"."sha" = '504b5311c00ac2b87ba728d74925c6f46e6c5781'
        AND (environment_id = environments.id)))
ORDER BY
  (
    SELECT
      MAX("deployments"."id")
    FROM
      "deployments"
    WHERE
      "deployments"."environment_id" = "environments"."id") ASC NULLS FIRST;

How to set up and validate locally

  1. Enable the Blob Viewer Refactor feature flag
Feature.enable(:refactor_blob_viewer)
  1. Deploy an environment

  2. Open a file in the repository file browser on the branch that has been deployed to the environment

MR acceptance checklist

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

Related to #350457 (closed)

Edited by Jacques Erasmus

Merge request reports

Loading