Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/repository-reconciliation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
const now = Date.now();
const staleAfterMs = 14 * 24 * 60 * 60 * 1000;
const closingPattern = /(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s+#(\d+)/gi;
const isDependencyAutomationPR = pr =>
pr.user?.login === "dependabot[bot]" &&
/^build\(deps(?:-[^)]+)?\):/i.test(pr.title || "");

const pulls = await github.paginate(github.rest.pulls.list, {
owner, repo, state: "open", per_page: 100
Expand Down Expand Up @@ -73,7 +76,10 @@ jobs:
// Restrict to validated issue references only.
const validUnique = [...new Set(issues)].filter(n => validIssues.has(n));
// Drafts mirror the governance workflow's deferred-enforcement rule and are excluded.
if (validUnique.length !== 1 && !pr.draft) untracked.push(pr);
// Dependabot dependency bumps are automation-managed and excluded from this drift gate.
if (validUnique.length !== 1 && !pr.draft && !isDependencyAutomationPR(pr)) {
untracked.push(pr);
}
for (const issue of validUnique) {
const existing = issueToPulls.get(issue) || [];
existing.push(pr.number);
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/test_repository_reconciliation_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,10 @@ def test_reconciliation_workflow_report_is_idempotent() -> None:
# Should update the existing issue if found, otherwise create a new one.
assert "issues.update" in script
assert "issues.create" in script


def test_reconciliation_workflow_excludes_dependabot_from_untracked() -> None:
"""Dependabot dependency PRs should not be counted as canonical-issue drift."""
script = _get_script(_load_workflow())
assert "dependabot[bot]" in script
assert "isDependencyAutomationPR" in script
Comment on lines +110 to +111
Loading