Skip to content

Bug/archived repo#991

Open
madkoo wants to merge 7 commits into
github:main-enterprisefrom
madkoo:bug/archived-repo
Open

Bug/archived repo#991
madkoo wants to merge 7 commits into
github:main-enterprisefrom
madkoo:bug/archived-repo

Conversation

@madkoo
Copy link
Copy Markdown
Contributor

@madkoo madkoo commented Jun 5, 2026

This pull request improves how archived repositories are handled during repository updates and enhances test coverage for these scenarios. It also updates the repository settings schema to support new security-related configuration options.

Repository update logic improvements:

  • The updateRepos method in lib/settings.js now checks if a repository is archived and, unless it is being unarchived, skips further updates for that repository. This prevents unnecessary plugin operations on archived repositories.

Testing enhancements:

  • Added comprehensive unit tests in test/unit/lib/plugins/archive.test.js for the Archive plugin's getState method, covering various combinations of the repository's archived status and desired state.
  • Introduced new tests in test/unit/lib/settings.test.js to verify that updateRepos correctly skips updates for archived repositories, and only proceeds if the repository is being unarchived or is not archived.

Copilot AI review requested due to automatic review settings June 5, 2026 13:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds logic to skip repository/child plugin updates for archived repos (unless they’re being unarchived), and expands unit test coverage around archive state detection and the new skip behavior.

Changes:

  • Add isArchived handling in Settings.updateRepos() to skip repo/child plugin sync when a repo is archived and not unarchiving.
  • Add unit tests for Archive.getState() and for Settings.updateRepos() behavior with archived/unarchived scenarios.
  • Update the settings JSON schema with additional security-related configuration blocks.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
test/unit/lib/settings.test.js Adds unit tests asserting updateRepos skips repo sync for archived repos unless unarchiving.
test/unit/lib/plugins/archive.test.js Adds unit tests for Archive.getState() output across archived/desired-state cases.
schema/dereferenced/settings.json Adds/updates schema entries related to code security and AI secret scanning detection.
lib/settings.js Introduces the archived-repo skip path based on Archive.getState() results.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +53 to 66
"code_security": {
"type": "object",
"description": "Use the `status` property to enable or disable GitHub Code Security for this repository.",
"description": "Use the `status` property to enable or disable GitHub Advanced Security for this repository.\nFor more information, see \"[About GitHub Advanced\nSecurity](/github/getting-started-with-github/learning-about-github/about-github-advanced-security).\"\n\nFor standalone Code Scanning or Secret Protection products, this parameter cannot be used.",
"properties": {
"status": {
"type": "string",
"description": "Can be `enabled` or `disabled`."
}
}
},
"code_security": {
"type": "object",
"description": "Use the `status` property to enable or disable GitHub Code Security for this repository.",
Comment on lines +58 to +61
"status": {
"type": "string",
"description": "Can be `enabled` or `disabled`."
}
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