-
Notifications
You must be signed in to change notification settings - Fork 92
chore(RHINENG-22144): Update the code to use the new system_profile_* tables and the new canonical_facts fields #3180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
rodrigonull
wants to merge
7
commits into
master
Choose a base branch
from
RHINENG-22144
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Contributor
Reviewer's GuideThis PR migrates system profile handling from a JSONB blob to normalized static and dynamic tables (with a helper to assemble them), extends canonical facts with new fields and standardizes UUID serialization, introduces a denormalized host_type column (backed by a trigger) and updates filtering and event header logic to leverage these changes. Sequence diagram for event header generation using normalized system profilesequenceDiagram
participant Host
participant HostStaticSystemProfile
participant EventProducer
Host->>HostStaticSystemProfile: Access static_system_profile
HostStaticSystemProfile-->>Host: Provide host_type, operating_system, bootc_status
Host->>EventProducer: Pass extracted fields for event header
EventProducer->>EventProducer: Build event header with host_type, os_name, bootc_booted
Entity relationship diagram for new system_profile_* tables and host_type syncerDiagram
HOSTS ||--o| SYSTEM_PROFILES_STATIC : has
HOSTS ||--o| SYSTEM_PROFILES_DYNAMIC : has
SYSTEM_PROFILES_STATIC {
UUID host_id
VARCHAR(50) host_type
JSONB bootc_status
JSONB operating_system
}
SYSTEM_PROFILES_DYNAMIC {
UUID host_id
DATETIME captured_date
}
HOSTS {
UUID id
VARCHAR(50) host_type
}
Class diagram for updated Host model and system profile handlingclassDiagram
class Host {
+UUID id
+String account
+String org_id
+String display_name
+String ansible_host
+UUID insights_id
+UUID subscription_manager_id
+String satellite_id
+String fqdn
+String bios_uuid
+List ip_addresses
+List mac_addresses
+String provider_id
+String provider_type
+UUID openshift_cluster_id
+String host_type
+JSONB system_profile_facts
+List groups
+DateTime last_check_in
+HostStaticSystemProfile static_system_profile
+HostDynamicSystemProfile dynamic_system_profile
+update(input_host, update_system_profile)
+operating_system()
+_add_or_update_normalized_system_profiles(input_system_profile)
}
class HostStaticSystemProfile {
+UUID host_id
+String host_type
+JSONB bootc_status
+JSONB operating_system
...
}
class HostDynamicSystemProfile {
+UUID host_id
+DateTime captured_date
...
}
Host "1" -- "1" HostStaticSystemProfile : static_system_profile
Host "1" -- "1" HostDynamicSystemProfile : dynamic_system_profile
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
ezr-ondrej
reviewed
Nov 19, 2025
migrations/versions/abc123def456_add_host_type_to_hosts_table.py
Outdated
Show resolved
Hide resolved
f7c2afd to
5ce3fa6
Compare
af2e0ee to
5bd98f0
Compare
3b13910 to
94001c1
Compare
Member
Author
|
/retest |
37edccc to
2d801a8
Compare
… tables and the new canonical_facts fields rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
2d801a8 to
b74968f
Compare
rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
b74968f to
a0b1b9b
Compare
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.
Overview
This PR is being created to address RHINENG-22144.
Depends on: #3108
PR Checklist
Secure Coding Practices Documentation Reference
You can find documentation on this checklist here.
Secure Coding Checklist
Summary by Sourcery
Migrate host inventory code to use normalized system_profile_static and system_profile_dynamic tables and dedicated canonical fact columns, replace JSONB serialization for canonical_facts and system_profile_facts, introduce host_type as a denormalized column with database trigger, and update serialization, query, filtering, event header, and tests accordingly
New Features:
Enhancements:
Tests: