HMS-10208: add bootc to systems response - #2288
Open
Dugowitch wants to merge 1 commit into
Open
Conversation
Return `bootc` in systems response so that FE can determine if a system is image-based. Co-Authored-By: Claude <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdd 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
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new
SystemBootcstruct uses a field nameBootcwhile exposing it asimage_basedin JSON; consider aligning naming or adding a short code comment to clarify the mapping to avoid future confusion. - The
bootccolumn is now required in thesystem_inventoryINSERTs indev/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
systemsresponse schema indocs/v3/openapi.jsonfully reflects the newimage_basedattribute (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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| type SystemBootc struct { | ||
| Bootc bool `json:"image_based" csv:"-" query:"si.bootc" gorm:"column:bootc"` |
Collaborator
There was a problem hiding this comment.
Is there a reason why image_based field is in json export but not in csv?
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
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.
Return
bootcin systems response so that FE can determine if a system is image-based.Secure Coding Practices Checklist GitHub Link
Secure Coding Checklist
Summary by Sourcery
Expose image-based (bootc) status in systems API responses and align test data and tests with the new attribute.
New Features:
Tests: