mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-01 14:05:13 +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:
@@ -84,7 +84,24 @@ function applySync(repo, options = {}, context = {}) {
|
||||
assertValidRepo(repo);
|
||||
const policy = context.policy || loadPolicy(context.rootDir || process.cwd(), options.configPath);
|
||||
const store = context.store || null;
|
||||
const issues = listIssues(repo, { ...options, state: options.state || 'all', limit: options.limit || 100 });
|
||||
const labelIssues = listIssues(repo, {
|
||||
...options,
|
||||
state: options.state || 'all',
|
||||
limit: options.limit || 100,
|
||||
label: policy.labels && policy.labels.epic,
|
||||
});
|
||||
const marker = policy.sectionMarker || 'ecc-coordination';
|
||||
const coordinatedIssues = listIssues(repo, {
|
||||
...options,
|
||||
state: options.state || 'all',
|
||||
limit: options.limit || 100,
|
||||
search: `in:body "${marker}:start"`,
|
||||
});
|
||||
const issues = Array.from(
|
||||
new Map(
|
||||
[...labelIssues, ...coordinatedIssues].map(issue => [String(issue.number), issue])
|
||||
).values()
|
||||
);
|
||||
const syncedAt = new Date().toISOString();
|
||||
const results = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user