Skip to content

Fixes #39299 - Add additive fact import mode#10980

Open
pablomh wants to merge 1 commit intotheforeman:developfrom
pablomh:registration/additive-fact-import
Open

Fixes #39299 - Add additive fact import mode#10980
pablomh wants to merge 1 commit intotheforeman:developfrom
pablomh:registration/additive-fact-import

Conversation

@pablomh
Copy link
Copy Markdown
Contributor

@pablomh pablomh commented May 7, 2026

Summary

Add additive: keyword argument to FactImporter#import! and HostFactImporter#import_facts. When true, existing facts not in the new set are preserved (delete_removed_facts is skipped).

This enables importing a subset of facts without wiping facts from other sources, needed by Katello (katello#11701) to import only OS-detection facts at registration time.

Changes

  • fact_importer.rb: import!(additive: false) — skips delete_removed_facts when true
  • host_fact_importer.rb: import_facts(facts, source_proxy = nil, additive: false) — passes through
  • Test: verifies additive import preserves existing facts
  • Test brace fixes for Ruby keyword argument disambiguation

How to test

  1. bundle exec rake test TEST=test/unit/fact_importer_test.rb
  2. bundle exec rake test TEST=test/unit/host_fact_importer_test.rb

Add additive: keyword argument to FactImporter#import! and
HostFactImporter#import_facts. When true, existing facts not in
the new set are preserved (delete_removed_facts is skipped).

This enables importing a subset of facts without wiping facts
from other sources, needed by Katello to import only OS-detection
facts at registration time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant