Skip to content

Epic: Preview Environments #9017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 tasks
atduarte opened this issue Mar 30, 2022 · 9 comments
Open
5 tasks

Epic: Preview Environments #9017

atduarte opened this issue Mar 30, 2022 · 9 comments
Labels
meta: never-stale This issue can never become stale team: workspace Issue belongs to the Workspace team type: epic

Comments

@atduarte
Copy link
Contributor

atduarte commented Mar 30, 2022

Summary

To bring the concept of a preview environment to Gitpod; a new type of workspace (i.e. regular, prebuild, preview).

Context

Validating a PR most frequently requires reviewers (devs and non-devs) to manually verify the application behaviour. A common practice is to have a companion preview environment, that shares the lifecycle with the PR, auto-updates and is available for any team member to collaboratively use.

Currently, that is possible with Gitpod but is suboptimal. Each individual needs to start a new Gitpod workspace, wait for it to start, enter the IDE, and open the application port. Particularly for user groups that are unfamiliar with IDEs (e.g. Product Managers and Designers) this can be hard. Additionally, sharing is possible, but only while the workspace is running (i.e. while it doesn't time out) and only the owner can start it.

Value

Some customers have been requesting this feature so that other (non-dev) members of the teams can take benefit of Gitpod.

Additionally, this solves a problem many teams face. It can work as a way for getting teams to set up their Gitpod environments and then more easily discover the benefits of ephemeral development environments.

Acceptance Criteria

  • Non-dev team members are able to validate application behaviour without having to learn how to use the IDE and open the appropriate ports.
  • On each PR a link to one (and only one) preview workspace is automatically shared
  • The preview workspace is accessible by all team members.
  • The preview workspace automatically times out when there's no usage in order to save costs.

Measurement

  • Percentage of Gitpod projects with preview workspaces configured.

Growth Area

Expansion

Persona(s)

No response

Hypothesis

No response

In scope

No response

Out of scope

No response

Complexities

  • Timeout and automated restart logic

Press release

A preview workspace would start from the same image and run the same tasks as the regular workspace, but would have a different lifecycle, would not run an IDE and would be accessible by everyone in the team.

Lifecycle

Its lifecycle would be linked to that of a PR, just like the prebuilds' lifecycle is linked to a branch. Whenever a new PR is created, if the project is configured, a preview environment would start. Whenever the PR is updated, the preview environment is rebuilt.

The link to the applications running in the preview environment would automatically show up in the PR checks, as seen below:

image

Timeouts

A preview workspace should stop after X hours of inactivity, and in this case we need to consider external access/traffic to to the applications as activity.

If a preview workspace is stopped and one of the links is visited, it should automatically start.

Configuration

The list of applications would be configured in the .gitpod.yml:

image

Alternatively, instead of adding a new root property to the .gitpod.yml, we can add a preview: true|false property to the ports array.

Billing

Similar to prebuilds. Usage-based pricing would be a better fit for this feature, as usage particularly

@shaal
Copy link
Contributor

shaal commented Apr 1, 2022

👍 💯
Yes please!!!

Gitpod is incredible, and was a game changer for Drupal contributions.
I was just giving a presentation last night, where I said "I am sure in the near-future Gitpod will add a preview feature".
I came to add that feature request, and I am so happy it was already submitted.

For Drupal, this would allow non-developers to help with contributions. They can run a ready-made setup to test PRs, without touching (and/or being overwhelmed with VSCode interface).

@TheBestMoshe
Copy link

There are lots of options when it comes to preview environments. It's especially easy when using services like Vercel, Netlify, Heroku, and Render. However, they all have big flaws.

Regarding Vercel and Netlify, the issue I've always had was branch state. I want each preview environment to have its own freshly seeded database. However, these services do not have a way to manage the databases. Generally, each environment ends up sharing a database, and it leads to annoying migration conflicts.

Heroku and Render can spin up a database for a preview environment, however, as far as I can tell, there is no way to dynamically spin it up when someone is using it, and then scale it back down to 0 when it's not in use. This means that you need to pay for the entire infrastructure during the predetermined duration of the preview environment. Once the time is passed, you lose access to the preview environment.

Since I already have a full environment (database, Minio S3, pubsub, etc.) configured in GitPod, it would be amazing if we can use this same environment as a preview environment, that can scale up when the user needs it, and then scale back down.

@loujaybee
Copy link
Member

loujaybee commented Apr 13, 2022

Static URLS
Wanted to mention that I think the use case for preview environments is also closely related to the topic of static URLs, e.g.

For the QA use-case where users want to have a single URL to be passed to QA teams for review.

Collaboration
This also has quite a lot of overlap with collaboration use-cases (e.g. more granular / secure sharing of the workspace, restrictions on things like terminal access etc). But that depends on whether this is more of a browser-only preview.

@svenefftinge
Copy link
Member

Since I already have a full environment (database, Minio S3, pubsub, etc.) configured in GitPod, it would be amazing if we can use this same environment as a preview environment, that can scale up when the user needs it, and then scale back down.

Is this not what we already have today? I.e. scale up => start a workspace?

@TheBestMoshe
Copy link

Is this not what we already have today? I.e. scale up => start a workspace?

Not exactly. What I had in mind was that when a request comes into a URL, the environment gets spun up and serves the request. Similar to the way Heroku can scale down to 0 and scales up when requests come in. This way takes much less effort out of the reviewer. This is especially important if the reviewers are not technical and aren't really familiar with starting workspaces.

@josepjaume
Copy link

Brilliant idea 🤩! It'd be ideal for us (Factorial) as an organization. We have some stakeholders in product who don't use Gitpod (or GitHub for that matter) but would like to review the work we do in branches. We're managing to do this right now by creating workspaces for them and sending the URLs, but of course, expiry times are an issue, as well as having to go through us. Streamlining this would be fantastic!

@charIeszhao
Copy link

It would also be great if gitpod can provide a switch or a checkbox in the subject PR, so that people can only trigger the preview env deployment when they turn on the switch. This helps save the server cost and potential build time in each PR.

@stale
Copy link

stale bot commented Dec 3, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Dec 3, 2022
@stale stale bot closed this as completed Dec 23, 2022
@stale stale bot moved this to Awaiting Deployment in 🌌 Workspace Team Dec 23, 2022
@kylos101 kylos101 removed the status in 🌌 Workspace Team Dec 27, 2022
@kylos101 kylos101 added the meta: never-stale This issue can never become stale label Dec 27, 2022
@kylos101 kylos101 reopened this Dec 27, 2022
@stale stale bot closed this as completed Jan 10, 2023
@github-project-automation github-project-automation bot moved this to Awaiting Deployment in 🌌 Workspace Team Jan 10, 2023
@gtsiolis gtsiolis removed the meta: stale This issue/PR is stale and will be closed soon label Jan 10, 2023
@gtsiolis gtsiolis reopened this Jan 10, 2023
@kylos101 kylos101 removed the status in 🌌 Workspace Team Jan 11, 2023
@shaal
Copy link
Contributor

shaal commented Feb 9, 2024

I wanted to inquire if there have been any recent updates regarding this issue. @loujaybee, I believe the recent CLI improvements may help us get closer to implementing this feature.

To clarify, my definition of a preview environment entails running all tasks specified in the .gitpod.yml file, creating a Gitpod snapshot (optional), and opening a designated port to serve as a preview (skips the integrated development environment for users who do not require it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta: never-stale This issue can never become stale team: workspace Issue belongs to the Workspace team type: epic
Projects
No open projects
Status: No status
Development

No branches or pull requests

9 participants