|
| 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 |
0 commit comments