Skip to content

Commit 7070f51

Browse files
committed
fix(review): ignore workflow files in data-model detection
1 parent 7f9e3f9 commit 7070f51

3 files changed

Lines changed: 46 additions & 4 deletions

File tree

‎src/clawsweeper-change-detection.ts‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ export function dataModelChangeFromContext(repo: string, context: ItemContext):
8484
const path = typeof file.filename === "string" ? file.filename.trim() : "";
8585
const previousPath =
8686
typeof file.previous_filename === "string" ? file.previous_filename.trim() : "";
87-
// Scope each rename side before unknown handling, retaining the semantic docs branch.
88-
const candidates = [path, previousPath].filter(
89-
(candidate) => isProductionSourcePath(candidate) || isDocsPath(candidate),
90-
);
87+
// Scope each rename side before unknown handling, retaining semantic docs
88+
// while excluding CI definitions that cannot define an OpenClaw data model.
89+
const candidates = [path, previousPath].filter(isDataModelCandidatePath);
9190
const likelyPath = candidates.find(isLikelyOpenClawDataModelPath) ?? "";
9291
const patch = typeof file.patch === "string" ? file.patch : null;
9392
const lines = patch === null ? [] : changedPatchLines(patch);
@@ -213,6 +212,12 @@ function isProductionSourcePath(path: string): boolean {
213212
});
214213
}
215214

215+
function isDataModelCandidatePath(path: string): boolean {
216+
return (
217+
!/^\.github\/workflows\//i.test(path) && (isProductionSourcePath(path) || isDocsPath(path))
218+
);
219+
}
220+
216221
function isLikelySqliteSchemaPath(path: string): boolean {
217222
return /(?:^|\/)(?:migrations?|sqlite)(?:\/|[-_.])|(?:sqlite|memory|database|db)[-_.]?schema|schema[-_.]?sqlite|sqlite[-_.]?store|\.sql$/i.test(
218223
path,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"pullRequest": "https://github.com/openclaw/openclaw/pull/119762",
3+
"headSha": "0d5398a9233014776b06d26252162cf5664535ca",
4+
"source": "GitHub pull-files API carrier hunk fetched 2026-08-27",
5+
"pullFiles": [
6+
{
7+
"filename": ".github/workflows/openclaw-live-and-e2e-checks-reusable.yml",
8+
"patch": "@@\n+ metadata=\".artifacts/docker-e2e-package/package-candidate.json\"\n+ if [[ ! -f \"$metadata\" ]]; then\n+ jq -n \\\n+ --arg name \"$name\" \\\n+ '{ name: $name }' > \"$metadata\"\n+ fi\n+ [[ -s \"$metadata\" ]] || {\n+ echo \"Docker E2E package metadata was not created.\" >&2\n+ exit 1\n+ }"
9+
}
10+
]
11+
}

‎test/pr-surface-policy.test.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,15 @@ Corrects missing-tool installation guidance and adds a subprocess regression.
273273
assert.doesNotMatch(comment, /Persistent data-model change detected|### Stored data model/);
274274
});
275275

276+
test("real #119762 workflow metadata carrier does not produce a stored-data warning", () => {
277+
const fixture = JSON.parse(
278+
readFileSync(new URL("./fixtures/persistence-classifier-119762.json", import.meta.url), "utf8"),
279+
);
280+
const detection = dataModelChangeFromPullFilesForTest({ pullFiles: fixture.pullFiles });
281+
282+
assert.deepEqual(detection, { change: false, surfaces: [] });
283+
});
284+
276285
test("bundled hook prose does not become a persistence warning or migration gate", () => {
277286
const fixture = JSON.parse(
278287
readFileSync(new URL("./fixtures/persistence-classifier-130734.json", import.meta.url), "utf8"),
@@ -390,6 +399,23 @@ for (const { name, file, surfaces, pullFilesTruncated } of [
390399
pullFilesTruncated: true,
391400
surfaces: ["unknown-truncated-pull-files"],
392401
},
402+
{
403+
name: "workflow-only persistence vocabulary",
404+
file: {
405+
filename: ".github/workflows/release.yml",
406+
patch:
407+
'@@\n+metadata=".artifacts/candidate.json"\n+await upgrade(state)\n+await writeFile(statePath, JSON.stringify(value));',
408+
},
409+
surfaces: [],
410+
},
411+
{
412+
name: "workflow to production rename with a missing patch",
413+
file: {
414+
filename: "src/storage/session-state.ts",
415+
previous_filename: ".github/workflows/session-state.yml",
416+
},
417+
surfaces: ["unknown-data-model-change: src/storage/session-state.ts"],
418+
},
393419
]) {
394420
test(`data model detector scopes ${name}`, () => {
395421
const detection = dataModelChangeFromPullFilesForTest({

0 commit comments

Comments
 (0)