Skip to content

Add deployments to pages usage quotas tab

What does this MR do and why?

This MR continues to implement a Pages tab to the Usage Quotas page. While !153434 (merged) added the tab and the stats, this one adds the project list view (split out for easier review).

Issue: #476522 (closed)

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.

Screenshots or screen recordings

Screenshot_2024-08-14_at_16.13.17

After clicking "delete" on a deployment

Screenshot_2024-08-14_at_16.13.26

If project has more deployments than the limit

(Note: the display limit is actually hardcoded at 15, but has been lowered to 3 for taking this screenshot)

Screenshot_2024-08-14_at_16.13.52

How to set up and validate locally

  1. Set up your GDK to support Runners and Pages
  2. Enable the multi version feature flag with echo "Feature.enable(\"pages_multiple_versions_setting\")" | rails c
  3. Inside a group, create a Pages project, by creating a new project with the "pages/Plain HTML" template.
  4. Replace the below config in the .gitlab-ci.yml:
image: busybox

pages:
  stage: deploy
  script:
    - echo "Pages accessible through ${CI_PAGES_URL}/${PAGES_PREFIX}"
  variables:
    PAGES_PREFIX: "" # no prefix by default (master)
  pages:
    path_prefix: "$PAGES_PREFIX"
  artifacts:
    paths:
    - public
  rules:
    - if: $CI_COMMIT_BRANCH == "master" # ensure to run on master (with default PAGES_PREFIX)
      variables:
        PAGES_PREFIX: '' # prefix with _stg for the staging branch
    - if: $CI_PIPELINE_SOURCE == "merge_request_event" # conditionally change the prefix on Merge Requests
      variables:
        PAGES_PREFIX: 'mr$CI_MERGE_REQUEST_IID' # prefix with the mr<iid>, like `mr123`
  1. Ensure the pipeline runs successfully and you have a pages deployment
  2. Enable multiple deployments for your new project
  3. Create one or more MRs in the project. Ensure each MR's pipeline creates a Pages deployment.
  4. In the group's sidebar, visit Settings > Usage Quotas > Pages and view the new components

Closes #476522 (closed)

Edited by Janis Altherr

Merge request reports

Loading