Skip to content

Add Restore Pages Deployment Mutation

What does this MR do and why?

This commit adds the ability to restore a recently deleted Pages Deployment while it has not yet been purged by the cron job

How to set up and validate locally

  1. Set up your GDK to support Runners and Pages
  2. Create a Pages project, by creating a new project with the "pages/Plain HTML" template within a group
  3. ensure the pipeline runs so that a pages deployment is created.
  4. obtain the deployment's global ID with the following Graphql Query:
query GetNamespacePagesDeployments {
  namespace(fullPath: "<PATH OF THE GROUP>") {
    pagesDeployments {
      nodes {
        id
        active # this should be true
      }
    }
  }
}
  1. Now delete that deployment by running the below mutation:
mutation DeletePagesDeployment {
  deletePagesDeployment(input: { id: "<PAGES_DEPLOYMENT_GLOBAL_ID>" }) {
    pagesDeployment {
      id
      active
      deletedAt
    }
    errors
  }
}
  1. You should now see the "active" property of the deployment as false and a value for the deletedAt property.
  2. Now restore that deployment by running the below mutation:
mutation RestorePagesDeployment {
  restorePagesDeployment(input: { id: "<PAGES_DEPLOYMENT_GLOBAL_ID>" }) {
    pagesDeployment {
      id
      active
      deletedAt
    }
    errors
  }
}
  1. You should now see the "active" property of the deployment again as true and no value for the deletedAt property.

Merge request reports