Skip to content

Commit 61acdbf

Browse files
Sync eng/common directory with azure-sdk-tools for PR 16402 (#48176)
* Rename azsdk-evals directory to evals * Flatten eval suite directory layout --------- Co-authored-by: helen229 <gaoh@microsoft.com>
1 parent 4168450 commit 61acdbf

9 files changed

Lines changed: 55 additions & 55 deletions

File tree

eng/common/pipelines/live-eval.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ extends:
2525
# Shared mock/live builder; select the live tier (real Cli MCP).
2626
mcpSetupTemplate: /eng/common/pipelines/templates/steps/eval-mcp-setup.yml
2727
TestType: live
28-
vallyRoot: azsdk-evals
28+
vallyRoot: evals
2929
evalGlobs:
30-
- 'evals/workflow-scenarios/live/*.eval.yaml'
30+
- 'workflows/live/*.eval.yaml'
3131
# Run each shard under AzureCLI@2 so the real MCP's DevOps calls are authenticated.
3232
UseAzSdkAuthentication: true
3333
failOnFailedTests: true

eng/common/pipelines/templates/stages/archetype-eval.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ parameters:
1515
# collect-stimuli.js mirrors this list as its no-args fallback — keep them in sync.
1616
type: object
1717
default:
18-
- 'evals/tools/*.eval.yaml'
19-
- 'evals/workflow-scenarios/mock/*.eval.yaml'
18+
- 'tools/*.eval.yaml'
19+
- 'workflows/mock/*.eval.yaml'
2020
- name: mcpSetupTemplate
2121
# SWAP POINT: builds/installs the MCP server(s) under artifacts/mcp/<name>. Required (no default):
2222
# each repo passes its own build template. This repo uses the shared mock/live builder

eng/common/pipelines/workflow-eval.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Hermetic workflow-scenario eval CI: runs the unit-tool + mock workflow-scenario evals in
2-
# azsdk-evals against the mock MCP (live tier runs in live-eval.yml).
2+
# evals against the mock MCP (live tier runs in live-eval.yml).
33

44
trigger:
55
branches:
66
include:
77
- main
88
paths:
99
include:
10-
- azsdk-evals/**
10+
- evals/**
1111
- tools/azsdk-cli/Azure.Sdk.Tools.Mock/**
1212
# Cli tool catalog + skills feed the eval results, so changes here must retrigger.
1313
- tools/azsdk-cli/Azure.Sdk.Tools.Cli/**
@@ -25,7 +25,7 @@ pr:
2525
- main
2626
paths:
2727
include:
28-
- azsdk-evals/**
28+
- evals/**
2929
- tools/azsdk-cli/Azure.Sdk.Tools.Mock/**
3030
- tools/azsdk-cli/Azure.Sdk.Tools.Cli/**
3131
- .github/skills/**
@@ -48,7 +48,7 @@ extends:
4848
# Shared mock/live builder; select the mock tier.
4949
mcpSetupTemplate: /eng/common/pipelines/templates/steps/eval-mcp-setup.yml
5050
TestType: mock
51-
vallyRoot: azsdk-evals
51+
vallyRoot: evals
5252
# Per-shard job timeout (report-only tier).
5353
shardTimeoutInMinutes: 20
5454
# Pass-rate gate for `vally eval`. This tier is report-only (failOnFailedTests defaults false),

eng/common/scripts/allow-relative-links.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
AGENTS.md
1010
# Allow relative links for all files under the eng folder (e.g. engineering system scripts and templates).
1111
eng/**
12-
# Allow relative links for the top-level eval suite (azsdk-evals is a cross-cutting asset at repo root).
13-
azsdk-evals/**
12+
# Allow relative links for the top-level eval suite (evals is a cross-cutting asset at repo root).
13+
evals/**

eng/common/scripts/eval/collect-stimuli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { globFiles } from "./lib/glob.ts";
1010

1111
// Fallback patterns when run with no --pattern. Mirrors archetype-eval.yml's evalGlobs default.
1212
const DEFAULT_PATTERNS = [
13-
"evals/tools/*.eval.yaml",
14-
"evals/workflow-scenarios/mock/*.eval.yaml",
13+
"tools/*.eval.yaml",
14+
"workflows/mock/*.eval.yaml",
1515
];
1616

1717
const SANITIZE = /[^A-Za-z0-9]/g;

eng/common/scripts/eval/init-eval-git-fixtures.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { globFiles } from "./lib/glob.ts";
99
import { syncRepo } from "./sync-eval-git-repo.ts";
1010

1111
export const DEFAULT_PATTERNS = [
12-
"evals/tools/*.eval.yaml",
13-
"evals/workflow-scenarios/mock/*.eval.yaml",
12+
"tools/*.eval.yaml",
13+
"workflows/mock/*.eval.yaml",
1414
];
1515

1616
// Repos we know how to clone efficiently (cone-sparse to the spec folders the fixtures touch).

eng/common/scripts/eval/lib/glob.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function walk(dir, segments, out) {
6262
* glob `pattern`. Results are sorted for deterministic ordering.
6363
*
6464
* @param {string} root Absolute or relative base directory to glob from.
65-
* @param {string} pattern Forward-slashed glob relative to `root` (e.g. "evals/tools/*.eval.yaml").
65+
* @param {string} pattern Forward-slashed glob relative to `root` (e.g. "tools/*.eval.yaml").
6666
* @returns {string[]} Sorted absolute file paths.
6767
*/
6868
export function globFiles(root, pattern) {

eng/common/scripts/eval/test/collect-stimuli.test.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ describe("collect-stimuli (default discovery)", () => {
3131
before(() => {
3232
root = fs.mkdtempSync(path.join(os.tmpdir(), "vally-matrix-"));
3333
writeFile(
34-
path.join(root, "evals/tools/prompt-to-tool-github.eval.yaml"),
34+
path.join(root, "tools/prompt-to-tool-github.eval.yaml"),
3535
"tags:\n area: github"
3636
);
3737
writeFile(
38-
path.join(root, "evals/tools/add-arm-resource.eval.yaml"),
38+
path.join(root, "tools/add-arm-resource.eval.yaml"),
3939
"tags:\n area: typespec"
4040
);
4141
writeFile(
42-
path.join(root, "evals/workflow-scenarios/mock/rename-client-property.eval.yaml"),
42+
path.join(root, "workflows/mock/rename-client-property.eval.yaml"),
4343
"tags:\n area: typespec"
4444
);
4545
writeFile(
46-
path.join(root, "evals/workflow-scenarios/live/release-planner.eval.yaml"),
46+
path.join(root, "workflows/live/release-planner.eval.yaml"),
4747
"tags:\n area: release-plan"
4848
);
4949
});
@@ -70,7 +70,7 @@ describe("collect-stimuli (default discovery)", () => {
7070
const matrix = buildMatrix({ roots: [root] });
7171
for (const entry of Object.values(matrix)) {
7272
assert.doesNotMatch(entry.evalArgs, /\\/);
73-
assert.match(entry.evalArgs, /^-e evals\//);
73+
assert.match(entry.evalArgs, /^-e (tools|workflows)\//);
7474
}
7575
});
7676

@@ -94,15 +94,15 @@ describe("collect-stimuli (area grouping)", () => {
9494
before(() => {
9595
root = fs.mkdtempSync(path.join(os.tmpdir(), "vally-matrix-area-"));
9696
writeFile(
97-
path.join(root, "evals/tools/prompt-to-tool-github.eval.yaml"),
97+
path.join(root, "tools/prompt-to-tool-github.eval.yaml"),
9898
"tags:\n area: github"
9999
);
100100
writeFile(
101-
path.join(root, "evals/tools/add-arm-resource.eval.yaml"),
101+
path.join(root, "tools/add-arm-resource.eval.yaml"),
102102
"tags:\n area: typespec"
103103
);
104104
writeFile(
105-
path.join(root, "evals/workflow-scenarios/mock/rename-client-property.eval.yaml"),
105+
path.join(root, "workflows/mock/rename-client-property.eval.yaml"),
106106
"tags:\n area: typespec"
107107
);
108108
});
@@ -127,11 +127,11 @@ describe("collect-stimuli (area grouping)", () => {
127127
const collideRoot = fs.mkdtempSync(path.join(os.tmpdir(), "vally-matrix-area-collide-"));
128128
try {
129129
writeFile(
130-
path.join(collideRoot, "evals/tools/a.eval.yaml"),
130+
path.join(collideRoot, "tools/a.eval.yaml"),
131131
"tags:\n area: release-plan"
132132
);
133133
writeFile(
134-
path.join(collideRoot, "evals/tools/b.eval.yaml"),
134+
path.join(collideRoot, "tools/b.eval.yaml"),
135135
"tags:\n area: release_plan"
136136
);
137137
assert.throws(
@@ -149,8 +149,8 @@ describe("collect-stimuli (area with an untagged eval)", () => {
149149

150150
before(() => {
151151
root = fs.mkdtempSync(path.join(os.tmpdir(), "vally-matrix-ut-"));
152-
writeFile(path.join(root, "evals/tools/tagged.eval.yaml"), "tags:\n area: github");
153-
writeFile(path.join(root, "evals/tools/untagged.eval.yaml"), "no tags here");
152+
writeFile(path.join(root, "tools/tagged.eval.yaml"), "tags:\n area: github");
153+
writeFile(path.join(root, "tools/untagged.eval.yaml"), "no tags here");
154154
});
155155

156156
after(() => fs.rmSync(root, { recursive: true, force: true }));
@@ -159,7 +159,7 @@ describe("collect-stimuli (area with an untagged eval)", () => {
159159
const { result: matrix } = withWarnings((warn) =>
160160
buildMatrix({
161161
roots: [root],
162-
patterns: ["evals/tools/*.eval.yaml"],
162+
patterns: ["tools/*.eval.yaml"],
163163
warn,
164164
})
165165
);
@@ -172,7 +172,7 @@ describe("collect-stimuli (area with an untagged eval)", () => {
172172
const { result: matrix } = withWarnings((warn) =>
173173
buildMatrix({
174174
roots: [root],
175-
patterns: ["evals/tools/*.eval.yaml"],
175+
patterns: ["tools/*.eval.yaml"],
176176
warn,
177177
})
178178
);
@@ -183,7 +183,7 @@ describe("collect-stimuli (area with an untagged eval)", () => {
183183
const { warnings } = withWarnings((warn) =>
184184
buildMatrix({
185185
roots: [root],
186-
patterns: ["evals/tools/*.eval.yaml"],
186+
patterns: ["tools/*.eval.yaml"],
187187
warn,
188188
})
189189
);
@@ -197,11 +197,11 @@ describe("collect-stimuli (overlapping patterns)", () => {
197197
before(() => {
198198
root = fs.mkdtempSync(path.join(os.tmpdir(), "vally-matrix-overlap-"));
199199
writeFile(
200-
path.join(root, "evals/tools/add-arm-resource.eval.yaml"),
200+
path.join(root, "tools/add-arm-resource.eval.yaml"),
201201
"tags:\n area: typespec"
202202
);
203203
writeFile(
204-
path.join(root, "evals/tools/prompt-to-tool-github.eval.yaml"),
204+
path.join(root, "tools/prompt-to-tool-github.eval.yaml"),
205205
"tags:\n area: github"
206206
);
207207
});
@@ -211,7 +211,7 @@ describe("collect-stimuli (overlapping patterns)", () => {
211211
it("does not emit a duplicate -e flag for a file matched by multiple patterns", () => {
212212
const matrix = buildMatrix({
213213
roots: [root],
214-
patterns: ["evals/tools/*.eval.yaml", "evals/tools/add-arm-resource.eval.yaml"],
214+
patterns: ["tools/*.eval.yaml", "tools/add-arm-resource.eval.yaml"],
215215
});
216216
const count = (matrix.area_typespec.evalArgs.match(/add-arm-resource/g) || []).length;
217217
assert.equal(count, 1);
@@ -226,11 +226,11 @@ describe("collect-stimuli (multiple eval roots: repo + common)", () => {
226226
repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "vally-matrix-repo-"));
227227
commonRoot = fs.mkdtempSync(path.join(os.tmpdir(), "vally-matrix-common-"));
228228
writeFile(
229-
path.join(repoRoot, "evals/tools/repo-specific.eval.yaml"),
229+
path.join(repoRoot, "tools/repo-specific.eval.yaml"),
230230
"tags:\n area: repo"
231231
);
232232
writeFile(
233-
path.join(commonRoot, "evals/tools/shared-scenario.eval.yaml"),
233+
path.join(commonRoot, "tools/shared-scenario.eval.yaml"),
234234
"tags:\n area: shared"
235235
);
236236
});
@@ -243,7 +243,7 @@ describe("collect-stimuli (multiple eval roots: repo + common)", () => {
243243
it("collects evals from both roots into one matrix", () => {
244244
const matrix = buildMatrix({
245245
roots: [repoRoot, commonRoot],
246-
patterns: ["evals/tools/*.eval.yaml"],
246+
patterns: ["tools/*.eval.yaml"],
247247
});
248248
const keys = Object.keys(matrix);
249249
assert.equal(keys.length, 2);
@@ -254,11 +254,11 @@ describe("collect-stimuli (multiple eval roots: repo + common)", () => {
254254
it("computes each file's relative path against its own root", () => {
255255
const matrix = buildMatrix({
256256
roots: [repoRoot, commonRoot],
257-
patterns: ["evals/tools/*.eval.yaml"],
257+
patterns: ["tools/*.eval.yaml"],
258258
});
259259
assert.equal(
260260
matrix.area_shared.evalArgs,
261-
"-e evals/tools/shared-scenario.eval.yaml"
261+
"-e tools/shared-scenario.eval.yaml"
262262
);
263263
});
264264
});
@@ -275,11 +275,11 @@ describe("collect-stimuli (pathBase anchors scattered roots to one run root)", (
275275
runRoot = path.join(parent, "project");
276276
scatteredRoot = path.join(parent, "extra");
277277
writeFile(
278-
path.join(runRoot, "evals/tools/in-project.eval.yaml"),
278+
path.join(runRoot, "tools/in-project.eval.yaml"),
279279
"tags:\n area: inproject"
280280
);
281281
writeFile(
282-
path.join(scatteredRoot, "evals/out-of-tree.eval.yaml"),
282+
path.join(scatteredRoot, "workflows/out-of-tree.eval.yaml"),
283283
"tags:\n area: scattered"
284284
);
285285
});
@@ -290,28 +290,28 @@ describe("collect-stimuli (pathBase anchors scattered roots to one run root)", (
290290
const matrix = buildMatrix({
291291
roots: [runRoot, scatteredRoot],
292292
pathBase: runRoot,
293-
patterns: ["evals/**/*.eval.yaml", "evals/*.eval.yaml"],
293+
patterns: ["tools/**/*.eval.yaml", "workflows/*.eval.yaml"],
294294
});
295295
// The in-project file stays a simple relative path; the scattered one walks up.
296296
assert.equal(
297297
matrix.area_inproject.evalArgs,
298-
"-e evals/tools/in-project.eval.yaml"
298+
"-e tools/in-project.eval.yaml"
299299
);
300300
assert.equal(
301301
matrix.area_scattered.evalArgs,
302-
"-e ../extra/evals/out-of-tree.eval.yaml"
302+
"-e ../extra/workflows/out-of-tree.eval.yaml"
303303
);
304304
});
305305

306306
it("falls back to per-root relative paths when no pathBase is given", () => {
307307
const matrix = buildMatrix({
308308
roots: [scatteredRoot],
309-
patterns: ["evals/*.eval.yaml"],
309+
patterns: ["workflows/*.eval.yaml"],
310310
});
311311
// Without a base, the path is relative to the root it was found under (no `../`).
312312
assert.equal(
313313
matrix.area_scattered.evalArgs,
314-
"-e evals/out-of-tree.eval.yaml"
314+
"-e workflows/out-of-tree.eval.yaml"
315315
);
316316
});
317317
});

eng/common/scripts/eval/test/init-eval-git-fixtures.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ describe("getEvalGitFixtures discovery", () => {
1717
before(() => {
1818
// Throwaway eval tree so the tests do not depend on real eval content.
1919
root = fs.mkdtempSync(path.join(os.tmpdir(), "vally-fixtures-test-"));
20-
fs.mkdirSync(path.join(root, "evals/tools"), { recursive: true });
21-
fs.mkdirSync(path.join(root, "evals/workflow-scenarios/mock"), { recursive: true });
20+
fs.mkdirSync(path.join(root, "tools"), { recursive: true });
21+
fs.mkdirSync(path.join(root, "workflows/mock"), { recursive: true });
2222

2323
// A unit eval with NO git fixture.
2424
fs.writeFileSync(
25-
path.join(root, "evals/tools/prompt-to-tool-github.eval.yaml"),
25+
path.join(root, "tools/prompt-to-tool-github.eval.yaml"),
2626
"tags:\n area: github\nstimuli:\n - name: x\n"
2727
);
2828

@@ -45,7 +45,7 @@ describe("getEvalGitFixtures discovery", () => {
4545
"",
4646
].join("\n");
4747
fs.writeFileSync(
48-
path.join(root, "evals/workflow-scenarios/mock/release-planner-workflows.eval.yaml"),
48+
path.join(root, "workflows/mock/release-planner-workflows.eval.yaml"),
4949
mock
5050
);
5151
});
@@ -76,7 +76,7 @@ describe("getEvalGitFixtures discovery", () => {
7676
});
7777

7878
it("is a no-op when the scanned suite declares no git fixtures", () => {
79-
const fixtures = getEvalGitFixtures({ root, patterns: ["evals/tools/*.eval.yaml"] });
79+
const fixtures = getEvalGitFixtures({ root, patterns: ["tools/*.eval.yaml"] });
8080
assert.equal(fixtures.length, 0);
8181
});
8282

@@ -90,7 +90,7 @@ describe("getEvalGitFixtures discovery", () => {
9090
" source: ../../../../../../artifacts/specs-cache/some-other-repo",
9191
"",
9292
].join("\n");
93-
const file = path.join(root, "evals/workflow-scenarios/mock/no-ref.eval.yaml");
93+
const file = path.join(root, "workflows/mock/no-ref.eval.yaml");
9494
fs.writeFileSync(file, noRef);
9595
try {
9696
const fixtures = dedupeFixtures(getEvalGitFixtures({ root }));
@@ -111,9 +111,9 @@ describe("getEvalGitFixtures discovery", () => {
111111
// contain the Vally suite they skip.
112112
describe("Folder-level invariant for real git fixtures", () => {
113113
const repoRoot = path.resolve(here, "../../../../..");
114-
const vallyRoot = path.join(repoRoot, "azsdk-evals");
115-
const vallyEvals = path.join(vallyRoot, "evals");
116-
const present = fs.existsSync(vallyEvals);
114+
const vallyRoot = path.join(repoRoot, "evals");
115+
const evalRoots = [path.join(vallyRoot, "tools"), path.join(vallyRoot, "workflows")];
116+
const present = evalRoots.some((root) => fs.existsSync(root));
117117

118118
const expectedCacheRoot = path
119119
.join(repoRoot, "artifacts", "specs-cache")
@@ -122,7 +122,7 @@ describe("Folder-level invariant for real git fixtures", () => {
122122
function collectRealFixtures() {
123123
const srcRegex = /^\s*source:\s*(\.\.\S+)/gm;
124124
const results = [];
125-
const stack = [vallyEvals];
125+
const stack = evalRoots.filter((root) => fs.existsSync(root));
126126
while (stack.length > 0) {
127127
const dir = stack.pop();
128128
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {

0 commit comments

Comments
 (0)