[POC] by Max Monolythic Repository

Maximilian Berghoff edited this page Aug 13, 2017 · 4 revisions

We had that discussion years ago, but i wasn't there at this time. So lets start the discussion again. To have a base for that, i created a kind of a copy of our organisation where i started to pull every mantainted component into one mono repository. There you can find my ideas on testing and pulling and pushing from/to the specific repositories.

Disclaimer

When i write component i do not mean a Component as an opposite to a Bundle. I simply mean one of the packages or projects we have in the mono repository.

WHY

The first question is: Why that change? From my POV, i can edit and create features on different components more easily. Especially when crossing repository borders. Doing it in one repository the complete feature will be visible. Starting with a change in a component, doing the improvements in the bundle ending with checking the documentation. All on one branch in one repository. So when we would have a technicial solution to push that changes on seperate read-only repositories and got a way to test it, why not? We "simply" have to find a way to provide all components in a separate repository to keep the decoupled way of a framework alive. So we need a consistent sync process between the directories of the mono repository and each component in the cmf universe of many repositories.

Structure

The symfony-cmf/symfony-cmf will be the main repository with all repositories in src/, src/Component and src/Bundle. It will also contain:

  • Scripts to sync (pull/push/merge) between mono repo and one of the many repo
  • Tests to test the complete mono repository (each component still got its own testing) means testing each component
  • Test the patched components only. Means a way to check which components got changes and run its test suites

(currently those tests are defined in .travis.yml, when structure is cleaner, we should have a way to run it locally too)

Testing

Testing the mono repo on travis-ci is a real hard task. We do not whant to long test build, but we whant confidence to have a valid mono repo. So i proposed to run the normal test matrix on patched components only. As an addition we got one run on (newest stuff) on the complete mone repo – means each component's test suite runs. Doing so i can also separate pull and push build. On a pull build i know the target dir, so i can evaluate the patched components and test them. On a push build i only test all components.

Workflow

Changes on Mono-Repo | Feature | Bug Fix

Create a PR inside the mono repository and get the tests green. When merging into the mono repo we need a script which is called afterwards, which evaluates the patched components and uses the existing push scripts to push the changes to the read-only repository.

Changes on on of the Many Repos

At the beginning i would not do it. Sure we can write a script which fetches branches from one of the many repositories and do a branch on mono repo to instantiate the change. But I would be enough for now, to do changes on mono repo only and keep the many repos read-only

Branches

We still can keep branches on the many repos. We "import" them into the mono repo with a kind of a prefix, which simply is the bundle/package name. So we could sync branches between mono repository and on of the many repositories, to keep the branch structure alive on one of the many repositories.

Current State

  • create a mono repo and pull all repositories
    • ToDo: add/pull without merge commits
  • Script to pull a specific branch of a remote repo into the mono repo on a specific branch ther
    • ToDo: when new, do a add instead of a pull
    • ToDo: Sync branches, create prefixed branch on mono repo if does not exist, pull on that
  • Script to push a directory on a specific branch to a remote repo on a specif branch
  • Travis Testing
    • ToDo: Get complete test suites running
    • ToDo: clean .travis.yml the Sylius way
  • Implement workflow in Webhooks using the existing scripts
  • splitt.sh instead of own scripts

Way to get it live

The current work completely is on a separate organisation not to destroy the original repositories. At the end i would have a working mono repo including test setup and sync setup. This repo will replace the actual symfony-cmf/symfony-cmf repo and feed all maintained repos, which should be read-only then.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.