Skip to content

Conversation

@FabriciaDinizRH
Copy link
Contributor

@FabriciaDinizRH FabriciaDinizRH commented Nov 5, 2025

Overview

This PR is being created to address RHINENG-20012.

  • Pull documentation from inventory-schemas
  • Update documentation to reflect SP recent changes

PR Checklist

  • Keep PR title short, ideally under 72 characters
  • Descriptive comments provided in complex code blocks
  • Include raw query examples in the PR description, if adding/modifying SQL query
  • Tests: validate optimal/expected output
  • Tests: validate exceptions and failure scenarios
  • Tests: edge cases
  • Recovers or fails gracefully during potential resource outages (e.g. DB, Kafka)
  • Uses type hinting, if convenient
  • Documentation, if this PR changes the way other services interact with host inventory
  • Links to related PRs

Secure Coding Practices Documentation Reference

You can find documentation on this checklist here.

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

Summary by Sourcery

Add documentation for the System Profile schema and implement a comprehensive test suite for static and dynamic System Profile models.

Documentation:

  • Add docs/system_profile.md detailing SP schema structure, contribution guidelines, merge process, and stakeholders.

Tests:

  • Add tests for HostStaticSystemProfile covering create, update, delete, constraint enforcement, and JSONB/array support.
  • Add tests for HostDynamicSystemProfile covering create, update, delete, type validation, full normalization flow, and workload field handling.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 5, 2025

Reviewer's Guide

This PR adds comprehensive documentation for the System Profile schema and enriches the codebase with extensive unit and integration tests for both static and dynamic system profile models, ensuring coverage of CRUD operations, data constraints, complex types, and normalization workflows.

Entity relationship diagram for System Profile schema documentation

erDiagram
    SYSTEM_PROFILE_STATIC {
      string id
      string fields
    }
    SYSTEM_PROFILE_DYNAMIC {
      string id
      string fields
    }
    SYSTEM_PROFILE_SCHEMA {
      string version
      string id
      string definitions
    }
    SYSTEM_PROFILE_STATIC ||--o{ SYSTEM_PROFILE_SCHEMA : contains
    SYSTEM_PROFILE_DYNAMIC ||--o{ SYSTEM_PROFILE_SCHEMA : contains
Loading

Class diagram for System Profile Static and Dynamic Models

classDiagram
class SystemProfileStatic {
  +fields: various
  +CRUD operations
  +data constraints
  +normalization workflows
}
class SystemProfileDynamic {
  +fields: various
  +CRUD operations
  +data constraints
  +normalization workflows
}
SystemProfileStatic <|-- SystemProfileModel
SystemProfileDynamic <|-- SystemProfileModel
Loading

File-Level Changes

Change Details Files
Add System Profile schema documentation and contribution guidelines
  • Create docs/system_profile.md with schema overview
  • Add Contributing and Process for Merging Schema Changes sections
  • List stakeholders and reference OpenAPI guidelines
docs/system_profile.md
Introduce tests for HostStaticSystemProfile model
  • Add creation, update, and deletion tests
  • Add constraint validation for integer fields
  • Add tests for complex JSONB and array data types
tests/test_sp_models.py
Introduce tests for HostDynamicSystemProfile model and normalization
  • Add creation, update, and deletion tests
  • Add type validation error test
  • Add full system profile normalization integration test
  • Add workloads top-level data tests
tests/test_sp_models.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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