Skip to content

Commit 455fa03

Browse files
authored
ci(catalog): blacklist invocations_ws sample paths
2 parents e9b3c42 + 0b104cf commit 455fa03

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/scripts/generate_sample_catalog.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ const TEMPLATE_SELECTION = {
7676
// Path segments must be alphanumeric, hyphens, underscores, or dots
7777
const SAFE_PATH_SEGMENT = /^[a-zA-Z0-9._-]+$/;
7878

79+
// Path segments that should never surface as catalog templates, even when
80+
// they contain a valid `agent.yaml`. Use this to drop upstream folders we
81+
// don't want in the picker yet (e.g. `invocations_ws` LiveKit samples).
82+
const BLOCKED_PATH_SEGMENTS = new Set(['invocations_ws']);
83+
7984
/**
8085
* Collected anomaly messages surfaced in CI step summary so reviewers do not
8186
* silently merge a catalog with missing/derived data. Always populated, even
@@ -199,7 +204,14 @@ function findTemplateDirsUnder(tree, prefix) {
199204
if (!rel) {
200205
return false;
201206
}
202-
return rel.split('/').every((seg) => isSafePathSegment(seg));
207+
const segments = rel.split('/');
208+
if (!segments.every((seg) => isSafePathSegment(seg))) {
209+
return false;
210+
}
211+
// Drop templates that live under a blocked segment (e.g.
212+
// `invocations_ws`) so upstream additions don't auto-leak into
213+
// the catalog before we explicitly opt them in.
214+
return !segments.some((seg) => BLOCKED_PATH_SEGMENTS.has(seg));
203215
})
204216
// Lexicographic sort serves two purposes: (1) a parent path always
205217
// sorts before its descendants, so the `startsWith` check below

0 commit comments

Comments
 (0)