You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add utility scripts for upstream merge process and update .gitignore
- Introduced `merge-upstream-start.sh` to prepare workspace for upstream merges.
- Added `merge-upstream-diff.sh` for detailed diff analysis of upstream changes.
- Created `merge-upstream-finish.sh` to finalize merges and push branches.
- Added `format-and-test.sh` for running formatting and testing in one command.
- Updated `.gitignore` to exclude the generated `.merge-env` file.
Copy file name to clipboardExpand all lines: .github/prompts/agentic-merge-upstream.prompt.md
+51-87Lines changed: 51 additions & 87 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,100 +13,74 @@ You are an expert Java developer tasked with porting changes from the official C
13
13
14
14
Before making any changes, **read and understand the existing Java SDK implementation** to ensure new code integrates seamlessly.
15
15
16
-
## Workflow Overview
17
-
18
-
1. Create a new branch from main
19
-
2. Update Copilot CLI to latest version
20
-
3. Update README with minimum CLI version requirement
21
-
4. Clone upstream repository
22
-
5. Analyze diff since last merge
23
-
6. Apply changes to Java SDK (commit as you go)
24
-
7. Test and fix issues
25
-
8. Update documentation
26
-
9. Push branch to remote for Pull Request review
27
-
28
-
---
16
+
## Utility Scripts
29
17
30
-
## Step 1: Create a New Branch
18
+
The `.github/scripts/` directory contains helper scripts that automate the repeatable parts of this workflow. **Use these scripts instead of running the commands manually.**
31
19
32
-
Before starting any work, create a new branch from `main` to isolate the merge changes:
# Create a new branch with a descriptive name including the date
40
-
BRANCH_NAME="merge-upstream-$(date +%Y%m%d)"
41
-
git checkout -b "$BRANCH_NAME"
42
-
echo"Created branch: $BRANCH_NAME"
43
-
```
27
+
All scripts write/read a `.merge-env` file (git-ignored) to share state (branch name, upstream dir, last-merge commit).
44
28
45
-
**Important:** All changes will be committed to this branch as you work. This allows for proper review via Pull Request.
29
+
## Workflow Overview
46
30
47
-
## Step 2: Update Copilot CLI
31
+
1. Run `./.github/scripts/merge-upstream-start.sh` (creates branch, clones upstream, shows summary)
32
+
2. Run `./.github/scripts/merge-upstream-diff.sh` (analyze changes)
33
+
3. Update README with minimum CLI version requirement
34
+
4. Port changes to Java SDK (commit as you go)
35
+
5. Run `./.github/scripts/format-and-test.sh` frequently while porting
36
+
6. Update documentation
37
+
7. Run `./.github/scripts/merge-upstream-finish.sh` (final test + push)
38
+
8. Create Pull Request
48
39
49
-
Update the locally installed GitHub Copilot CLI to the latest version:
40
+
---
50
41
51
-
```bash
52
-
copilot update
53
-
```
42
+
## Steps 1-2: Initialize and Analyze
54
43
55
-
After updating, capture the new version and update the README.md to reflect the minimum version requirement:
44
+
Run the start script to create a branch, update the CLI, clone the upstream repo, and see a summary of new commits:
56
45
57
46
```bash
58
-
# Get the current version
59
-
CLI_VERSION=$(copilot --version | head -n 1 | awk '{print $NF}')
60
-
echo"Updated Copilot CLI to version: $CLI_VERSION"
47
+
./.github/scripts/merge-upstream-start.sh
61
48
```
62
49
63
-
Update the Requirements section in `README.md` to specify the minimum CLI version requirement. Locate the line mentioning "GitHub Copilot CLI installed" and update it to include the version information.
50
+
This writes a `.merge-env` file used by the other scripts. It outputs:
51
+
- The branch name created
52
+
- The Copilot CLI version
53
+
- The upstream dir path
54
+
- A short log of upstream commits since `.lastmerge`
64
55
65
-
Commit this change before proceeding:
56
+
Then run the diff script for a detailed breakdown by area:
66
57
67
58
```bash
68
-
git add README.md
69
-
git commit -m "Update Copilot CLI minimum version requirement to $CLI_VERSION"
59
+
./.github/scripts/merge-upstream-diff.sh # stat only
60
+
./.github/scripts/merge-upstream-diff.sh --full # full diffs
70
61
```
71
62
72
-
## Step 3: Clone Upstream Repository
73
-
74
-
Clone the official Copilot SDK repository into a temporary folder:
63
+
The diff script groups changes into: .NET source, .NET tests, test snapshots, documentation, protocol/config, Go/Node.js/Python SDKs, and other files.
After the start script runs, check the CLI version it printed (also saved in `.merge-env` as `CLI_VERSION`). Update the Requirements section in `README.md` and `src/site/markdown/index.md` to specify the minimum CLI version requirement.
83
68
84
-
Read the commit hash from `.lastmerge` file in the Java SDK root:
69
+
Commit this change before proceeding:
85
70
86
71
```bash
87
-
LAST_MERGE_COMMIT=$(cat .lastmerge)
88
-
echo"Last merged commit: $LAST_MERGE_COMMIT"
72
+
git add README.md src/site/markdown/index.md
73
+
git commit -m "Update Copilot CLI minimum version requirement"
89
74
```
90
75
91
-
## Step 5: Analyze Changes
92
-
93
-
Generate a diff between the last merged commit and HEAD of main:
0 commit comments