Skip to content

Skip archived repositories using installation listing metadata - #1099

Merged
decyjphr merged 6 commits into
yadhav/fix-recent-issuesfrom
decyjphr-archived-repository-audit
Sep 30, 2026
Merged

decyjphr merged 6 commits into
yadhav/fix-recent-issuesfrom
decyjphr-archived-repository-audit

Conversation

@decyjphr

Copy link
Copy Markdown
Collaborator

Archived repositories should not consume per-repository API calls or receive child-plugin writes unless configuration explicitly requests unarchiving. This selectively adapts #1065 to the current yadhav/fix-recent-issues implementation without importing unrelated source history.

Approach

  • Pass the installation listing's archived flag separately from the { owner, repo } reference, preventing observed state from leaking into PATCH payloads and accidentally rearchiving a repository.
  • Resolve organization, suborganization, repository overrides and plugin-disable settings before skipping. Restore the missing live-state fallback for unknown-state callers and protect child-plugin-only configurations.
  • Preserve bounded batching, error aggregation, exclusions, and archive/unarchive ordering. Add real Octokit request-level regressions, a focused smoke phase, and updated documentation.
  • Incorporate the latest base's native Probot integration suite and adapt its fixtures to the archive-state lookup, with an archived collaborator regression.

Source audit

Both source commits require adaptation rather than a source-branch merge; source-only ancestry contains no additional merges or unrelated commits.

Source commit Decision Adapted commit
e8d49dc90a9b70a9ed148f68a55214979131c4c0 ADAPT 7a064fd
3d5c064f253f30d3b40cfbff5dabbaeb041317eb ADAPT 7a064fd

Base 3652444 was merged in 302ef36 after the initial adaptation on 55b52df.

Validation

On Node 22.12.0:

  • 915 unit tests pass; 12 remain skipped.
  • 26 archived-repository transport tests pass, including the maintained smoke phase's complete offline lifecycle. Before the production fix, 16 of the original 25 regression cases failed.
  • The merged native integration suite passes all 11 tests, including CI JUnit reporting.
  • Existing pagination transport coverage passed all 28 tests on the initial adaptation. No new lint diagnostics; merge-resolution files and whitespace checks pass.

Authorized live smoke on 7a064fd ran only setup -> phase 25 -> teardown: 32 assertions passed, zero failures, no fatal error. It verified actual listing-to-processing metadata propagation, zero fixture requests for archived skips, unknown-state fallbacks, unarchive NOP/apply, safe PATCH payloads, and convergence. Independent before/after snapshots confirmed original files, policies, properties, and foreign refs were unchanged; owned fixtures and processes were removed, the port was freed, and the private environment copy was restored.

The live smoke used controlled single-test-organization enumeration and fixture-only in-memory configuration. It does not establish webhook delivery, multi-organization behavior, or combined integration with #1070. The subsequent base merge was validated locally, not with another live smoke run.

decyjphr and others added 4 commits September 30, 2026 09:16
Adapt PR #1065 commits e8d49dc and 3d5c064 to the current target's bounded batching and plugin-disable pipeline. Restore the coupled unknown-state archive guard, keep observed metadata out of repository PATCH payloads, and cover labels-only paths, precedence, and unarchive/NOP ordering with real Octokit transport tests. Add isolated maintained smoke phase 25.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Integrate base commit 3652444. Preserve archived repository behavior and update the native integration fixtures for the archive-state read, including archived child-plugin coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merge yadhav/fix-recent-issues at 68adce9. Resolve smoke-test and README conflicts by preserving both archived-repository phase 25 and team-slug phase 26.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move archived repository, variable pagination, and team transport tests under test/integration/transport using the existing .test.js discovery convention. Update relative imports, keep focused npm commands, and document automatic integration CI coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unknown-state syncs can still write to archived repositories when the archive plugin is disabled, and schema documentation remains inconsistent.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Optimizes archived-repository synchronization by using installation-list metadata while preserving explicit unarchive behavior and fallback checks.

Changes:

  • Threads archive metadata through repository processing.
  • Adds regression, integration, and smoke coverage.
  • Documents archive handling and focused test commands.
File Description
lib/​settings.js Adds metadata-aware archive guards and fallbacks.
package.json Adds archived transport test command.
README.md Documents transport tests and smoke phase.
smoke-test.js Adds archived-repository lifecycle phase.
docs/​github-settings/​1. repository-settings.md Documents archive-state behavior.
test/​unit/​lib/​settings.test.js Updates method-call expectations.
test/​unit/​lib/​settings-batching.test.js Tests metadata propagation and batching.
test/​integration/​transport/​archived-repositories.test.js Adds request-level archive regressions.
test/​integration/​transport/​variables.test.js Updates imports after relocation.
test/​integration/​transport/​teams.test.js Updates imports after relocation.
test/​integration/​triggers/​repository-created.test.js Mocks archive-state lookup.
test/​integration/​triggers/​repository-edited.test.js Mocks archive-state lookup.
test/​integration/​plugins/​teams.test.js Supports archive-state lookup.
test/​integration/​plugins/​collaborators.test.js Tests archived collaborator skipping.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/settings.js
Comment thread docs/github-settings/1. repository-settings.md Outdated
decyjphr and others added 2 commits September 30, 2026 10:37
Preserve the archived-repository safety guard for callers without listing metadata while leaving archive reconciliation disabled. Cover direct and listing callers, child-only configs, explicit unarchive, and NOP behavior, and correct the previously filtered-out unit regression.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@decyjphr
decyjphr merged commit 337604d into yadhav/fix-recent-issues Sep 30, 2026
2 checks passed
@decyjphr
decyjphr deleted the decyjphr-archived-repository-audit branch September 30, 2026 14:53
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.

2 participants