Bug 1891342 - Part 2: Update iconAccentViolet color to Violet70 r=android-reviewers...
[gecko.git] / mobile / android / fenix / docs / Guide-to-merging-contributor-PRs.md
blob5af5caed72dece55adeb8c0937554b0c26698d02
1 # Guide to merging contributor PRs for Firefox Android team members
3 Contributor PRs will run only a specific suite of CI tests (excluding UI tests) in order to protect secrets. Use the following steps when reviewing and merging a contributor PR.
5 ## Process for landing contributor PR
6 _Note: these instructions use https://cli.github.com/_
8 1. Fetch upstream changes and locally check out the contributor's branch onto your fork.
9 ```sh
10 git fetch --all
11 gh pr checkout <PR number>
13 # Example:
14 gh pr checkout 1234 # for https://github.com/mozilla-mobile/firefox-android/pull/1234
15 ```
16 2. Build and run contributor's changes locally to verify that it works correctly.
18 3. Review the code to make sure everything is clean.
20 4. ~~Once a Firefox Android team member has reviewed the PR and deemed it safe, comment the following to start UI tests.
21    ```bors try```~~
22    `Bors` public instance is now offline, as they announced in [their newsletter](https://bugzilla.mozilla.org/show_bug.cgi?id=1850420). Please refer to section "Process for running UI tests on a contributor PR" above.
25 5. Once the UI tests have all completed and passed, approve the PR and add `approved` and `needs landing` label the contributor's PR.
27 6. Monitor the merging process to make sure it lands as expected.
29 ## Process for running UI tests on a contributor PR
31 1. Make sure you have already checked out the contributor's branch onto your fork, following the previous session's first step.
32 ```sh
33 git fetch --all
34 gh pr checkout <PR number>
36 # Example:
37 gh pr checkout 1234 # for https://github.com/mozilla-mobile/firefox-android/pull/1234
38 ```
40 3. Rename your local branch's to any name
41 ```
42 git branch -m <new branch name>
44 # Example: If the contributor's branch is named `eliserichards:my-fun-branch1`
45 git branch -m ci-for-my-fun-branch1
46 ```
48 3. Push branch to your fork using any branch name:
49 ```sh
50 git push origin <pr-branch-name>
52 # Example: If the contributor's branch is named `eliserichards:my-fun-branch1`
53 git push origin ci-for-my-fun-branch1
54 ```
56 4. Create a PR from _your fork's_ copy of the branch e.g. https://github.com/mozilla-mobile/firefox-android/compare/main...eliserichards:my-fun-branch1
58 * Please note in the PR description which PR you are running CI for. Example: https://github.com/mozilla-mobile/firefox-android/pull/4577
60 ***
62 **Once you create this PR, the CI for both the original and the duplicate PRs will run. When everything is green, you can merge either of them.**
64 5. To land the original:
65 * i. Make sure that contributor's branch hasn't diverged from yours (they must have the same SHA).
66 * ii. The change has to be on the top of the main branch when it is first in line in the merge queue.
67 * iii. It requires the needs-landing label.
69 **NB**: Adding `needs-landing` label while failing to ensure the same SHA will block the mergify queue and will require manual intervention: mergify will trigger CI for the original PR again and wait for it to finish, but CI won’t run all the checks because there is no PR with the same SHA any more that backs it up. If that happens, talk to the release team.
72 ## Process for updating contributor PR (if contributor needs help or is unresponsive)
74 ```sh
75 git remote add <Contributor remote name> <Contributor repository>
76 git checkout <Contributor remote name>/<Contributor branch name>
77 git rebase upstream/main (or any other actions you want to fixup in their PR)
78 git push <Contributor remote name> HEAD:<Contributor branch name> -f
79 ```