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

PR Preview Environments for Parse Dashboard — Uffizzi Integration #2352

Closed
wants to merge 4 commits into from

Conversation

ShrutiC-git
Copy link
Contributor

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

New Pull Request Checklist

Issue Description

This PR extends parse-dashboard's GHA workflows and utilizes parse-dashboard's dockerfile to build a docker-compose, which is then used to spin up containers containing the services we are testing parse-dashboard with. This PR uses Postgres, parse-dashboard, and parse-server.

Parse-dashboard image is built from the source, which allows changes to reflect in the preview environment. The services are put behind a proxy for internal routing. No change has been made in the source code itself.

When a PR event is triggered on parse-dashboard (PR opened, synced, etc), Uffizzi workflows will be triggered and either deploy a new Uffizzi Preview or update an existing one. Once the preview is deployed, a comment will be posted on the PR containing the URL of the preview environment, allowing easy navigation.

Here is a PoC for Parse-dashboard preview on Uffizzi - a PR opened against the main in my fork of Parse-dashboard. Here is the comment on that PR.
This is the preview URL.

To log into the preview, use the following credentials:

  • username: admin
  • password: password

Approach

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Dec 23, 2022

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Closes: #123 in the PR description, so I can recognize it.

@ShrutiC-git
Copy link
Contributor Author

hey, @mtrezza , this is the PoC or Parse dashboard + Uffizzi integration.

Thank you for helping us understand Parse's ecosystem better! Let me know if this looks good~

@mtrezza
Copy link
Member

mtrezza commented Dec 23, 2022

Very nice! This should save reviewers some time as they can just verify the changes directly from the PR.

  • I assume we would use the "open source" plan to run this?
  • Could you give us access to a backend, so we can get a better idea of the whole service?
  • Do you have a GitHub bot that posts a comment with the preview URL, or do we have to develop that ourselves in GitHub actions?
  • We would want to avoid contributors using Uffizzi to develop their code, instead of running Parse Dashboard locally; if the docker image is build on our GitHub resources, that would not be scalable for us. Is there any built-in way to avoid that?

@jpthurman
Copy link

Hi @mtrezza,

I can answer those questions for you.

-Yes you would be on the "Open Source" plan
-You can login for free with Github at https://app.uffizzi.com/sign_up if you'd like to explore the platform
-The PR comments are built-in to the GHA workflow - no action required on your end

-Uffizzi is not designed to replace your local IDE but it's certainly possible that contributors could use it in that way. I can think of 2 ways to address it -

  1. You could discourage it in CONTRIBUTING.md OR
  2. We also offer a build service with our platform that you could utilize. This workflow would operate outside of GHA. When a PR is opened/updated Uffizzi receives a webhook notification and builds / deploys your preview environment (comment posting to the PR included).

We're happy to support whichever workflow is best for your project - either GHA or as a plug-in. Most Open Source projects use GHA but some utilize the plug-in model. Here's an example of an open source project that uses Uffizzi as a plug-in.

Other notes-
-If you want the GHA integration all you have to do is merge this PR and it will start creating Previews on subsequent PRs (you don't have to set-up a Uffizzi account first). We use Github's OIDC to securely provision your account. Later you will be able to login to the Uffizzi dashboard with your Github login to see logs and have a management plane.

-If you'd like the plug-in model we would close this PR and open a PR with only docker-compose.uffizzi.yml. Once the docker-compose.uffizzi.yml is merged, you would create a Uffizzi Team account through our UI and "connect" to the docker-compose.uffizzi.yml to complete account set-up. This is a pretty simple process but does require a little more set-up work on your end. We'd be happy to jump on a zoom call and talk through any of this if that would be helpful.

@ShrutiC-git
Copy link
Contributor Author

Hi, @mtrezza, hope you were able to go over Josh's comment, and that your concerns re scalability were answered.
Please let me know what would work best for Parse-dashboard

@ShrutiC-git
Copy link
Contributor Author

hey @mtrezza, do let me know what your thoughts are on this, and/or if this needs any modifications, feel free to share those, too. I hope this fits into the project's timeline.

@mtrezza
Copy link
Member

mtrezza commented Jan 14, 2023

@parse-community/dashboard your feedback is welcome, seem to be an interesting addition to easily demo the PR

@ShrutiC-git is there any way to simplify / reduce the changes needed for the integration? this PR create quite some configuration overhead in the repo for a single integration

@ShrutiC-git
Copy link
Contributor Author

@mtrezza, I do see your concern.
for open-source projects who want to use GHA for provisioning previews, we follow a two-stage workflow paradigm. You can find more about why we use/suggest a two-stage workflow for open-source projects here. In these cases, the following 3 files are a must:

  • uffizzi-build.yml → to build the containers
  • uffizzi-preview.yml → to provision the preview
  • docker-compose.uffizzi.yml → the compose which adds our integration

Additional files depend upon the project. In this project, we also have the config from Nginx, which acts as a proxy for traffic into our containers. What I can do is keep the Nginx configuration to one file, rather than two, which would reduce to a total of 4 files.

There is the other option that @jpthurman pointed out, which is using our platform to provision previews. In this case, we would not need the GHA workflow files (uffizzi-build.yml and uffizzi-preview.yml) because the workflows are handled by us on our platform, outside of GHA. So in that case, you'd be able to reduce this to 2 file changes — docker-compose.uffizzi.yml and the nginx.conf file. If this flow feels easier to maintain, we'll make the change.

@mtrezza
Copy link
Member

mtrezza commented Jan 14, 2023

The option using the platform to provision previews sounds good to reduce the config overhead. Any cons?

@ShrutiC-git
Copy link
Contributor Author

There are no cons. It's just the preference of the project.

Moving to our platform would reduce the overhead of GHA workflow. Should we switch to building on our platform?

@mtrezza
Copy link
Member

mtrezza commented Jan 15, 2023

Yes, I think it makes sense to use your UI if that reduces the code.

@mtrezza
Copy link
Member

mtrezza commented Jan 27, 2023

Superseded by #2364

@mtrezza mtrezza closed this Jan 27, 2023
@mtrezza mtrezza linked an issue Jan 27, 2023 that may be closed by this pull request
3 tasks
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.

Add PR deployment preview
3 participants