Skip to content

Set default auto_stop_setting for environment

What does this MR do and why?

This MR sets default value for environment.auto_stop_setting.

The default value is:

  • stoppable with action (stop with action) - default when deployment_tier = production | staging
  • stoppable always (auto stop, no need for stop action) - default for all other tier
  • stoppable always for the initial value of every existing environment

See #428625 (comment 2295602633) for more details.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

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

  1. Set up GDK.
  2. Create environment through REST API.
  • It sets auto_stop_setting: with_action for environments with production and staging tier.
$ curl \
-X POST \
--header "PRIVATE-TOKEN: $TOKEN" \
--data "name=staging15" \
"https://gdk.test:3443/api/v4/projects/35/environments" | jq

{
  "id": 71,
  "name": "staging15",
  "slug": "staging15",
  "external_url": null,
  "created_at": "2025-02-27T01:30:36.631Z",
  "updated_at": "2025-02-27T01:30:36.631Z",
  "tier": "staging",
  ...
  "auto_stop_setting": "with_action" # <= This
}
  • It sets auto_stop_setting: always for environments with production and staging tier.
$ curl \
-X POST \
--header "PRIVATE-TOKEN: $TOKEN" \
--data "name=deploy15" \
"https://gdk.test:3443/api/v4/projects/35/environments" | jq

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1239  100  1226  100    13   1444     15 --:--:-- --:--:-- --:--:--  1459
{
  "id": 70,
  "name": "deploy15",
  "slug": "deploy15",
  "external_url": null,
  "created_at": "2025-02-27T01:30:20.713Z",
  "updated_at": "2025-02-27T01:30:20.713Z",
  "tier": "other",
  ...
  "auto_stop_setting": "always" # <= This
}
Edited by Taka Nishida

Merge request reports

Loading