ECOPROJECT-4807 | feat: add created_at timestamp to inventory schema - #1377
ECOPROJECT-4807 | feat: add created_at timestamp to inventory schema#1377nirarg wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughAdds an optional ChangesInventory creation timestamp
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/hold |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api/v1alpha1/openapi.yaml`:
- Around line 2316-2319: Update the created_at property in the OpenAPI schema to
explicitly allow null values by adding nullable: true, then regenerate all
embedded/generated specifications so the schema and generated artifacts remain
consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: bfaff689-600e-443e-a160-bd0f65bbd189
📒 Files selected for processing (10)
api/v1alpha1/agent/spec.gen.goapi/v1alpha1/openapi.yamlapi/v1alpha1/spec.gen.goapi/v1alpha1/types.gen.gointernal/handlers/v1alpha1/agent.gointernal/handlers/v1alpha1/mappers/inbound.gopkg/duckdb_parser/inventory_builder.gopkg/inventory/converters/to_api.gopkg/inventory/converters/to_api_test.gopkg/inventory/model.go
| created_at: | ||
| type: string | ||
| format: date-time | ||
| description: Timestamp when the inventory data was created or collected |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Allow explicit null for backward compatibility.
created_at is optional but not nullable, so schema-aware clients or validators can reject existing payloads containing "created_at": null, even though the generated Go pointer accepts it. Add nullable: true and regenerate the embedded specifications.
This follows the PR objective that existing data may deserialize with created_at: null.
Proposed schema fix
created_at:
type: string
format: date-time
+ nullable: true
description: Timestamp when the inventory data was created or collected📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| created_at: | |
| type: string | |
| format: date-time | |
| description: Timestamp when the inventory data was created or collected | |
| created_at: | |
| type: string | |
| format: date-time | |
| nullable: true | |
| description: Timestamp when the inventory data was created or collected |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@api/v1alpha1/openapi.yaml` around lines 2316 - 2319, Update the created_at
property in the OpenAPI schema to explicitly allow null values by adding
nullable: true, then regenerate all embedded/generated specifications so the
schema and generated artifacts remain consistent.
2d16684 to
1b6fb9a
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/duckdb_parser/inventory_builder.go`:
- Around line 78-84: Add regression tests covering nil CreatedAt defaults and
preservation of an existing CreatedAt value for BuildInventory in
pkg/duckdb_parser/inventory_builder.go:78-84, the inbound mapper in
internal/handlers/v1alpha1/mappers/inbound.go:191-194, and each affected agent
handler site in internal/handlers/v1alpha1/agent.go:43-46, 99-102, and 154-157;
assert that nil inputs receive a timestamp while pre-populated timestamps remain
unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 86eaef8c-db2b-464c-b41e-eb7b4014229f
📒 Files selected for processing (10)
api/v1alpha1/agent/spec.gen.goapi/v1alpha1/openapi.yamlapi/v1alpha1/spec.gen.goapi/v1alpha1/types.gen.gointernal/handlers/v1alpha1/agent.gointernal/handlers/v1alpha1/mappers/inbound.gopkg/duckdb_parser/inventory_builder.gopkg/inventory/converters/to_api.gopkg/inventory/converters/to_api_test.gopkg/inventory/model.go
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AvielSegev The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Adds a created_at field to the Inventory schema (inside the JSONB blob) so assessments can track when inventory data was originally collected. For RVTools and agent paths, the timestamp is set automatically by BuildInventory(). For direct inventory uploads and agent pushes, the server injects time.Now() if the caller omits it. Co-Authored-By: Claude Code <noreply@anthropic.com> Signed-off-by: Nir Argaman <nargaman@redhat.com>
1b6fb9a to
664acb1
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Summary
created_atfield to theInventoryOpenAPI schema (inside the JSONB blob stored in snapshots), so assessments can track when inventory data was originally created or collectedBuildInventory()at processing/collection timetime.Now()if the caller omits the fieldcreated_at: nullChanges
api/v1alpha1/openapi.yamlcreated_atfield toInventoryschemapkg/inventory/model.goCreatedAt *time.Timeto domain modelpkg/inventory/converters/to_api.goCreatedAtinToAPI()pkg/duckdb_parser/inventory_builder.goCreatedAtinBuildInventory()internal/handlers/v1alpha1/mappers/inbound.gointernal/handlers/v1alpha1/agent.gopkg/inventory/converters/to_api_test.goCreatedAtmappingTest plan
make lintpassesmake unit-testpasses (all 21 suites, including new converter tests)CreatedAtpropagation (set and nil)created_atstill deserialize correctlyFixes: ECOPROJECT-4807
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
API Improvements
created_atdate-time field to the Inventory API schema.