Skip to content

Serve pages deployments without going through PagesMetadatum

Kassio Borges requested to merge kassio/get-pages-deployment-directly into master

What does this MR do and why?

Serve pages deployments without going through PagesMetadatum

With the work to introduce Gitlab Pages Multiple Versions, a project now have to support multiple PagesDeployment at the same time.

For this reason, instead of using ProjectPagesMetadatum#pages_deployment_id to identify valid deployment the PagesDeployment#deleted_at field was [introduced].

For now, we're still serving a single pages version, to avoid changing the current behavior, but instead of looking it up through ProjectPagesMetadatum#pages_deployment_id, we're using the project.pages_deployments.main_version to identify a project active pages deployment.

This is an extraction of the MR that introduce the multiple version serving. It was decided to not serve multiple versions on this commit to avoid extra complexity on this, already, large change.

Related to: #416494 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

The end-goal of this MR is not change the existing pages behavior, as mentioned before, this is a step to achieve the [Gitlab Pages Multiple Versions].

  1. Setup GitLab Pages on your GDK: https://docs.gitlab.com/ee/development/pages/
  2. Create a new public project from template, using Pages/Plain HTML template
    • If you decide to use a private project, don't forget to enable the access control
  3. Navigate to the new project and run a pipeline (Sidebar > Build > Pipeline) to build the GitLab Pages site
  4. Navigate to Pages settings (Sidebar > Deploy > Pages):
    1. Disable Force HTTPS and click save
    2. Open the GitLab Pages Site by clicking on the link in Access pages
  5. Success, the pages must load successfully

MR acceptance checklist

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

Edited by Kassio Borges

Merge request reports