Skip to content

Deploy freeze: show informative messages when deploy freeze is configured

Release notes

With this update, GitLab shows you a message on the Deployment pages during a deploy freeze period. This helps ensure the team is made aware of when these freezes are occurring and when deployments are not allowed.

https://docs.gitlab.com/ee/user/project/releases/#prevent-unintentional-releases-by-setting-a-deploy-freeze

Problem to solve

#24295 (closed) introduces Deployment Freezes on a project level. This issue is a follow up of the MVC, we need to extend visibility throughout the application. This proposal intends to allow users to see informative messages on GitLab UI when a deployment freeze is set.

Intended users

Further details

Proposal

As a user, I want to be informed when a deploy freeze is active for my project in GitLab, so that I can stay up to date with the status of production deployments.

Once a deployment freeze is set, an informative messages will be displayed on the environment details/deployments page.

Backend Proposal

Extend Environment field on GraphQL API to expose deploy_freeze.

projects(fullPath: `gitlab-org/gitlab`) {
  environment(name: "production") {
    deploy_freeze {        // List - Freeze periods can exist more than one. 
      status               // Enum: Active/Inactive
      start_cron           // String
      end_cron             // String
      start_date           // Datetime
      end_date             // Datetime
    }
  }
}

For the performance optimization, backend implement one of the following thing:

  • Memoize the result of deploy_freeze and avoid duplicate computation across multiple environments. We can use Gitlab::SafeRequestStore for this purpose. OR,
  • Use Limit::FieldCallCount, limit: 1 to deploy_freeze field because we don't need to fetch for multiple environments in this issue.

Frontend proposal

As this MR focuses on the deployments page, we can use the above query to easily fetch whether or not a freeze is on, and display the alert as in the UI using GlAlert.

We can also use the utilities in app/assets/javascripts/lib/utils/datetime/date_format_utility.js to format the date appropriately, use GlLink for the link to documentation, and use GlSprintf to interpolate everything together.

UX Proposal

On project/-/environments/xyz, if an environment has deployment freeze configured, a non-dismissable info Alert message is displayed to inform users of the freeze period, as well as a link to the documentation. The date format should be translated to GitLab’s defaults (ISO 8601) in the UI.

Alert
Screen_Shot_2022-11-22_at_1.40.39_PM
  • Content: A deploy freeze is in effect from <date+time> until <date+time>. Deployments might not succeed during this time. What is a deploy freeze?

Figma File

Out of Scope for MVC:

Tooltip

We will inform users of the deploy freeze via seeing the status of the pipeline (skipped). By hovering the status label/element, an informative tooltip should be displayed explaining why the environment is skipped.

Merge request view

We will inform users of the deploy freeze via seeing the status of the pipeline (skipped). By hovering the status label/element, an informative tooltip should be displayed explaining why the environment is skipped.

A helper text is also added to the footer of the pipeline section on the Merge Request page, with an informative message about the deployment freeze duration, as well as a link to the documentation. The date format should be translated to GitLab’s defaults (ISO 8601) in the UI.

Permissions and Security

Documentation

If configuration of notifications/banners is needed we will need to update documentation

Availability & Testing

What does success look like, and how can we measure that?

People are successfully informed of deployment freezes.

People set and continue to use deploy freezes - I would like to have a periscope dashboard for usage of deploy freezes.

What is the type of buyer?

Starter+ maybe?

Is this a cross-stage feature?

Links / references

Edited by Viktor Nagy (GitLab)