Skip to content

Fix team slug identity in dry-run comparisons - #1098

Merged
decyjphr merged 4 commits into
yadhav/fix-recent-issuesfrom
decyjphr-team-slug-comparison-audit
Sep 30, 2026
Merged

decyjphr merged 4 commits into
yadhav/fix-recent-issuesfrom
decyjphr-team-slug-comparison-audit

Conversation

@decyjphr

Copy link
Copy Markdown
Collaborator

Why

Teams whose GitHub display names differ from their configured slugs produce phantom additions and deletions in dry-run summaries, even though the sync comparator already recognizes them as the same team. This also incorrectly sets hasChanges and can trigger unnecessary suborg re-evaluation.

Approach

  • Selectively adapt Fix: Patch comparison for Teams plugin to match on slug instead of name on NOP #1070, source commit 79cbca7bb51e527426686442f246cc2f149a499c. Normalize retained API records' comparison names to their slugs after security-manager filtering, without mutating responses or changing records that lack a usable slug.
  • Preserve existing permission application, security-manager protections, and configuration behavior. Regression tests require quiet unchanged NOP/apply results and exactly one permission modification, with no phantom additions, deletions, or NOP writes.
  • Add real-Octokit transport coverage for pagination, endpoint/body shapes, and discovery failures, plus isolated smoke phase 26. Its assertions preserve inherited security-manager identities and permissions while exercising the owned team's full permission lifecycle.

The requested reverse merge of yadhav/fix-recent-issues at 3652444 was conflict-free and brings in the native Node.js integration runner. It does not change production code or runtime dependencies. Source adaptation (8bc6fc3), base merge (3247183), and smoke-fixture correction (eb63646) are separate commits.

Validation

Node.js v22.12.0:

  • Full unit suite: 938 passed, 12 skipped.
  • Native Probot integration suite: 10 passed.
  • Real-Octokit Teams transport tests: 7 passed.
  • Offline startup/containment checks: 6 passed.
  • Guarded live smoke, setup 0 -> phase 26 -> teardown 9: 19 passed, 0 failed, with actual Probot readiness/ping and exit 0.
  • Touched-file ESLint introduces no new diagnostics; 9 pre-existing smoke-harness diagnostics remain. git diff --check passes.

The first live attempt stopped at an invalid assumption that the raw repository team list contained only the owned team (1 pass, 1 failure). A realistic inherited-team regression reproduced that assertion failure before the smoke-only correction. The successful retry retains exact NOP/MODIFY/write-count assertions and verifies the entire inherited team baseline remains unchanged.

Independent before/after checks confirmed original resources were preserved, owned fixtures and processes were removed, and the private environment was restored exactly. Live coverage is intentionally limited to one explicitly verified test organization; it does not claim multi-organization coverage.

decyjphr and others added 4 commits September 30, 2026 09:17
Adapt PR #1070 source commit 79cbca7 to preserve missing-slug records and current array-shaped diff results. Add exact unit/Octokit transport regressions and isolated phase 26 smoke coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reverse merge requested BASE 3652444. No conflicts. Imports the native Node.js integration runner without changing production code, smoke harness, or runtime dependencies.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reproduce organization security-manager inheritance with the real Teams plugin. Snapshot unmanaged team identities and permissions before assignment and require them unchanged throughout NOP/apply checks instead of assuming the raw repository list has exactly one team. Production behavior is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move the existing regression fixtures and assertions under the Teams suite without changing coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@decyjphr
decyjphr merged commit 68adce9 into yadhav/fix-recent-issues Sep 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant