Redeploying to a stopped environment does not transition the environment back to active

Summary

After manually stopping the environment, it doesn't go back to "active" after running new pipeline deploying it.

Steps to reproduce

  1. create a new project with this .gitlab-ci.yml:
    start:
      script:
        - echo "start test"
      environment:
        name: production
        url: example.com
        on_stop: stop
    
    stop:
      script:
        - echo "stop"
      when: manual
      environment:
        name: production
        action: stop
  2. wait for pipeline to finish
  3. go to environments
  4. press stop button
  5. wait for stop action to finish
  6. re-run the pipeline and wait for it's completion
  7. visit the environments page

Here's the test project: https://gitlab.com/vshushlin/test-restart-environment

Pressing "Re-deploy the environment" from the environments view also doesn't help.

What is the current bug behavior?

Despite redeployment, the environment still shows as stopped.

What is the expected correct behavior?

When a deployment occurs, it could be spinning up hardware resources, etc. Therefore, the environment should show as active.

Affects Version

GitLab.com (14.4)

Edited by Vladimir Shushlin