Skip to content

Mark environment URLs as unsafe

What does this MR do and why?

Providing the ability to copy urls as unsafe was confusing to users. Instead, we can just provide the link as unsafe. When a user opens the link in a browser, the browser can use the protocol to open a particular application or other thing.

Screenshots or screen recordings

image

image

image

How to set up and validate locally

  1. Add the following .gitlab-ci.yml file to a project:
stages:
    - deploy
    - stop
image: alpine:latest

deploy-prod:
    stage: deploy
    script:
        - sleep 10
        - echo "deploying prod"
    needs: []
    environment:
        name: production
        url: postgres://example.com
        on_stop: stop-prod

deploy-staging:
    stage: deploy
    script:
        - echo "deploying staging I hope"
    needs: []
    environment:
        name: staging
        url: https://example.com

deploy-development:
    stage: deploy
    script:
        - echo "deploying development"
    needs: []
    environment:
        name: development
        url: https://example.com
    when: manual

deploy-review:
    stage: deploy
    script:
        - echo "Deploying review/$CI_COMMIT_REF_NAME"
    environment:
        name: review/$CI_COMMIT_REF_SLUG
        auto_stop_in: 1 week
        on_stop: stop_review_app
        url: postgres://$CI_COMMIT_REF_NAME.example.com
    needs: []
    only:
      - merge_requests


stop_review_app:
  script: stop-review-app
  stage: stop
  environment:
    name: review/$CI_COMMIT_REF_SLUG
    action: stop
  needs:
       - deploy-review
  only:
    - merge_requests
  when: manual

stop-prod:
  script: 
      - echo "stopping staging"
  stage: stop
  needs:
      - deploy-prod
  environment:
    name: production
    action: stop
  when: manual
  1. Run a pipeline
  2. Check the URL of the production environment in both Deployments > Environments and within the Production details page
  3. Create a branch
  4. Create an MR for that branch
  5. Check the View app button for the MR deployment

MR acceptance checklist

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

For #337304 (closed)

Edited by Andrew Fontaine

Merge request reports

Loading