Skip to content

Take each upstream's allow-list whole from the source that wins it [patch] - #123

Open
matt-edmondson wants to merge 1 commit into
mainfrom
fix/120-config-file-replaces-allow-list
Open

matt-edmondson wants to merge 1 commit into
mainfrom
fix/120-config-file-replaces-allow-list

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #120

What was wrong

RunAsync adds the --config file after the builder has loaded appsettings.json from the working directory, so that the explicitly named file wins. For scalar settings it does. For Upstreams:{name}:Repositories it doesn't, because .NET configuration merges arrays by index. Suppose the --config file names studio/game.git and a stray appsettings.json names studio/sandbox.git and studio/secret.git. The bound list was then [studio/game.git, studio/secret.git], which allows a repository the operator never named.

What changed

Testing

  • New ConfigFileAllowListTests layers an appsettings.json-style source under a --config source with a shorter list (GitHub cased differently on purpose). It checks:
    • The --config list wins whole (studio/game.git only).
    • An upstream the --config file doesn't name keeps its list.
    • BaseUrl from the lower file still binds.
    • --allow beats both files.
    • A 12-entry list keeps its numeric index order.
  • With resolution disabled, ConfigFile_ShorterList_ReplacesTheAppSettingsList fails with the issue's symptom. With it enabled, the test passes. The other four are guards that pass either way.
  • Full suite: 313/313 pass.
  • Merges cleanly with open PR Refuse a timer-backed timing longer than about 49.7 days [patch] #122.

Generated by Claude Code

…atch]

Configuration merges arrays by index, so a --config file naming one repository
over an appsettings.json in the working directory naming two bound the file's
repository plus the second from appsettings.json, allowing a repository the
operator never named. ResolveAllowLists now takes each upstream's Repositories
from the last source that sets any entry of it, with --allow still beating
every source, and ReplaceAllowLists assigns that list after binding.

Fixes #120

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW4iaJ7gETqBaPbNzq1
@sonarqubecloud

sonarqubecloud Bot commented Nov 7, 2026

Copy link
Copy Markdown

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.

An appsettings.json in the working directory widens the --config allow-list: its Repositories entries past the config file's count stay allowed

2 participants