Repository navigation
Preserve selectively excluded custom property values - #1092
Merged
decyjphr merged 3 commits intoSep 29, 2026
Merged
Conversation
Adapt PR #1036 (47c5a41) onto yadhav/fix-recent-issues without importing its base or regressing target API routes.\n\nAdd fail-closed ownership configuration, layered merging, consistent exclusion NOP output, generated schemas, regression coverage and scoped smoke phase 20. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve the smoke-test catalog conflict by retaining the target's bypass actor convergence phase 19 and custom property exclusions phase 20 unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The schemas reject documented null resets, array values can cause redundant writes, and smoke cleanup can fail for automatically deleted branches.
Review effort: Balanced
Findings: 5
Open (5)
Compare array property values by content before PATCHing · New Allow null custom_properties resets for repository configurations · New Allow null custom_properties resets for org configurations · New Allow null custom_properties resets for suborg configurations · New Use idempotent branch deletion for merged PR heads · New
What changed in this PR
Adds selective ownership of repository custom properties while preserving legacy behavior and fail-closed handling.
Changes:
- Adds
include/excludeconfiguration and layered merging. - Updates schemas and documentation.
- Adds unit and smoke-test coverage.
| File | Description |
|---|---|
lib/plugins/custom_properties.js |
Implements selective property ownership. |
lib/settings.js |
Merges layered custom-property configuration. |
README.md |
Documents ownership semantics. |
docs/sample-settings/settings.yml |
Adds configuration example. |
smoke-test.js |
Adds phase 20 integration coverage. |
schema/settings.json |
Extends organization schema. |
schema/repos.json |
Extends repository schema. |
schema/suborgs.json |
Extends suborganization schema. |
schema/dereferenced/settings.json |
Regenerates organization schema. |
schema/dereferenced/repos.json |
Regenerates repository schema. |
schema/dereferenced/suborgs.json |
Regenerates suborganization schema. |
test/unit/schema.test.js |
Tests schema validation. |
test/unit/lib/settings-custom-properties.test.js |
Tests layered merging. |
test/unit/lib/plugins/custom_properties.test.js |
Tests plugin ownership behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+58
to
+60
| const value = entry.value | ||
| if (!(value === null || typeof value === 'string' || (Array.isArray(value) && value.every(item => typeof item === 'string')))) { | ||
| invalid(`include value for "${name}" must be a string, string array or null`) |
Comment on lines
+67
to
+68
| "oneOf": [ | ||
| { "type": "array", "items": { "$ref": "#/$defs/CustomPropertiesSettings" } }, |
Comment on lines
+73
to
+74
| "oneOf": [ | ||
| { "type": "array", "items": { "$ref": "#/$defs/CustomPropertiesSettings" } }, |
Comment on lines
+107
to
+108
| "oneOf": [ | ||
| { "type": "array", "items": { "$ref": "#/$defs/CustomPropertiesSettings" } }, |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

Why
Safe-settings currently clears undeclared custom property values unless
additive_pluginssuppresses all removals. This adapts #1036 so users can preserve selected properties owned by other automation while still clearing other undeclared values.Approach
custom_properties: { include, exclude }alongside legacy lists. Includes take precedence, including explicit null clears; exclusions use case-insensitive regexes without rewriting escapes or character classes.disable_pluginsstripping, preserving org/suborg/repo precedence, aliases, complete multi-value overrides, additive mode, and null resets.npm run build:schema, and add regression coverage plus maintained smoke phase 20.Source audit
Adapted source commit
47c5a4190fa31562a8f7e2a6210182d528952d50from #1036 intoed993857c8e4dca64cb75405cad3238a7dab68b2, based directly on target commit8135a2e87ad1de32adf2d5b5f371ca002ffb0192. No unrelated source ancestry was imported. The #1032 API prerequisite was already covered on the target and was not reapplied.Validation
Using nvm Node 22.12.0 / npm 10.9.0:
npm run test:unit -- --runInBand --silent: 673 passed, 12 skipped; focused property/settings/schema tests: 218 passed.npm run build:schemaproduced identical output; no generated changes outside custom-property definitions and sections.Baseline limitations: the unchanged integration suite fails before executing tests at the Probot 14 ESM/Jest 29 boundary. Fifteen existing lint errors in settings/smoke code were reproduced on the base; changed plugin and regression tests lint cleanly.