Skip to content

Commit 0165799

Browse files
cartertinneyCopilotCopilot
authored
chore: Additional CI configuration (#1251)
## Summary - stabilize ADO `uv` cache keys by resolving dependency upgrades before `Cache@2` hashes `uv.lock` - cancel superseded PR pipeline runs when a newer commit is pushed - run all active ADO validation pipelines for stacked PRs targeting feature branches, while keeping push CI limited to `main` ## Details The upgraded lockfile is now resolved without populating the download cache, then `Cache@2` restores the cache using the final lock hash and `uv sync --locked` installs from it. This preserves testing against newest compatible dependencies without changing the cache key between restore and save. Build, DPS E2E, Python E2E, and Horton E2E now explicitly set `pr.autoCancel: true` and accept every PR target branch. GitHub Actions already has equivalent per-PR cancellation and an unrestricted `pull_request` trigger. ## Validation - parsed all modified ADO YAML files - mechanically verified install -> lock upgrade -> cache restore -> locked sync ordering in every cached job - reproduced the reported pre/post lock hash change locally and verified `uv sync --locked` preserves the resolved hash - verified push triggers remain restricted to `main` - verified all four active ADO PR triggers use `autoCancel: true` and accept `'*'` target branches --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 0a414f2 commit 0165799

7 files changed

Lines changed: 50 additions & 25 deletions

File tree

‎devbox_setup.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ uv run pre-commit install
2121

2222
`uv sync` installs the SDK and all development dependency groups into `.venv`. Source changes are immediately reflected because the SDK and `dev_utils` are installed editably.
2323

24-
The checked-in `uv.lock` provides a reproducible contributor environment. CI deliberately runs `uv sync --upgrade` so the library is also tested against the newest compatible dependencies.
24+
The checked-in `uv.lock` provides a reproducible contributor environment. Cached Azure Pipelines E2E jobs deliberately resolve an upgraded lockfile before caching, then run `uv sync --locked` so the library is tested against the newest compatible dependencies without changing the cache key during a job.
2525

2626
Common commands:
2727

‎vsts/build.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ trigger:
44
- main
55

66
pr:
7+
autoCancel: true
78
branches:
89
include:
9-
- main
10+
- '*'
1011

1112
resources:
1213
- repo: self

‎vsts/dps-e2e.yaml‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ trigger:
44
- main
55

66
pr:
7+
autoCancel: true
78
branches:
89
include:
9-
- main
10+
- '*'
1011

1112
resources:
1213
- repo: self
@@ -287,6 +288,13 @@ stages:
287288
versionSpec: '3.10'
288289
architecture: 'x64'
289290

291+
- script: 'python -m pip install uv'
292+
displayName: 'Install uv'
293+
294+
# Resolve upgrades before Cache@2 hashes uv.lock so its save key stays stable.
295+
- script: 'uv lock --upgrade --python 3.10 --no-cache'
296+
displayName: 'Resolve latest dependencies'
297+
290298
# Cache downloads without reusing the job environment.
291299
- task: Cache@2
292300
displayName: 'Cache uv'
@@ -297,10 +305,7 @@ stages:
297305
"uv" | "$(Agent.OS)"
298306
path: $(Pipeline.Workspace)/.uv-cache
299307

300-
- script: 'python -m pip install uv'
301-
displayName: 'Install uv'
302-
303-
- script: 'uv sync --upgrade --python 3.10 --no-dev --group test --group e2e'
308+
- script: 'uv sync --locked --python 3.10 --no-dev --group test --group e2e'
304309
displayName: 'Sync E2E environment'
305310
env:
306311
UV_CACHE_DIR: $(Pipeline.Workspace)/.uv-cache

‎vsts/horton-e2e.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ trigger:
44
- main
55

66
pr:
7+
autoCancel: true
78
branches:
89
include:
9-
- main
10+
- '*'
1011

1112
variables:
1213
Horton.FrameworkRoot: $(Agent.BuildDirectory)/e2e-fx

‎vsts/python-canary.yaml‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ jobs:
5252
versionSpec: $(pv)
5353
architecture: 'x64'
5454

55+
- script: 'python -m pip install uv'
56+
displayName: 'Install uv'
57+
58+
# Resolve upgrades before Cache@2 hashes uv.lock so its save key stays stable.
59+
- script: 'uv lock --upgrade --python "$(pv)" --no-cache'
60+
displayName: 'Resolve latest dependencies'
61+
5562
# Cache downloads without reusing the job environment.
5663
- task: Cache@2
5764
displayName: 'Cache uv'
@@ -62,10 +69,7 @@ jobs:
6269
"uv" | "$(Agent.OS)"
6370
path: $(Pipeline.Workspace)/.uv-cache
6471

65-
- script: 'python -m pip install uv'
66-
displayName: 'Install uv'
67-
68-
- script: 'uv sync --upgrade --python "$(pv)" --no-dev --group test --group e2e'
72+
- script: 'uv sync --locked --python "$(pv)" --no-dev --group test --group e2e'
6973
displayName: 'Sync E2E environment'
7074
env:
7175
UV_CACHE_DIR: $(Pipeline.Workspace)/.uv-cache
@@ -84,4 +88,3 @@ jobs:
8488
- task: PublishTestResults@2
8589
displayName: 'Publish Test Results'
8690
condition: always()
87-

‎vsts/python-e2e.yaml‎

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ trigger:
44
- main
55

66
pr:
7+
autoCancel: true
78
branches:
89
include:
9-
- main
10+
- '*'
1011

1112
name: $(BuildID)_$(BuildDefinitionName)_$(SourceBranchName)
1213

@@ -114,6 +115,13 @@ stages:
114115
versionSpec: $(pv)
115116
architecture: 'x64'
116117

118+
- script: 'python -m pip install uv'
119+
displayName: 'Install uv'
120+
121+
# Resolve upgrades before Cache@2 hashes uv.lock so its save key stays stable.
122+
- script: 'uv lock --upgrade --python "$(pv)" --no-cache'
123+
displayName: 'Resolve latest dependencies'
124+
117125
# Cache downloads without reusing the job environment.
118126
- task: Cache@2
119127
displayName: 'Cache uv'
@@ -124,10 +132,7 @@ stages:
124132
"uv" | "$(Agent.OS)"
125133
path: $(Pipeline.Workspace)/.uv-cache
126134

127-
- script: 'python -m pip install uv'
128-
displayName: 'Install uv'
129-
130-
- script: 'uv sync --upgrade --python "$(pv)" --no-dev --group test --group e2e'
135+
- script: 'uv sync --locked --python "$(pv)" --no-dev --group test --group e2e'
131136
displayName: 'Sync E2E environment'
132137
env:
133138
UV_CACHE_DIR: $(Pipeline.Workspace)/.uv-cache
@@ -165,6 +170,13 @@ stages:
165170
versionSpec: $(pv)
166171
architecture: 'x64'
167172

173+
- script: 'python -m pip install uv'
174+
displayName: 'Install uv'
175+
176+
# Resolve upgrades before Cache@2 hashes uv.lock so its save key stays stable.
177+
- script: 'uv lock --upgrade --python "$(pv)" --no-cache'
178+
displayName: 'Resolve latest dependencies'
179+
168180
# Cache downloads without reusing the job environment.
169181
- task: Cache@2
170182
displayName: 'Cache uv'
@@ -175,10 +187,7 @@ stages:
175187
"uv" | "$(Agent.OS)"
176188
path: $(Pipeline.Workspace)/.uv-cache
177189

178-
- script: 'python -m pip install uv'
179-
displayName: 'Install uv'
180-
181-
- script: 'uv sync --upgrade --python "$(pv)" --no-dev --group test --group e2e'
190+
- script: 'uv sync --locked --python "$(pv)" --no-dev --group test --group e2e'
182191
displayName: 'Sync E2E environment'
183192
env:
184193
UV_CACHE_DIR: $(Pipeline.Workspace)/.uv-cache

‎vsts/python-nightly.yaml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ stages:
165165
versionSpec: $(pv)
166166
architecture: 'x64'
167167
addToPath: true
168+
169+
- script: 'python -m pip install uv'
170+
displayName: 'Install uv'
171+
172+
# Resolve upgrades before Cache@2 hashes uv.lock so its save key stays stable.
173+
- script: 'uv lock --upgrade --python "$(pv)" --no-cache'
174+
displayName: 'Resolve latest dependencies'
175+
168176
# Cache downloads without reusing the job environment.
169177
- task: Cache@2
170178
displayName: 'Cache uv'
@@ -174,10 +182,8 @@ stages:
174182
"uv" | "$(Agent.OS)" | "$(pv)"
175183
"uv" | "$(Agent.OS)"
176184
path: $(Pipeline.Workspace)/.uv-cache
177-
- script: 'python -m pip install uv'
178-
displayName: 'Install uv'
179185

180-
- script: 'uv sync --upgrade --python "$(pv)" --no-dev --group test --group e2e'
186+
- script: 'uv sync --locked --python "$(pv)" --no-dev --group test --group e2e'
181187
displayName: 'Sync E2E environment'
182188
env:
183189
UV_CACHE_DIR: $(Pipeline.Workspace)/.uv-cache

0 commit comments

Comments
 (0)