Add staging/prod environtments to Pages

Problem to solve

Currently, GitLab Pages offers only a single environment for publishing. That's no big deal for pet projects, but for personal pages, it makes sense to introduce some sort of staging environment where one can see how the page will look like before it's available at their linked domain name.

Indeed, one can just take a look locally on dev machine, but that doesn't take into account Pages' infrastructure, so for best reliability it makes sense to only release to prod when one knows if the whole infra plays well with the code.

Intended users

GitLab Pages Users who want their Pages-hosted page to have consistent performance and looks at their domain name and test WIP branch(es?) on Pages as well at the same time.

Potential personas:

  • Release Manager
  • DevOps Engineer
  • Software Developer
  • Product Designer
  • Development Team Lead
  • Product Manager

Proposal

A good place to start would be introducing a subdomain or separate path prefix:

http(s)://username.gitlab.io/projectname/staging

or

http(s)://staging.username.gitlab.io/projectname/staging

and providing a corresponding setting in pages CI job.
That way, one can use the old-fashioned way by default or have a separate link for staging environment to, say, test an experimental change to their page.

Permissions and Security

No change to permissions system required, but invoking prod deployments might be restricted in some way.

Most obvious path is protecting the prod branch and using existing facilities, like, restricting push actions to certain roles, but just for UX's sake a separate mechanism might be viable.

Documentation

Testing

Might require more sweat from existing Pages subsystem. Performance tests should be updated, I think.

What does success look like, and how can we measure that?

Acceptance criteria:

  1. It is possible to preview Pages deployment with old deployment still available at domain name to the world.
  2. It is possible to use Pages as they are now with any pages deployment available at the domain name right away

What is the type of buyer?

Core seems appropriate.
This feature is mostly targeted at professionals who care about checking exactly how their Pages website looks before presenting it to the world and are most likely to use the free Gitlab.com version rather than an enterprise version.