Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughMigrates ingest validation from an internal ChangesSchema Migration: upload.IngestSchema → payload.Schema
Sequence Diagram(s)sequenceDiagram
participant Client
participant API as API Server
participant Storage as Temp Storage
participant Payload as payload.Validator
participant Graphify as GraphifyService
Client->>API: POST /ingest (file)
API->>Storage: WriteAndValidateJSON/Zip (tee to validator)
Storage->>Payload: ParseAndValidate / ValidateZip
Payload-->>Storage: ValidationReport (errors?)
alt validation errors
Storage-->>API: return report + ErrInvalidJSON/type
API-->>Client: 400 Bad Request (schema validation details)
else valid
Storage-->>API: saved file path + report
API->>Graphify: enqueue/process file (ReadFileForIngest)
Graphify->>Payload: Parse metadata / ParsedData
Graphify-->>API: processing result / error
API-->>Client: 202 Accepted
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
cmd/api/src/services/graphify/ingest_integration_test.go (1)
101-102: 💤 Low valueConsider asserting on the validation report in the failure path.
The test discards the
ValidationReportreturned byReadFileForIngest. According totasks.go(lines 190-196),report.CriticalErrorsandreport.ValidationErrorsare used to populate error messages. Asserting on these fields would strengthen the test coverage for the new validation flow.💡 Suggested enhancement
- _, err := graphify.ReadFileForIngest(ingestContext, invalidReader, readOptions) - require.NotNil(t, err) + report, err := graphify.ReadFileForIngest(ingestContext, invalidReader, readOptions) + require.NotNil(t, err) + require.True(t, len(report.CriticalErrors) > 0 || len(report.ValidationErrors) > 0, "expected validation errors in report")🤖 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 `@cmd/api/src/services/graphify/ingest_integration_test.go` around lines 101 - 102, The test currently only checks that ReadFileForIngest(ingestContext, invalidReader, readOptions) returns a non-nil error; update the failure path to also capture and assert on the returned ValidationReport (e.g., the report value returned by ReadFileForIngest) and assert that report.CriticalErrors and/or report.ValidationErrors contain the expected entries for the invalid input; locate the call to ReadFileForInest and add assertions against the returned report's CriticalErrors and ValidationErrors fields to validate the new validation flow.go.mod (1)
47-47: 💤 Low valueUse the latest stable release version (v0.1.1) instead of a pseudo-version.
The chow dependency uses a pseudo-version (
v0.1.2-0.20260501161234-9ffc316fa3ec) pointing to a pre-release commit. The latest stable release is v0.1.1 (published 2026-04-14). Consider upgrading to v0.1.1 for production deployments to improve reproducibility and use a vetted release.🤖 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 `@go.mod` at line 47, Replace the pseudo-version entry for the module github.com/specterops/chow in go.mod with the latest stable release version v0.1.1; locate the line containing "github.com/specterops/chow v0.1.2-0.20260501161234-9ffc316fa3ec" and change it to "github.com/specterops/chow v0.1.1", then run `go mod tidy` to update the dependency graph and ensure the module downloads the tagged release.
🤖 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.
Nitpick comments:
In `@cmd/api/src/services/graphify/ingest_integration_test.go`:
- Around line 101-102: The test currently only checks that
ReadFileForIngest(ingestContext, invalidReader, readOptions) returns a non-nil
error; update the failure path to also capture and assert on the returned
ValidationReport (e.g., the report value returned by ReadFileForIngest) and
assert that report.CriticalErrors and/or report.ValidationErrors contain the
expected entries for the invalid input; locate the call to ReadFileForInest and
add assertions against the returned report's CriticalErrors and ValidationErrors
fields to validate the new validation flow.
In `@go.mod`:
- Line 47: Replace the pseudo-version entry for the module
github.com/specterops/chow in go.mod with the latest stable release version
v0.1.1; locate the line containing "github.com/specterops/chow
v0.1.2-0.20260501161234-9ffc316fa3ec" and change it to
"github.com/specterops/chow v0.1.1", then run `go mod tidy` to update the
dependency graph and ensure the module downloads the tagged release.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 19cc8f7d-78a9-45da-8e1e-45b8d26c82d7
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (24)
cmd/api/src/api/registration/registration.gocmd/api/src/api/v2/fileingest.gocmd/api/src/api/v2/fileingest_test.gocmd/api/src/api/v2/model.gocmd/api/src/daemons/datapipe/datapipe_integration_test.gocmd/api/src/daemons/datapipe/pipeline.gocmd/api/src/services/entrypoint.gocmd/api/src/services/graphify/graphify_integration_test.gocmd/api/src/services/graphify/ingest.gocmd/api/src/services/graphify/ingest_integration_test.gocmd/api/src/services/graphify/service.gocmd/api/src/services/graphify/tasks.gocmd/api/src/services/upload/file_validator.gocmd/api/src/services/upload/jsonschema/edge.jsoncmd/api/src/services/upload/jsonschema/metadata.jsoncmd/api/src/services/upload/jsonschema/node.jsoncmd/api/src/services/upload/jsonutils.gocmd/api/src/services/upload/schema.gocmd/api/src/services/upload/streamdecoder.gocmd/api/src/services/upload/streamdecoder_test.gocmd/api/src/services/upload/upload.gocmd/api/src/services/upload/upload_test.gogo.modpackages/go/graphify/graph/graph.go
💤 Files with no reviewable changes (8)
- cmd/api/src/services/upload/jsonschema/node.json
- cmd/api/src/services/upload/jsonschema/metadata.json
- cmd/api/src/services/upload/jsonschema/edge.json
- cmd/api/src/services/upload/jsonutils.go
- cmd/api/src/services/upload/streamdecoder_test.go
- cmd/api/src/services/upload/schema.go
- cmd/api/src/services/upload/file_validator.go
- cmd/api/src/services/upload/streamdecoder.go
Description
Replace ingest validation with chow
Motivation and Context
Resolves BED-7790
Why is this change required? What problem does it solve?
This creates a single source of truth for validation, so that users can do ingest validation on the command line. It also improves error reporting and testability.
How Has This Been Tested?
Tested manually with payloads, also chow is heavily unit tested itself.
Screenshots (optional):
Types of changes
Checklist:
Summary by CodeRabbit
Refactor
Chores