Preview Environments for PRs opened on ohmyform #204
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR is adding support for preview environments for PR events (opened, sync'ed, reopened, etc), powered by Uffizzi. This PR is using GHA workflows to build and provision the preview environments. Utilizing docker-compose examples from ohmyform, the PR builds
ohmyform-ui
andohmyform-api
from source - this makes sure the latest changes are reflected in the preview. The docker-compose also includes a Redis instance, a Postgres instance, and Nginx for routing.Once a PR event is triggered — PR opened, PR synced, review requested — the build workflow will build the images and the preview workflows will either spin up a new preview or update an existing preview. A comment will be posted on the PR containing the URL of the preview environment, allowing contributors and maintainers to easily navigate to the preview.
Fixes - #203
Motivation and Context
This change is required to allow maintainers and contributors to approve contributions in half the time with live previews for every pull request. To test branches in isolation and merge with confidence. Testing changes for services with multiple components can be cumbersome - polluted environments, merge conflicts, and build every time the change needs to be tested and approved. The idea behind preview environments by Uffizzi is to eliminate these frictions while testing and approving changes. An in-depth study on preview environments can be found here.
With this PR, changes to
ohmyform-ui
andohmyform-api
will spin up a production-like ephemeral preview environment. The environment can be used for testing the FE and the BE aspect ofohmyform
How Has This Been Tested?
In order to test this, I have created a PR against the main branch of my personal fork of
ohmyform
. This triggered the workflow to create a new preview environment - here. This comment, posted on the PR, takes me to the preview environment.To log into the above preview environment, use the following credentials:
Once you are logged in, you will be able to do all you would on a production instance of OhMyForm; create forms, share forms, track submissions, etc. Changes made to the FE and BE will reflect on the preview environment.
Please let me know if there's anything we can change and do better in this PR to better align with ohmyform
Screenshots (if appropriate):
Types of changes
Checklist:
cc @wodka @waveywaves