Skip to content

fix(config)!: stop merging /etc and user client.conf across tiers - #19

Merged
mimi1vx merged 1 commit into
mainfrom
ad_i_8
Aug 11, 2026
Merged

fix(config)!: stop merging /etc and user client.conf across tiers#19
mimi1vx merged 1 commit into
mainfrom
ad_i_8

Conversation

@mimi1vx

@mimi1vx mimi1vx commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

client.conf discovery merged every existing file in a fixed two-path
list (/etc/openqa/client.conf then the user config dir), later keys
winning. That let a section in the user config combine with a section
in /etc/openqa across an administration boundary, and never
consulted /usr/etc/openqa or client.conf.d/*.conf drop-ins at all;
$OPENQA_CONFIG was also an exclusive override even when its
directory held no config.

config::default_paths now performs the same tiered lookup as current
openQA:

  1. $OPENQA_CONFIG (only when set and non-empty)
  2. $XDG_CONFIG_HOME/openqa (or ~/.config/openqa)
  3. /etc/openqa, then /usr/etc/openqa

The first tier producing any file wins outright; later tiers are not
read at all. Within a tier, each directory contributes its
client.conf followed by its client.conf.d/*.conf drop-ins (sorted,
later wins), and a directory with only drop-ins does not stop the scan
of the tier's remaining directories.

Breaking change

Anyone relying on the old cross-tier merge — an override in
~/.config/openqa/client.conf combined with host sections that exist
only in /etc/openqa/client.conf — now loses the /etc sections
outright. $XDG_CONFIG_HOME as the tier-2 selector and treating a
malformed file as a hard error are kept as deliberate divergences from
upstream.

config::default_paths and ClientBuilder::config_paths keep their
existing signatures; an explicit config_paths list is still a plain
in-order merge with no tiering.

Testing

  • cargo fmt --check
  • cargo clippy --all-targets --locked -- -D warnings
  • cargo test --locked
  • cargo check --locked --all-targets
  • cargo deny check

client.conf discovery merged every existing file in a fixed two-path
list (/etc/openqa/client.conf then the user config dir), later keys
winning. That let a section in the user config combine with a section
in /etc/openqa across an administration boundary, and never consulted
/usr/etc/openqa or client.conf.d/*.conf drop-ins at all; $OPENQA_CONFIG
was also an exclusive override even when its directory held no config.

config::default_paths now performs the same tiered lookup as current
openQA: $OPENQA_CONFIG, then the XDG-or-home user directory, then
/etc/openqa and /usr/etc/openqa. The first tier producing any file
wins outright; later tiers are not read at all. Within a tier, each
directory contributes its client.conf followed by its
client.conf.d/*.conf drop-ins (sorted, later wins), and a directory
with only drop-ins does not stop the scan of the tier's remaining
directories.

Anyone relying on the old cross-tier merge -- an override in
~/.config/openqa/client.conf combined with host sections that exist
only in /etc/openqa/client.conf -- now loses the /etc sections
outright, hence the breaking change. $XDG_CONFIG_HOME as the tier-2
selector and treating a malformed file as a hard error are kept as
deliberate divergences from upstream.

config::default_paths and ClientBuilder::config_paths keep their
existing signatures; an explicit config_paths list is still a plain
in-order merge with no tiering.
@mimi1vx
mimi1vx merged commit f0f92a3 into main Aug 11, 2026
5 of 6 checks passed
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.

1 participant