Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Port "Frontend PR Previews" doc from notion (#1120)
Browse files Browse the repository at this point in the history
* Port "Frontend PR Previews" doc from notion

* Apply suggestions from code review

Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com>

---------

Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com>
  • Loading branch information
ryan953 and michellewzhang authored Jan 8, 2024
1 parent a70d301 commit f8df89e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export default () => {
<SidebarLink to="/philosophy/">Philosophy</SidebarLink>
<SidebarLink to="/commit-messages/">Commit Messages</SidebarLink>
<SidebarLink to="/code-review/">Code Review</SidebarLink>
<SidebarLink to="/frontend/pull-request-previews/">
Pull Request Previews
</SidebarLink>
<SidebarLink to="/workflow/">Workflow</SidebarLink>
<SidebarLink to="/continuous-integration/">Continuous Integration</SidebarLink>
<SidebarLink to="/python-dependencies/">Python Dependencies</SidebarLink>
Expand Down
45 changes: 45 additions & 0 deletions src/docs/frontend/pull-request-previews.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Pull Request Previews
---

## What are preview builds?

When you open a pull request on GitHub in the sentry repository, Vercel can automatically build and deploy the frontend code in your branch into a preview URL. This allows you to see the new code as it would be in production.

This is very handy for:

- Previewing new frontend features that require complex interactions to understand how they work. This can be great if the specific feature you've built has a certain "feel" to it, that can only be expressed through actually using the interface in a web browser. The preview build will allow reviewers to **quickly** see how your feature works.

- Validating that a bug fix is actually working in production, and doesn't suffer from __worked on my machine__ syndrome.

- Sharing new features that are highly sought after by the community that have not yet been merged. Especially if the feature is still undergoing development it may even be possible to **get feedback from __real users__** before the feature is merged.

## How can I have preview builds on my Pull Request

When you open a Pull Request, the build preview will automatically start building and deploying through Vercel. When it is complete (after about 4 minutes) you will find the preview link in the panel above the GitHub Checks that says `This branch was successfully deployed`:

![You will need to click "Show environments"](../img/githubPRShowEnvironmentsBar.png)

Click the `Show environments` toggle and then click `View deployment` for the `Preview - sentry` row

![Click "View deployment" for the `Preview - sentry` row](../img/githubPRShowEnvironmentsExpanded.png)

## Why don't my Pull Requests have build previews?

There are a few caveats to using the frontend preview builds:

1. Backend changes **will not be deployed in preview builds**. You may have a PR that includes both frontend and backend code changes, but **only frontend changes will be deployed**. It is important to remember this, because if your frontend preview depends on any API backend changes that are not already in production, your preview will inaccurately reflect the feature you've built. Preview builds use **the production API**.

2. `getsentry`'s (the repo) frontend components are not included in preview builds. Do not be alarmed when SaaS features (usually upsell features) are missing.

3. Some features of Sentry are **not** supported as they are still served from the backend. This includes (but is not currently limited to):

- SSO Authentication does **NOT** work at the moment. You will need to login to an account that is part of an organization that does not require SSO.
- 2FA login does not currently work
- SSO configuration pages do not have React views.
- Integration installation will not work as the redirect URLs will be incorrect.
- Various authentication frontends are missing (reset password, registration).


4. Only PRs made from branches inside the repository itself can create previews - a PR made from a fork will fail with the message “Authorization required to deploy.”

Binary file added src/docs/img/githubPRShowEnvironmentsBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/docs/img/githubPRShowEnvironmentsExpanded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit f8df89e

@vercel
Copy link

@vercel vercel bot commented on f8df89e Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

develop – ./

develop.sentry.dev
develop-git-master.sentry.dev

Please sign in to comment.