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

Proposal: Combine server, admin and embed into a single repo #6

Open
aszenz opened this issue Apr 12, 2021 · 5 comments
Open

Proposal: Combine server, admin and embed into a single repo #6

aszenz opened this issue Apr 12, 2021 · 5 comments

Comments

@aszenz
Copy link

aszenz commented Apr 12, 2021

My first experience is working with three different repos is very cumbersome, I think combining them into a single mono repo maybe a good thing long term.

It would definitely simplify making cross-cutting changes and testing all three components locally (both manual and automated).

Mono repo style projects are common in the javascript world and popular tools to make them are yarn workspaces or the upcoming npm workspaces

Pros:

  • Simplifies tooling setup, provides consistency across repos, works as a single product
  • Makes it easy to contribute and perform cross cutting changes
  • Avoids BC breaks between different versions of repository packages

Cons:

  • Repo becomes bigger, cloning takes time
  • Some migration effort and changes, including deployment
@aszenz
Copy link
Author

aszenz commented Apr 12, 2021

@supermacro Let me know ur thoughts on this, not something really necessary but just a nice to have.

@supermacro
Copy link
Member

My main concern is around automated deployments. What do CD setups look like when you have different "things" that need to be deployed to different places and in different ways?

@aszenz
Copy link
Author

aszenz commented Apr 13, 2021

In essence you have different workflows (build steps) for each deployment and then you need to pick some logic to trigger the right workflow for a code change (code push, merge or tag).

The individual workflows can then be totally different and deploy using any method they need like push a docker image or send code to s3 for deployment etc.

There are three main ways I have seen it done:

  1. Pushing to a branch say master and then detecting changes inside a top level path (like say server) then starting a workflow script based on that (so if the pr changes a file in server folder then only the server workflow is run, if it changes both server and admin then both workflows are run).

This is supported by github actions automatically using

on:
  push:
    paths:
      - "web/**"
    branches:
      - master
  1. Pushing a release tag or creating a release and then checking the tag name to decide which workflows to run. This is a more manual way to do it.
name: Deploy

on:
  release:
    types: [published]
steps:
  name: deploy server
  if github.event.release.tag_name == 'server.v2' # this step is only run if tag name is server
  1. The simplest way is to always deploy all services, on every push/tag, this is a bit inefficient but ensures that the services are always in sync and up to date.

@supermacro
Copy link
Member

Ok, makes sense. I am ok with this. But not the highest priority. I think after we ship the MVP we can dedicate time to migrating things to a monorepo.

@supermacro
Copy link
Member

Related issue: parlez-vous/embed#33

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

No branches or pull requests

2 participants