Skip to content
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

Preview Environments for PRs opened on ohmyform #204

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ShrutiC-git
Copy link

@ShrutiC-git ShrutiC-git commented Dec 9, 2022

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 and ohmyform-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 and ohmyform-api will spin up a production-like ephemeral preview environment. The environment can be used for testing the FE and the BE aspect of ohmyform

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:

  • username: admin
  • password: admin

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

cc @wodka @waveywaves

@ShrutiC-git
Copy link
Author

hey there @wodka!
any thoughts on the PR? how is it looking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant