LogoLogo
  • Planet 4
  • Development
    • Contribute
    • Installation
    • Git Guidelines
    • Coding Standards
    • Continuous Delivery
  • CI/CD
    • Test Instances
    • Deployment
    • Testing
      • End-to-end Tests
      • Visual Regression Tests
  • NRO Customization
    • Development
      • Using Child Themes
      • Package Registry
      • Plugins
    • Testing
      • Visual Regression Tests
    • Deployment
      • Production
      • DB/Media Sync
  • Infrastructure
    • NRO Generation
    • ElasticSearch
    • Cloudflare
  • Recipes
    • Maintenance page
    • Production sync
    • Running commands
  • Platform
    • Practices
    • ADRs
      • [ADR-0001] Use Gitbook for Technical Documentation
      • [ADR-0002] P3 Archive elastic search integration
      • [ADR-0003] WYSIWYG Blocks Architecture
      • [ADR-0004] Switch to Monorepo
      • [ADR-0006] Define scope for deployment environments
      • [ADR-0008] PSR-4 Autoloading Standard
      • [ADR-0009] Include Media Library in master theme
      • [ADR-0011] PHP Coding Standards
      • [ADR-0012] Use custom SCSS syntax for variables
      • [ADR-0013] Choose a ticketing system
      • [ADR-0014] Choose a testing framework
      • [ADR-0015] Use block templates to build block patterns
      • [ADR-0016] Form Builder data retention policy
      • [ADR-0017] Move blocks into the theme
    • Changelog
      • 2024
      • 2023
      • 2022
      • 2021
      • 2020
      • 2019
      • 2018
  • Tech
    • Wordpress
    • Blocks
    • Plugins
    • Hooks
    • Data migrations
    • CSS variables
Powered by GitBook
On this page
  • Context and Problem Statement
  • Considered Options
  • Decision Outcome
  • Pros and Cons of the Options
  • Monorepo
  • Links
Edit on GitHub
  1. Platform
  2. ADRs

[ADR-0004] Switch to Monorepo

Deprecate EN block & Media library plugins. Instead integrate those into the main main blocks plugin and master theme respectively. For the time being we will continue with these two main repositories

  • Status: partially accepted (see Decision)

  • Deciders: Engineering Team

Technical Story: We need to choose how we use git to organize our application code repositories.

Context and Problem Statement

The top-level choice is to organize the code as a "monorepo" or leave as we currently have it (polyrepo). Monorepo means we put all pieces into one big repo. Polyrepo means we put each piece in its own repo.

All the code that we're developing is for one organization's offerings, and not for the general public. Our theme and plugins are highly opinionated in terms of UI, but also functionality, to meet the needs of the organization. We also don’t depend on external stakeholders or end users when we do releases or make breaking changes.

Planet4 is considered a single "project" because currently the main 5 repositories are quite dependent on each other: Master Theme, Blocks Plugin, EN Forms plugin, Medialibrary plugin, Styleguide. We even disable native blocks for the editors, so actually it's a quite opinionated Wordpress setup.

Considered Options

  • Switch to one repo for theme and plugins (Monorepo)

  • Keep using different repos for each one of them (Polyrepo)

Decision Outcome

Chosen option: Deprecate EN block & Media library plugins. Instead integrate those into the main main blocks plugin and master theme respectively. For the time being we will continue with these two main repositories.

Pros and Cons of the Options

Monorepo

  • Good, because versioning would be unified.

  • Good, because merging repos would reduce a lot of build time: less composer calls, less npm calls, git checkouts, etc.

  • Good, because we could deduplicate shared code and configuration.

  • Bad, because it makes it more difficult for other organizations to use our plugins, blocks, etc. Maybe it can be mitigated with composer.

Links

Previous[ADR-0003] WYSIWYG Blocks ArchitectureNext[ADR-0006] Define scope for deployment environments

Last updated 4 years ago

- A tool that can preserve history of merged repos

Monorepo vs Polyrepo
https://github.com/shopsys/monorepo-tools