refactor(log-ingestor)!: Rename ingestion API routes to the /s3/* scheme.#2261
refactor(log-ingestor)!: Rename ingestion API routes to the /s3/* scheme.#2261jonathan-imanu wants to merge 1 commit intoy-scope:mainfrom
Conversation
WalkthroughThe pull request updates three API endpoint paths in the log-ingestor routing configuration. The S3 scanner creation, SQS listener creation, and job termination endpoints are moved to a unified ChangesAPI Route Path Consolidation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
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 `@components/log-ingestor/src/routes.rs`:
- Line 248: The route path currently uses a type-specific prefix
"/s3/{job_id}/terminate" which wrongly ties a type-agnostic operation to S3;
change the route to a resource-oriented path such as "/jobs/{job_id}/terminate"
(or "/job/{job_id}/terminate" if that matches existing conventions) and update
the route registration so the handler shutdown_and_remove_job_instance remains
unchanged and continues to accept an IngestionJobId; ensure any doc/comments and
tests referencing the old "/s3/…" path are updated accordingly.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8df16e85-c681-4a16-a12c-b1ae2ac09c4e
⛔ Files ignored due to path filters (1)
docs/src/_static/generated/log-ingestor-openapi.jsonis excluded by!**/generated/**
📒 Files selected for processing (1)
components/log-ingestor/src/routes.rs
| #[utoipa::path( | ||
| post, | ||
| path = "/job/{job_id}/terminate", | ||
| path = "/s3/{job_id}/terminate", |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
/s3/{job_id}/terminate conflates job-type namespace with a type-agnostic operation.
job_id carries no type information (it is just an opaque ID). Placing the terminate operation under the /s3/ prefix implies it is specific to S3 jobs. If a non-S3 ingestion job type is added later, a separate termination path would be required, or the /s3/ prefix would have to be extended in an ad-hoc way.
A resource-oriented path like /jobs/{job_id}/terminate or simply the original /job/{job_id}/terminate keeps the termination operation decoupled from job type, matching the semantics of the handler (shutdown_and_remove_job_instance accepts any IngestionJobId). Worth confirming whether issue #2166 explicitly mandates this path shape or whether a generic /jobs/{job_id}/terminate also satisfies the scheme.
🤖 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 `@components/log-ingestor/src/routes.rs` at line 248, The route path currently
uses a type-specific prefix "/s3/{job_id}/terminate" which wrongly ties a
type-agnostic operation to S3; change the route to a resource-oriented path such
as "/jobs/{job_id}/terminate" (or "/job/{job_id}/terminate" if that matches
existing conventions) and update the route registration so the handler
shutdown_and_remove_job_instance remains unchanged and continues to accept an
IngestionJobId; ensure any doc/comments and tests referencing the old "/s3/…"
path are updated accordingly.
Description
Rename log-ingestor API routes according to the proposal outlined in #2166
Checklist
breaking change.
Validation performed
Summary by CodeRabbit