Skip to content

Monorepo Project

Valerie Young edited this page May 21, 2024 · 11 revisions

Moving specifications into a monorepo, which repos -- all of them?

We will move after the recharter:

ARIA Monorepo branch starts off with a basic structure + some demo GitHub workflows for publication. Open questions:

  • What other specs use a monorepo, what is their insight on this proposal?
    • ePub Working Group is currently using a "monorepo" approach. Publlishing ever-green specs is doable with current specprod options. Daniel will set up a proposal for handling our specs.
  • How to publish the different specifications from one repo
    • How to publish evergreen vs versioned specifications
      • Daniel suggests that we use automated publication for ever-green specs but we keep using manual publication for versioned specs. Most transition requests need to happen manually anyway.
  • How to maintain old URLs (like github.io editor's drafts)
  • What URL to use for editor's drafts
  • How to modify ARIA process
  • Whether to leave repositories open for issue tracking
  • Are modifications necessary for pr-preview?
  • What will we do with open PRs?
  • Do we want to take the time to change some old branch mnaming and usage? HTML-aam still uses gh-pages as the main branch.

Example of monorepos:

notes

merging git repositories

Based on https://build5nines.com/git-merge-repositories-with-history/

Terminology: 'source' repository (e.g., accname) getting merged into 'target' repo (as a subfolder, e.g., aria).

Strategy: use git-filter-repo to rewrite source repository, moving its content into a subfolder. Then merge that rewritten repository into the target repository.

  • install https://github.com/newren/git-filter-repo/
  • Clone source
    • $ git clone https://github.com/w3c/source.git source
    • $ cd source
  • Use 'git-filter-repo' to rewrite 'source' repo to subfolder named 'Foo' (maintaining history)
    • $ git filter-repo -f --to-subdirectory-filter Foo --tag-rename :foo-
    • After running the root '/' contents of 'source' repo will be located in '/Foo/' subfolder
  • Clone target
    • $ git clone https://github.com/build5nines/target-repo.git target
  • Prep 'target' repo:
    • $ cd target
    • $ git checkout -b merged-repos
  • Add source as (local folder) git remote to 'target'
    • $ git remote add -f source ../source
  • merge source repo into target, allowing unrelated history $ git merge --allow-unrelated-histories -m 'merge source repository with history' source/main
  • Push branch to remote / GitHub $ git push --set-upstream origin merged-repos