Cross projects MR with CLI tool
Summary
According to the discussion, I want to describe the cross repos MR feature that JiHu is currently developing.
- the target scenario is for developing AOSP-based product, which
Gerritis the current tool for best practice - we developed a CLI tool called
mono, which is refactored based onrepotool .Gerritusesrepotool to handle cross-repo push operations. - AOSP project contains hundreds of repos. Basically to develop a new feature, developers need to commit changes on multiple repos and push them via
repotool to Gerrit and create several changes (where Gerrit do code review and aproval). Similarly, we require users to push their commits viamonotool to GitLab and create several MRs, and each repository creates 1 MR for all the commits within it.
User Workflow
Scenario: Suppose the developer is developing a new feature for AOSP product, and it require changes on 3 repos named A, B and C, and each will create a MR named MR-A, MR-B, MR-C
- the developer needs to create feature branches via
monotool locally.
## create branch in current repo
mono start FEATURE_BRANCH_NAME .
## create branch in all repos
mono start FEATURE_BRANCH_NAME -all
- the developer completes all the development work, and pushed all the commits to the remote server via
monotool
## pull the remote changes and checks conflicts
mono sync
## push all the local commits in all the repos to the remote server
mono upload
- The remote server will create the corresponding
MR-A,MR-B, andMR-Cin each repo(project), and will unify them with the labelmonorepo, which are distinguished as related MRs with their branch name, and at the same time, the original merge button on the MR detail page will be hidden, and a new component withMerge Allbutton will be added.- Why need label
monorepo? We need to distinguish those cross-repo MRs from normal MRs, so we need to add a new field. However, JiHu-only approach cannot add extra database schema due tech limitation, so we use label as a workaround - Why need a new component? For JiHu-only approach, this has lower risk of forking conflicts
- Why need label
- the developer chooses
MR-Ato view the detail, and sees the all the related MRs in the new component
Edited by 🤖 GitLab Bot 🤖






