Bug/archived repo#991
Open
madkoo wants to merge 7 commits into
Open
Conversation
…s in settings.json
…erty in settings.json
…to main-enterprise
…to main-enterprise
Contributor
There was a problem hiding this comment.
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
isArchivedhandling inSettings.updateRepos()to skip repo/child plugin sync when a repo is archived and not unarchiving. - Add unit tests for
Archive.getState()and forSettings.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`." | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
updateReposmethod inlib/settings.jsnow 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:
test/unit/lib/plugins/archive.test.jsfor theArchiveplugin'sgetStatemethod, covering various combinations of the repository's archived status and desired state.test/unit/lib/settings.test.jsto verify thatupdateReposcorrectly skips updates for archived repositories, and only proceeds if the repository is being unarchived or is not archived.