mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-26 11:35:08 +02:00
fix: filter epic sync issues by label (#3089)
github-coordination sync listed every repo issue and pushed the epic label onto all of them (#3084). Scope the listing to issues carrying the policy's epic label plus issues whose body still holds the coordination marker (label-drift recovery), deduped by number, and reject an empty labels.epic in loadPolicy. Tests cover the filtered path and the recovery path with exact gh argv. Independent exact-head review passed with no P0/P1; CI 44/44 at the head.
This commit is contained in:
@@ -74,10 +74,14 @@ function loadPolicy(rootDir = process.cwd(), configPath = null) {
|
||||
const branchModel = typeof parsed.branchModel === 'object' && parsed.branchModel !== null && !Array.isArray(parsed.branchModel) ? parsed.branchModel : {};
|
||||
const project = typeof parsed.project === 'object' && parsed.project !== null && !Array.isArray(parsed.project) ? parsed.project : {};
|
||||
const fieldNames = typeof project.fieldNames === 'object' && project.fieldNames !== null && !Array.isArray(project.fieldNames) ? project.fieldNames : {};
|
||||
const mergedLabels = { ...DEFAULT_LABELS, ...labels };
|
||||
if (typeof mergedLabels.epic !== 'string' || !mergedLabels.epic.trim()) {
|
||||
throw new Error(`Policy file ${resolvedPath} must define labels.epic as a non-empty string`);
|
||||
}
|
||||
return {
|
||||
...DEFAULT_POLICY,
|
||||
...parsed,
|
||||
labels: { ...DEFAULT_LABELS, ...labels },
|
||||
labels: mergedLabels,
|
||||
review: { ...DEFAULT_POLICY.review, ...review },
|
||||
validation: { ...DEFAULT_POLICY.validation, ...validation },
|
||||
branchModel: { ...DEFAULT_POLICY.branchModel, ...branchModel },
|
||||
|
||||
Reference in New Issue
Block a user