Alex Lorenz Apple
Total Page:16
File Type:pdf, Size:1020Kb
Transitioning Apple’s Downstream Repositories To The Monorepo Alex Lorenz Apple � � � � Let’s recreate our downstream repos Let’s improve our workflows Monorepo Tooling Downstream monorepo generation tools $ git apple-llvm … Auto merger infrastructure and tools $ git apple-llvm am … GitHub PR & CI tools $ git apple-llvm pr … � github.com/apple/apple-llvm-infrastructure-tools � LLVM Project License Generating Downstream Monorepos Downstreams @ Apple https://git.llvm.org/git/{llvm,clang,lldb,...}.git 3+ levels of forks / branches Each level had llvm, clang, lldb, etc. github.com/apple/swift-{llvm,clang,lldb,...} Git merges used between levels Internal master branch for llvm, clang, lldb, … Additional branches/forks of llvm, clang, … Monorepo Concerns Can we preserve downstream history? github.com/apple/swift-{llvm,clang,lldb,...} Can historic checkouts build clang and lldb? Are all downstream branches preserved? Internal master branch for llvm, clang, lldb, … � Additional branches/forks of llvm, clang, … Monorepo Concerns Can we preserve downstream history? Yes… Can historic checkouts build clang and lldb? Are all downstream branches preserved? Let’s generate the Git history ourselves llvm clang Creating New History downstream downstream llvm.org To generate a branch: llvm.org Interleave first-parentYes… generated commits Order the disjoint commits by date PrioritizeLet’s generate merges thebased Git onhistory directory ourselves To generate a non-llvm.org commit: Move Git tree to a subdirectory Rewrite parents to new commit hashes Generated monorepo llvm clang downstream downstream llvm.org llvm.org Generated monorepo Generated Monorepo Upstream monorepo hashes are used Downstream commit history preserved Downstream tags preserved A checkout of any downstream commit contains full downstream monorepo � Workflow Improvements Auto Merger Merges upstream branches downstream llvm.org/master � Configuration in target branch Builds and tests before merging apple/master apple/stable/20190619 Merge conflicts create PRs swift/master-next swift/master PR & CI Tools Create, merge and list monorepo PRs $ git apple-llvm pr test #42 Triggering pull request testing for pr #42 by hyp: Support git-cat-file as read_file function Test PRs using custom Jenkins test plans ✅ you commented "@swift-ci please test" on the pull request. Test PRs using swift-ci The End Thank you!.