|
1 | 1 | --- |
2 | | -description: Before pushing a PR, sync with master and request Copilot review |
| 2 | +description: Before pushing a PR, verify no merge issues with master and request Copilot review with a review brief |
3 | 3 | alwaysApply: true |
4 | 4 | --- |
5 | 5 |
|
6 | | -# Pull requests: master sync and Copilot review |
| 6 | +# Pull requests: merge health, Copilot review, and review brief |
7 | 7 |
|
8 | | -When preparing or pushing a PR (or when the user mentions opening a PR), do this **before** the final push: |
| 8 | +When preparing or **pushing updates to a PR** (or opening one), do this **before** and **after** push: |
9 | 9 |
|
10 | | -## 1. Merge conflicts with `master` |
| 10 | +## 1. Merge issues with the base branch (`master`) |
11 | 11 |
|
12 | | -- Fetch and integrate the default branch so the branch is up to date and conflicts are visible early. |
13 | | -- Use the repo’s default branch name; this project uses **`master`**. |
| 12 | +- Fetch and integrate the default branch so conflicts and skew show up **locally** before CI/GitHub. |
| 13 | +- This project uses **`master`** as the usual base; if the PR targets another branch, use that instead. |
14 | 14 |
|
15 | | -**Commands (run from the feature branch):** |
| 15 | +**Before push (from the feature branch):** |
16 | 16 |
|
17 | 17 | ```bash |
18 | 18 | git fetch origin master |
19 | 19 | git merge origin/master |
20 | 20 | # or: git rebase origin/master |
21 | 21 | ``` |
22 | 22 |
|
23 | | -- If merge/rebase reports conflicts, resolve them, run tests if applicable, then continue. |
24 | | -- Optionally compare without merging: `git fetch origin master` then `git log --oneline HEAD..origin/master` to see what would come in. |
| 23 | +- If merge/rebase fails, **resolve conflicts**, run tests if the project expects them, then continue. |
| 24 | +- After push, confirm the PR is mergeable: GitHub PR page should show **no merge conflicts**; or run `gh pr view <n> --json mergeable,mergeStateStatus` (requires `gh`). |
25 | 25 |
|
26 | | -**Never** push a PR branch that has not been checked against current `master` when the PR targets `master`. |
| 26 | +**Never** push a PR branch that has **not** been checked against current `origin/master` when the PR targets `master`. |
27 | 27 |
|
28 | | -## 2. GitHub Copilot review |
| 28 | +If `master` is not the default base, use `origin/HEAD` or the branch shown in GitHub’s base selector. |
29 | 29 |
|
30 | | -After the PR exists (or right after push): |
| 30 | +## 2. GitHub Copilot review + what to review |
31 | 31 |
|
32 | | -- Ask the user to **request a Copilot review** on the PR on GitHub (PR page → **Reviewers** → **Copilot** / **Request review from Copilot**, or the **Copilot** / **Request review** control in the PR UI, depending on org settings). |
33 | | -- If automation is available (e.g. `@copilot` in a comment), mention that as an alternative. |
| 32 | +After the PR exists or immediately after you push: |
34 | 33 |
|
35 | | -**Reminder text you can give the user:** |
36 | | -“Open the PR on GitHub and request a review from **GitHub Copilot** so it can comment on the diff before merge.” |
| 34 | +1. **Request Copilot as a reviewer** (open PR → **Reviewers** → request **Copilot**, or CLI: `gh pr edit <number> --add-reviewer "@copilot"` when supported). |
| 35 | +2. **Give Copilot a short description of what to review** so the pass is useful — do not rely on the title alone. |
37 | 36 |
|
38 | | -## 3. Short checklist |
| 37 | +**Use one of these (prefer a PR comment so it stays on the record):** |
39 | 38 |
|
40 | | -1. `git fetch origin master` and merge or rebase onto `origin/master`. |
41 | | -2. Resolve conflicts; build/test if the project has a standard check. |
42 | | -3. Push the branch; open or update the PR. |
43 | | -4. Request **Copilot** review on the PR. |
| 39 | +- Add a **comment** on the PR, e.g. |
| 40 | + **“@copilot Please review: [2–5 bullets — e.g. correctness of X, edge cases for Y, security of Z, whether tests cover W, style/conventions]. Focus especially on …”** |
| 41 | +- Or set / supplement the PR **description** with a **“Review focus for Copilot”** section with the same bullets. |
44 | 42 |
|
45 | | -If `master` is not the default branch for this repo, use `origin/HEAD` or the branch shown in GitHub’s branch dropdown instead. |
| 43 | +**Example review brief:** |
| 44 | + |
| 45 | +```text |
| 46 | +@copilot Review focus: |
| 47 | +- Whether the change matches intended behavior in … |
| 48 | +- Edge cases: … |
| 49 | +- Tests: are … covered? |
| 50 | +- Any security or data-handling concerns in … |
| 51 | +``` |
| 52 | + |
| 53 | +If `@copilot` does not trigger in your org, still leave the **Review focus** section for human reviewers and request **Copilot** via the Reviewers UI. |
| 54 | + |
| 55 | +## 3. Checklist |
| 56 | + |
| 57 | +1. `git fetch origin master` → merge or rebase onto `origin/master`; fix conflicts. |
| 58 | +2. Push the branch; confirm PR has **no merge conflicts** with base. |
| 59 | +3. Request **Copilot** review; add a **review brief** (comment or PR body) describing what to examine. |
0 commit comments