Fix multi-level config merging (default → org → repo)#538
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix multiple levels of configuration merging
Fix multi-level config merging (default → org → repo)
Jul 25, 2026
timja
approved these changes
Jul 25, 2026
Owner
|
@copilot resolve the merge conflicts in this pull request |
timja
marked this pull request as ready for review
July 25, 2026 10:29
timja
enabled auto-merge (squash)
July 25, 2026 10:29
…tion-merging # Conflicts: # app/router.js
auto-merge was automatically disabled
July 25, 2026 10:31
Head branch was pushed to by a user without write access
Contributor
Author
Merge conflicts resolved in 826cab9. The conflict was in |
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.
When both an org-level (
.githubrepo) and repo-levelcomment-ops.ymlexist, the org config was silently skipped — onlydefault → repowas applied instead of the intendeddefault → org → repo.Root Cause
The
@probot/octokit-plugin-configplugin only falls back to the org's.githubrepo when the requesting repo has no config file. So a singleoctokit.config.getcall can never return both configs simultaneously.Changes
app/router.js: Split config loading into two explicit calls — one for{owner}/.github(org) and one for the actual repo — then merge in the correct precedence order. Extracted into amergeConfigshelper that correctly handles:_extendschains (the plugin returns multiple files per level; only the first file's existence is checked to avoid the plugin's org-fallthrough being double-counted)app/router.test.js: Unit tests formergeConfigscovering all combinations: no config, org-only, repo-only, both (the broken case), precedence ordering, and_extendschains.