Skip to content

Commit 836b3e4

Browse files
Upgrades version to v2.1.0 (#1488)
* Adds skill for updating version number * Updates version to v2.1.0 * Update .github/skills/upgrade-devproxy-version/scripts/upgrade-version.sh Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent e9d21a1 commit 836b3e4

File tree

57 files changed

+2064
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2064
-31
lines changed
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
---
2+
name: upgrade-devproxy-version
3+
description: >
4+
This skill should be used when the user asks to "upgrade Dev Proxy version",
5+
"bump Dev Proxy to a new version", "update version to X.Y.Z", "release new
6+
Dev Proxy version", or mentions version upgrades in the Dev Proxy repository.
7+
Handles copying schema folders and updating version strings across csproj,
8+
config, installer, and source files.
9+
---
10+
11+
# Upgrade Dev Proxy Version
12+
13+
Bump Dev Proxy from current version to a new version across all project files.
14+
15+
## Prerequisites
16+
17+
Confirm the Dev Proxy workspace is open:
18+
- Workspace root: contains `DevProxy.sln`
19+
- Schema folder: `./schemas/v<current-version>/` exists
20+
- Project files: `DevProxy/`, `DevProxy.Abstractions/`, `DevProxy.Plugins/` present
21+
22+
## Upgrade Process
23+
24+
### Step 1: Identify Current Version
25+
26+
Find current version from `DevProxy/DevProxy.csproj`:
27+
28+
```xml
29+
<Version>X.Y.Z</Version>
30+
```
31+
32+
### Step 2: Copy Schema Folder
33+
34+
Copy the schema folder to the new version:
35+
36+
```bash
37+
cp -r ./schemas/v<current-version> ./schemas/v<new-version>
38+
```
39+
40+
### Step 3: Update Version Strings
41+
42+
Update version in all relevant files. There are two categories:
43+
44+
**Category A: Assembly/Package Version** (format: `X.Y.Z`)
45+
Update `<Version>X.Y.Z</Version>` in:
46+
- `DevProxy/DevProxy.csproj`
47+
- `DevProxy.Abstractions/DevProxy.Abstractions.csproj`
48+
- `DevProxy.Plugins/DevProxy.Plugins.csproj`
49+
50+
**Category B: Schema URLs** (format: `vX.Y.Z` in URL paths)
51+
Update `schemas/v<old>/` to `schemas/v<new>/` in:
52+
- `DevProxy/devproxyrc.json` - `$schema` URLs
53+
- `DevProxy/devproxy-errors.json` - `$schema` URL
54+
- `DevProxy/config/m365.json` - all `$schema` URLs
55+
- `DevProxy/config/m365-mocks.json` - `$schema` URL
56+
- `DevProxy/config/microsoft-graph.json` - all `$schema` URLs
57+
- `DevProxy/config/microsoft-graph-rate-limiting.json` - `$schema` URL
58+
- `DevProxy/config/spo-csom-types.json` - `$schema` URL
59+
- `DevProxy.Plugins/Mocking/MockResponsePlugin.cs` - hardcoded schema URL
60+
61+
**Category C: Installer Files** (format: `X.Y.Z` or `X.Y.Z-beta.N`)
62+
Update version in:
63+
- `install.iss`:
64+
- `#define MyAppSetupExeName "dev-proxy-installer-win-x64-X.Y.Z"`
65+
- `#define MyAppVersion "X.Y.Z"`
66+
- `install-beta.iss`:
67+
- `#define MyAppSetupExeName "dev-proxy-installer-win-x64-X.Y.Z-beta.N"`
68+
- `#define MyAppVersion "X.Y.Z-beta.N"`
69+
70+
**Category D: Script Files** (format: `vX.Y.Z` or `vX.Y.Z-beta.N`)
71+
Update version string in:
72+
- `scripts/local-setup.ps1` - `$versionString = "vX.Y.Z-beta.N"`
73+
- `scripts/version.ps1` - `$script:versionString = "vX.Y.Z-beta.N"`
74+
75+
**Category E: Dockerfiles** (format: `X.Y.Z` or `X.Y.Z-beta.N`)
76+
Update `DEVPROXY_VERSION` ARG in:
77+
- `Dockerfile` - `ARG DEVPROXY_VERSION=X.Y.Z`
78+
- `Dockerfile_beta` - `ARG DEVPROXY_VERSION=X.Y.Z`
79+
- `scripts/Dockerfile_local` - `ARG DEVPROXY_VERSION=X.Y.Z-beta.N`
80+
81+
## Version Formats
82+
83+
Different files use different version formats:
84+
85+
| Location | Format | Example |
86+
|----------|--------|---------|
87+
| csproj `<Version>` | `X.Y.Z` | `2.1.0` |
88+
| Schema URL path | `vX.Y.Z` | `v2.1.0` |
89+
| Installer stable | `X.Y.Z` | `2.1.0` |
90+
| Installer beta | `X.Y.Z-beta.N` | `2.1.0-beta.1` |
91+
| Script version | `vX.Y.Z-beta.N` | `v2.1.0-beta.1` |
92+
| Dockerfile stable | `X.Y.Z` | `2.1.0` |
93+
| Dockerfile beta | `X.Y.Z-beta.N` | `2.1.0-beta.1` |
94+
95+
## Execution Steps
96+
97+
1. **Ask** for the target version if not provided
98+
2. **Detect** current version from `DevProxy/DevProxy.csproj`
99+
3. **Copy** schema folder: `cp -r ./schemas/v{old} ./schemas/v{new}`
100+
4. **Update** Category A files (csproj Version tags)
101+
5. **Update** Category B files (schema URLs in JSON and CS files)
102+
6. **Update** Category C files (installer definitions)
103+
7. **Update** Category D files (PowerShell version strings)
104+
8. **Update** Category E files (Dockerfiles)
105+
9. **Report** summary of changes made
106+
107+
## Automation Script
108+
109+
Use the bundled script to automate the upgrade:
110+
111+
```bash
112+
.github/skills/upgrade-devproxy-version/scripts/upgrade-version.sh <new-version> [workspace-root]
113+
```
114+
115+
Example:
116+
```bash
117+
.github/skills/upgrade-devproxy-version/scripts/upgrade-version.sh 2.1.0 .
118+
```
119+
120+
The script handles all categories automatically, including detecting the current version and applying appropriate beta suffixes where needed.
121+
122+
## Important Notes
123+
124+
- Schema folder copy creates a new folder; existing version folder is preserved
125+
- Do NOT update `System.CommandLine` package version (coincidentally `2.0.0-beta5`)
126+
- Do NOT update `.vscode/tasks.json` version (different context)
127+
- Beta releases: installer-beta.iss and script files use `-beta.N` suffix
128+
- Stable releases: install.iss uses plain `X.Y.Z`
129+
130+
## Search Patterns
131+
132+
To find all version references, use:
133+
134+
```bash
135+
# Assembly versions
136+
grep -r "X\.Y\.Z" --include="*.csproj"
137+
138+
# Schema URLs
139+
grep -r "schemas/vX\.Y\.Z" --include="*.json" --include="*.cs"
140+
141+
# Installer versions
142+
grep -r "X\.Y\.Z" --include="*.iss"
143+
144+
# Script versions
145+
grep -r "vX\.Y\.Z" --include="*.ps1"
146+
```
147+
148+
## Example: Upgrade from 2.0.0 to 2.1.0
149+
150+
```bash
151+
# Step 1: Copy schemas
152+
cp -r ./schemas/v2.0.0 ./schemas/v2.1.0
153+
154+
# Step 2: Find and update all version strings
155+
# (Use grep/sed or editor find-replace)
156+
```
157+
158+
Files to update:
159+
- 3 csproj files: `2.0.0``2.1.0`
160+
- ~20 schema URLs: `v2.0.0``v2.1.0`
161+
- 2 installer files: version defines
162+
- 2 PowerShell scripts: version strings
163+
- 3 Dockerfiles: DEVPROXY_VERSION ARG
164+
165+
## Verification
166+
167+
After upgrade, verify:
168+
169+
1. All three csproj files show new `<Version>`
170+
2. Schema folder `./schemas/v{new}/` exists
171+
3. All JSON config files reference new schema version
172+
4. `dotnet build` succeeds
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
#!/bin/bash
2+
# upgrade-version.sh - Upgrade Dev Proxy version
3+
# Usage: ./upgrade-version.sh <new-version> [workspace-root]
4+
#
5+
# Example: ./upgrade-version.sh 2.1.0 /path/to/dev-proxy
6+
7+
set -e
8+
9+
NEW_VERSION="${1}"
10+
WORKSPACE_ROOT="${2:-.}"
11+
12+
if [[ -z "$NEW_VERSION" ]]; then
13+
echo "Usage: $0 <new-version> [workspace-root]"
14+
echo "Example: $0 2.1.0 /path/to/dev-proxy"
15+
exit 2
16+
fi
17+
18+
# Validate workspace
19+
if [[ ! -f "$WORKSPACE_ROOT/DevProxy.sln" ]]; then
20+
echo "Error: DevProxy.sln not found in $WORKSPACE_ROOT"
21+
exit 1
22+
fi
23+
24+
# Extract current version from DevProxy.csproj
25+
CURRENT_VERSION=$(sed -n 's/.*<Version>\([^<][^<]*\)<\/Version>.*/\1/p' "$WORKSPACE_ROOT/DevProxy/DevProxy.csproj" | head -1)
26+
27+
if [[ -z "$CURRENT_VERSION" ]]; then
28+
echo "Error: Could not determine current version"
29+
exit 1
30+
fi
31+
32+
echo "Upgrading Dev Proxy from $CURRENT_VERSION to $NEW_VERSION"
33+
echo "Workspace: $WORKSPACE_ROOT"
34+
echo ""
35+
36+
# Step 1: Copy schema folder
37+
echo "Step 1: Copying schema folder..."
38+
if [[ -d "$WORKSPACE_ROOT/schemas/v$CURRENT_VERSION" ]]; then
39+
cp -r "$WORKSPACE_ROOT/schemas/v$CURRENT_VERSION" "$WORKSPACE_ROOT/schemas/v$NEW_VERSION"
40+
echo " Created: schemas/v$NEW_VERSION"
41+
else
42+
echo " Warning: schemas/v$CURRENT_VERSION not found, skipping schema copy"
43+
fi
44+
45+
# Step 2: Update csproj files (Category A)
46+
echo ""
47+
echo "Step 2: Updating csproj Version tags..."
48+
for csproj in DevProxy/DevProxy.csproj DevProxy.Abstractions/DevProxy.Abstractions.csproj DevProxy.Plugins/DevProxy.Plugins.csproj; do
49+
if [[ -f "$WORKSPACE_ROOT/$csproj" ]]; then
50+
sed -i '' "s|<Version>$CURRENT_VERSION</Version>|<Version>$NEW_VERSION</Version>|g" "$WORKSPACE_ROOT/$csproj"
51+
echo " Updated: $csproj"
52+
fi
53+
done
54+
55+
# Step 3: Update schema URLs in JSON and CS files (Category B)
56+
echo ""
57+
echo "Step 3: Updating schema URLs..."
58+
# JSON files
59+
for json in DevProxy/devproxyrc.json DevProxy/devproxy-errors.json DevProxy/config/*.json; do
60+
if [[ -f "$WORKSPACE_ROOT/$json" ]]; then
61+
sed -i '' "s|schemas/v$CURRENT_VERSION/|schemas/v$NEW_VERSION/|g" "$WORKSPACE_ROOT/$json"
62+
echo " Updated: $json"
63+
fi
64+
done
65+
66+
# CS files with hardcoded schema URLs
67+
MOCK_PLUGIN="$WORKSPACE_ROOT/DevProxy.Plugins/Mocking/MockResponsePlugin.cs"
68+
if [[ -f "$MOCK_PLUGIN" ]]; then
69+
sed -i '' "s|schemas/v$CURRENT_VERSION/|schemas/v$NEW_VERSION/|g" "$MOCK_PLUGIN"
70+
echo " Updated: DevProxy.Plugins/Mocking/MockResponsePlugin.cs"
71+
fi
72+
73+
# Step 4: Update installer files (Category C)
74+
echo ""
75+
echo "Step 4: Updating installer files..."
76+
# Stable installer
77+
if [[ -f "$WORKSPACE_ROOT/install.iss" ]]; then
78+
sed -i '' "s|dev-proxy-installer-win-x64-$CURRENT_VERSION\"|dev-proxy-installer-win-x64-$NEW_VERSION\"|g" "$WORKSPACE_ROOT/install.iss"
79+
sed -i '' "s|MyAppVersion \"$CURRENT_VERSION\"|MyAppVersion \"$NEW_VERSION\"|g" "$WORKSPACE_ROOT/install.iss"
80+
echo " Updated: install.iss"
81+
fi
82+
83+
# Beta installer (handle beta suffix separately if needed)
84+
if [[ -f "$WORKSPACE_ROOT/install-beta.iss" ]]; then
85+
# Extract current beta version
86+
CURRENT_BETA=$(grep -oP '(?<=MyAppVersion ")[^"]+' "$WORKSPACE_ROOT/install-beta.iss" | head -1)
87+
if [[ -n "$CURRENT_BETA" ]]; then
88+
# Determine new beta version - if NEW_VERSION doesn't have beta suffix, add -beta.1
89+
if [[ "$NEW_VERSION" == *"-beta"* ]]; then
90+
NEW_BETA="$NEW_VERSION"
91+
else
92+
NEW_BETA="${NEW_VERSION}-beta.1"
93+
fi
94+
sed -i '' "s|dev-proxy-installer-win-x64-$CURRENT_BETA\"|dev-proxy-installer-win-x64-$NEW_BETA\"|g" "$WORKSPACE_ROOT/install-beta.iss"
95+
sed -i '' "s|MyAppVersion \"$CURRENT_BETA\"|MyAppVersion \"$NEW_BETA\"|g" "$WORKSPACE_ROOT/install-beta.iss"
96+
echo " Updated: install-beta.iss (to $NEW_BETA)"
97+
fi
98+
fi
99+
100+
# Step 5: Update PowerShell scripts (Category D)
101+
echo ""
102+
echo "Step 5: Updating PowerShell scripts..."
103+
for ps1 in scripts/local-setup.ps1 scripts/version.ps1; do
104+
if [[ -f "$WORKSPACE_ROOT/$ps1" ]]; then
105+
# These use format like "v2.0.0-beta.1"
106+
CURRENT_PS_VERSION=$(grep -oP '(?<=versionString = ")[^"]+' "$WORKSPACE_ROOT/$ps1" | head -1)
107+
if [[ -n "$CURRENT_PS_VERSION" ]]; then
108+
# Determine new PS version
109+
if [[ "$NEW_VERSION" == *"-beta"* ]]; then
110+
NEW_PS_VERSION="v$NEW_VERSION"
111+
else
112+
NEW_PS_VERSION="v${NEW_VERSION}-beta.1"
113+
fi
114+
sed -i '' "s|$CURRENT_PS_VERSION|$NEW_PS_VERSION|g" "$WORKSPACE_ROOT/$ps1"
115+
echo " Updated: $ps1 (to $NEW_PS_VERSION)"
116+
fi
117+
fi
118+
done
119+
120+
# Step 6: Update Dockerfiles (Category E)
121+
echo ""
122+
echo "Step 6: Updating Dockerfiles..."
123+
# Stable Dockerfiles
124+
for dockerfile in Dockerfile Dockerfile_beta; do
125+
if [[ -f "$WORKSPACE_ROOT/$dockerfile" ]]; then
126+
sed -i '' "s|DEVPROXY_VERSION=$CURRENT_VERSION|DEVPROXY_VERSION=$NEW_VERSION|g" "$WORKSPACE_ROOT/$dockerfile"
127+
echo " Updated: $dockerfile"
128+
fi
129+
done
130+
131+
# Beta/local Dockerfile (uses beta suffix)
132+
if [[ -f "$WORKSPACE_ROOT/scripts/Dockerfile_local" ]]; then
133+
# Extract current version from Dockerfile_local
134+
CURRENT_DOCKER_LOCAL=$(grep -oP '(?<=DEVPROXY_VERSION=)[^\s]+' "$WORKSPACE_ROOT/scripts/Dockerfile_local" | head -1)
135+
if [[ -n "$CURRENT_DOCKER_LOCAL" ]]; then
136+
if [[ "$NEW_VERSION" == *"-beta"* ]]; then
137+
NEW_DOCKER_LOCAL="$NEW_VERSION"
138+
else
139+
NEW_DOCKER_LOCAL="${NEW_VERSION}-beta.1"
140+
fi
141+
sed -i '' "s|DEVPROXY_VERSION=$CURRENT_DOCKER_LOCAL|DEVPROXY_VERSION=$NEW_DOCKER_LOCAL|g" "$WORKSPACE_ROOT/scripts/Dockerfile_local"
142+
echo " Updated: scripts/Dockerfile_local (to $NEW_DOCKER_LOCAL)"
143+
fi
144+
fi
145+
146+
echo ""
147+
echo "=== Upgrade Complete ==="
148+
echo "From: $CURRENT_VERSION"
149+
echo "To: $NEW_VERSION"
150+
echo ""
151+
echo "Next steps:"
152+
echo "1. Review changes: git diff"
153+
echo "2. Build: dotnet build"
154+
echo "3. Test: dotnet run --project DevProxy"

DevProxy.Abstractions/DevProxy.Abstractions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<RootNamespace>DevProxy.Abstractions</RootNamespace>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8-
<Version>2.0.0</Version>
8+
<Version>2.1.0</Version>
99
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
1010
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
1111
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

DevProxy.Plugins/DevProxy.Plugins.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Nullable>enable</Nullable>
77
<EnableDynamicLoading>true</EnableDynamicLoading>
88
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
9-
<Version>2.0.0</Version>
9+
<Version>2.1.0</Version>
1010
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
1111
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
1212
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

DevProxy.Plugins/Mocking/MockResponsePlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public sealed class MockResponseConfiguration
3636
[JsonIgnore]
3737
public bool NoMocks { get; set; }
3838
[JsonPropertyName("$schema")]
39-
public string Schema { get; set; } = "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/mockresponseplugin.mocksfile.schema.json";
39+
public string Schema { get; set; } = "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.1.0/mockresponseplugin.mocksfile.schema.json";
4040
}
4141

4242
public class MockResponsePlugin(

DevProxy/DevProxy.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<Nullable>enable</Nullable>
99
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1010
<Title>Dev Proxy</Title>
11-
<Version>2.0.0</Version>
11+
<Version>2.1.0</Version>
1212
<Company>.NET Foundation</Company>
1313
<Product>Dev Proxy</Product>
1414
<AssemblyName>devproxy</AssemblyName>

DevProxy/config/m365-mocks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/mockresponseplugin.mocksfile.schema.json",
2+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.1.0/mockresponseplugin.mocksfile.schema.json",
33
"mocks": [
44
{
55
"request": {

0 commit comments

Comments
 (0)