Skip to content

HMS-10208: add bootc to systems response - #2288

Open
Dugowitch wants to merge 1 commit into
RedHatInsights:masterfrom
Dugowitch:bootc
Open

HMS-10208: add bootc to systems response#2288
Dugowitch wants to merge 1 commit into
RedHatInsights:masterfrom
Dugowitch:bootc

Conversation

@Dugowitch

@Dugowitch Dugowitch commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Return bootc in systems response so that FE can determine if a system is image-based.

Secure Coding Practices Checklist GitHub Link

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

Expose image-based (bootc) status in systems API responses and align test data and tests with the new attribute.

New Features:

  • Add bootc field to system_inventory test data to represent whether a system is image-based.
  • Include image-based (bootc) status as image_based in systems API item attributes for frontend consumption.

Tests:

  • Extend systems controller tests to verify the image_based flag is returned for systems in the default response.

Return `bootc` in systems response so that FE can determine if a system
is image-based.

Co-Authored-By: Claude <noreply@anthropic.com>
@Dugowitch
Dugowitch requested a review from a team as a code owner July 30, 2026 14:24
@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Add a new bootc flag to the system inventory model and systems API response so that frontend clients can determine if a system is image-based, and update test data and tests accordingly.

File-Level Changes

Change Details Files
Expose a new image_based (bootc) boolean attribute on systems, backed by the system_inventory.bootc column, and ensure test data and tests cover it.
  • Extend dev test_data.sql system_inventory insert statements to include a new bootc column and set sample values for test records.
  • Introduce a SystemBootc embedded struct with bootc-backed field mapped to the JSON attribute image_based and wire it into SystemItemAttributes so it is returned in systems responses.
  • Update systems controller tests to assert the bootc/image_based flag is present and true for the first test system.
  • Adjust OpenAPI v3 documentation (openapi.json) to reflect the new image_based field in the systems response schema.
dev/test_data.sql
manager/controllers/common_attributes.go
manager/controllers/systems.go
manager/controllers/systems_test.go
docs/v3/openapi.json

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The new SystemBootc struct uses a field name Bootc while exposing it as image_based in JSON; consider aligning naming or adding a short code comment to clarify the mapping to avoid future confusion.
  • The bootc column is now required in the system_inventory INSERTs in dev/test_data.sql; if the DB schema allows NULL for this column, you may want to include one test row with a NULL value to confirm the API behavior for systems without image-based metadata.
  • Ensure the OpenAPI systems response schema in docs/v3/openapi.json fully reflects the new image_based attribute (type, description, and any filter/sort capabilities) so that clients have an accurate contract for this field.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `SystemBootc` struct uses a field name `Bootc` while exposing it as `image_based` in JSON; consider aligning naming or adding a short code comment to clarify the mapping to avoid future confusion.
- The `bootc` column is now required in the `system_inventory` INSERTs in `dev/test_data.sql`; if the DB schema allows NULL for this column, you may want to include one test row with a NULL value to confirm the API behavior for systems without image-based metadata.
- Ensure the OpenAPI `systems` response schema in `docs/v3/openapi.json` fully reflects the new `image_based` attribute (type, description, and any filter/sort capabilities) so that clients have an accurate contract for this field.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.10%. Comparing base (dd02a9f) to head (c42abf1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2288   +/-   ##
=======================================
  Coverage   59.10%   59.10%           
=======================================
  Files         147      147           
  Lines        9332     9332           
=======================================
  Hits         5516     5516           
  Misses       3244     3244           
  Partials      572      572           
Flag Coverage Δ
unittests 59.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}

type SystemBootc struct {
Bootc bool `json:"image_based" csv:"-" query:"si.bootc" gorm:"column:bootc"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why image_based field is in json export but not in csv?

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.

3 participants