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
ci(prcheck): use 'azldev component changed' for affected-component detection
Replace the bash 'git diff | grep /sources' step with structured azldev
commands for lock validation, change detection, and scoped rendering.
Pipeline step order:
1. Lock check -- 'azldev component update -a -q -O json', fail if any
component has changed == true. Lock-update JSON published as a
pipeline artifact for triage.
2. Changed-component detection -- 'azldev component changed
--include-unchanged' writes the full per-component JSON to disk,
published via ob_outputDirectory. The --include-unchanged flag
ensures the JSON contains every known component, which is needed
for the renderable-set filter in step 4.
3. Source/identity consistency tripwire -- hard-fail if any component
reports sourcesChange == true with a changeType not in the
allow-list {added, changed, deleted}. Prevents unauthenticated
rewrites of the rendered 'sources' file under an existing
component's identity. Data path is severed (subsequent steps
skip); PR check remains advisory until ADO task 19179 removes
job-level continueOnError.
4. Scoped render -- render set is the union of components flagged by
'azldev component changed' (inputs differ) and components whose
spec tree was touched directly in the PR (git diff under specs/,
mapped back to component names by compute_render_set.py). Deleted
and unknown components are excluded via a renderable-set filter
built from the full --include-unchanged JSON.
5. Prcheck API -- switches from --components <csv> to
--changed-components-file <path>, filtering to entries with
sourcesChange == true and changeType in {added, changed}
(allow-list, mirroring the consistency tripwire).
Also:
* Add --changed-components-file flag (mutually exclusive with
--components) and _load_components_from_file() to run_prcheck.py.
Uses an allow-list of changeType values for defense-in-depth.
* Add compute_render_set.py for render-set computation.
* Document AZLDEV_ALLOW_ROOT in ADO pipeline instructions (OneBranch
containers run as root, azldev refuses by default).
* Mark changedComponentsFile pipeline variable as isreadonly=true.
* Switch API_BASE_URL to $(ApiBaseDirectUrl) (bypasses AFD).
Copy file name to clipboardExpand all lines: .github/instructions/ado-pipeline.instructions.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -175,6 +175,17 @@ Avoid shell scripts beyond the smallest possible wiring (env exports, `##vso[...
175
175
176
176
Python scripts are easier to test locally, easier to review, and avoid the foot-guns of bash quoting / globbing.
177
177
178
+
### `azldev` in OneBranch
179
+
180
+
OneBranch run all steps as `root`. `azldev` refuses to run many commands as root by default (a safety measure for developer workstations). To allow it in CI, set the environment variable `AZLDEV_ALLOW_ROOT=1` if azldev returns the error `ERR Error: this command may not be run as root`. This is NOT safe for general use, only for use in disposable CI environments. Set it in the `env:` block of the step, not inline in the script body.
181
+
182
+
```yaml
183
+
env:
184
+
# OneBranch containers run as root. azldev refuses to run as root
185
+
# by default, disable the root security check for this step.
186
+
AZLDEV_ALLOW_ROOT: "1"
187
+
```
188
+
178
189
## Security hardening
179
190
180
191
Apply all of these unless there is a documented reason not to:
0 commit comments