Skip to content

Show Holt-Winters forecast for Deployment Frequency

Ezekiel Kigbo requested to merge 409875-show-holt-winters-forecast into master

What does this MR do and why?

This MR adds support for the holt winters forecasting model in the Deployment Frequency charts. This model will replace the linear regression method introduced in https://gitlab.com/gitlab-org/gitlab/-/issues/403630+.

This MR:

  • Adds the use_holt_winters_forecast_for_deployment_frequency feature flag to toggle between holt winters and linear regression
  • Adds a loading state while the forecast is being built
  • Adds error states for the reqest failure, or a poor forecast
  • Minor refactor of when the request was made to ensure we only request a forecast after the terms are agreed

Screenshots or screen recordings

Before / After

Feature flag disabled Feature flag enabled
Screen_Recording_2023-07-25_at_12.48.33_pm Screen_Recording_2023-07-12_at_5.57.06_pm

Error states

Error - Poor forecast Error - Request failure
Screen_Recording_2023-07-12_at_5.47.36_pm Screen_Recording_2023-07-12_at_5.50.07_pm

How to set up and validate locally

You will need to enable 2 feature flags

dora_charts_forecast # group
use_holt_winters_forecast_for_deployment_frequency # per project
  1. Seed data for your project
  2. Enable dora_charts_forecast for the group
    Feature.enable(:dora_charts_forecast,  Group.find(GROUP_ID))
  3. Enable use_holt_winters_forecast_for_deployment_frequency for the project
    Feature.enable(:use_holt_winters_forecast_for_deployment_frequency,  Project.find(PROJECT_ID))
  4. Browse to http://{local-instance}/{project-path}/-/pipelines/charts?chart=deployment-frequency
  5. Click the toggle

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 #409875 (closed)

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/412354

Edited by Ezekiel Kigbo

Merge request reports