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

ci: Add deployment preview to pull requests via Uffizzi integration #2364

Merged
merged 62 commits into from
Jan 27, 2023

Conversation

ShrutiC-git
Copy link
Contributor

@ShrutiC-git ShrutiC-git commented Jan 20, 2023

New Pull Request Checklist

Approach

This PR is opened as an update to PR #2352. This PR is moving Uffizzi build and Uffizzi preview workloads from GitHub actions to Uffizzi CI.

Uffizzi CI will handle building the containers and provisioning preview environments for PRs. Once the preview is up and ready, a comment will be posted on the PR on GitHub. This requires lesser configuration than GHA integration.

Here is a guide on the Uffizzi CI setup and how it works.

Post merging this PR into Parse's default branch, you'll have to follow these steps to configure Uffizzi CI to provision previews for PRs on Parse-dashboard.

Here is a test PR which was opened in my fork of Parse-dashboard. The building and provisioning were done outside of GHA and in Uffizzi CI. Post completion, this comment was posted on the PR. This is the preview environment. To log into Parse-dashboard for this test PR, use the following credentials:

  • username: admin
  • password: password

cc @mtrezza

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 Jan 20, 2023

Thanks for opening this pull request!

  • ❌ Please edit your post and use the provided template when creating a new pull request. This helps everyone to understand your post better and asks for essential information to quicker review the pull request.

@ShrutiC-git ShrutiC-git changed the title Uffizzi CI Integration — Preview Environments for PRs feat: Uffizzi CI Integration — Preview Environments for PRs Jan 20, 2023
@ShrutiC-git ShrutiC-git reopened this Jan 26, 2023
@mtrezza
Copy link
Member

mtrezza commented Jan 26, 2023

The integration looks much more lightweight now, thanks for the new PR. What's the status of this PR and what would we need to do to add this preview to all PRs of the Parse Dashboard repo? I think we could give this a try.

@mtrezza mtrezza changed the title feat: Uffizzi CI Integration — Preview Environments for PRs ci: Add deployment preview to pull requests via Uffizzi integration Jan 26, 2023
@ShrutiC-git
Copy link
Contributor Author

that's great to hear — I'm glad we could align it to meet Parse's requirements :)

  • You can start by merging this PR.

  • Post that, you'll need to sign up into Uffizzi.com with GitHub.

  • After successful login, you could go through these steps to setup Uffizzi CI

And you'll be good to go!

Also, this is how the Uffizzi CI works for now.

Currently Uffizzi CI will only create previews for pull requests that target the branch you configure in the Uffizzi Dashboard (Project > Settings > Compose file > Branch > Path to Compose).

For example, if you configure Uffizzi CI with a Compose file from your main branch, Uffizzi will apply the following logic:
Previews will be triggered for pull requests matching:

main ← {topic_branch}
Previews will not be triggered for pull requests matching:

{topic_branch} ← main or
{topic_branch} ← {topic_branch}

Here are our docs on how to use Uffizzi CI if you want to read more about this.

@mtrezza
Copy link
Member

mtrezza commented Jan 27, 2023

I assume we need to write our own bot to add the preview URL as a comment to the PR thread? Or is that a feature that is already supported?

Post that, you'll need to sign up into Uffizzi.com with GitHub.

I tried that, but got an error:

image

The repository belongs to an org, but the org account parse-community cannot be used to sign in. Instead, we use another GitHub user parseplatformorg who has access to that org's repositories. When I sign up on Uffizzi with the GitHub account parseplatformorg and then choose "Configure GitHub" I don't see any repositories in the Uffizzi dashboard, because that account doesn't own any. If I choose "Configure GitHub" with the parse-community account that owns the repository Uffizzi shows the error above.

@gadkins
Copy link

gadkins commented Jan 27, 2023

Hi @mtrezza I'm co-founder at Uffizzi. Happy to help you out.

I assume we need to write our own bot to add the preview URL as a comment to the PR thread? Or is that a feature that is already supported?

No you don't need to write your own bot, Uffizzi CI will post the comment for you. You will grant permission to the Uffizzi GitHub App to write to PR issues, as described here.

It looks like parseplatformorg is technically a GitHub Personal Account, which I assume has Owner role for the parse-community Organizational Account? If that is the case, you should login to Uffizzi as parseplatformorg (Personal), and then create a Uffizzi Team for parse-community (Organizational). Once the parse-community Team is created, you can switch to this context and connect the credentials.

Screen Shot 2023-01-27 at 11 33 52 AM
Screen Shot 2023-01-27 at 11 34 46 AM

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Thanks, it found the repository; I'll merge this to continue the configuration in the console.
Continuing discussion in issue #2374.

@mtrezza mtrezza merged commit 4062054 into parse-community:alpha Jan 27, 2023
@mtrezza mtrezza linked an issue Jan 27, 2023 that may be closed by this pull request
3 tasks
@mtrezza mtrezza mentioned this pull request Jan 27, 2023
3 tasks
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.1.0-alpha.7

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jan 28, 2023
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.1.0-beta.2

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Mar 1, 2023
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.1.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label May 1, 2023
beiguancyc pushed a commit to beiguancyc/parse-dashboard that referenced this pull request May 5, 2023
* source: (41 commits)
  chore(release): 5.1.0 [skip ci]
  chore(release): 5.1.0-beta.2 [skip ci]
  ci: Skip unnecessary builds (parse-community#2389)
  refactor: Upgrade various dependencies (parse-community#2388)
  chore(release): 5.1.0-alpha.10 [skip ci]
  fix: Data browser dialog "No data to display" may be outside of visible area in Safari browser (parse-community#2387)
  chore(release): 5.1.0-alpha.9 [skip ci]
  fix: Screen goes blank when trying to add column of type `Object` or `GeoPoint` (parse-community#2384)
  refactor: Bump http-cache-semantics from 4.1.0 to 4.1.1 (parse-community#2381)
  chore(release): 5.1.0-alpha.8 [skip ci]
  fix: Internal error message on login with missing credential (parse-community#2370)
  refactor: Remove warnings in Docker build (parse-community#2350)
  ci: Restyle preview html (parse-community#2377)
  chore(release): 5.1.0-alpha.7 [skip ci]
  fix: Dashboard may display blank page when selecting an app after login (parse-community#2375)
  ci: Add deployment preview to pull requests via Uffizzi integration (parse-community#2364)
  chore(release): 5.1.0-alpha.6 [skip ci]
  fix: Navigation to page fails if user re-login is required (parse-community#2369)
  refactor: Bump ua-parser-js from 0.7.28 to 0.7.33 (parse-community#2372)
  chore(release): 5.1.0-alpha.5 [skip ci]
  ...

# Conflicts:
#	package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add PR deployment preview
4 participants