feat(log-ingestor): Add OpenAPI documentation for server APIs; Add OpenAPI documentation static generator.#1783
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughAdds OpenAPI support and schema metadata: new utoipa deps, ToSchema derives and field schema annotations for ingestion configs, OpenApiRouter-based routes exposing /openapi.json with CORS, structured error payloads, an OpenAPI codegen CLI binary, lib/bin Cargo entries, and minor router error logging. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Server as Log-Ingestor Server
participant Router as OpenApiRouter
participant Manager as IngestionJobManager
participant ApiDoc as ApiDoc/OpenAPI
Client->>Server: POST /s3_scanner or /sqs_listener
Server->>Router: route request
Router->>Manager: invoke create job handler
Manager-->>Router: CreationResponse or Error
Router-->>Client: 200 Json(CreationResponse) or ErrorResponse
note right of Router `#D3E4FF`: OpenAPI metadata available at /openapi.json
sequenceDiagram
autonumber
actor DevCLI
participant Codegen as log_ingestor_openapi_codegen
participant ApiDoc as ApiDoc/OpenAPI
participant FS as Filesystem
DevCLI->>Codegen: run with output path
Codegen->>ApiDoc: call ApiDoc::openapi()
ApiDoc-->>Codegen: OpenAPI JSON
Codegen->>FS: create/truncate and write file
FS-->>Codegen: write success
Codegen-->>DevCLI: exit success
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/clp-rust-utils/src/job_config/ingestion.rs (1)
7-38: Fix themin_lengthconstraint on thetagsfield annotation at line 36.The
tagsfield uses#[schema(value_type = Vec<String>, min_length = 1)], butmin_lengthis a string-level constraint in OpenAPI/JSON Schema, not an array constraint. To enforce a minimum number of elements in the array, usemin_items = 1instead. If the intent is to document that each string must be non-empty, note that the Rust typeOption<Vec<NonEmptyString>>already enforces this at compile-time; you may consider whether explicit schema annotation is needed here or if a custom item schema is preferable.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
components/clp-rust-utils/Cargo.toml(1 hunks)components/clp-rust-utils/src/job_config/ingestion.rs(3 hunks)components/log-ingestor/Cargo.toml(2 hunks)components/log-ingestor/src/bin/log_ingestor.rs(1 hunks)components/log-ingestor/src/bin/log_ingestor_openapi_codegen.rs(1 hunks)components/log-ingestor/src/routes.rs(4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 549
File: components/core/tests/test-ir_encoding_methods.cpp:1180-1186
Timestamp: 2024-10-08T15:52:50.753Z
Learning: In the context of loop constructs, LinZhihao-723 prefers using `while (true)` loops and does not consider alternative loop constructs necessarily more readable.
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 549
File: components/core/tests/test-ir_encoding_methods.cpp:1180-1186
Timestamp: 2024-10-01T07:59:11.208Z
Learning: In the context of loop constructs, LinZhihao-723 prefers using `while (true)` loops and does not consider alternative loop constructs necessarily more readable.
📚 Learning: 2025-10-22T21:02:31.113Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
Applied to files:
components/clp-rust-utils/Cargo.toml
🧬 Code graph analysis (2)
components/log-ingestor/src/bin/log_ingestor.rs (1)
components/log-ingestor/src/routes.rs (1)
create_router(59-76)
components/log-ingestor/src/routes.rs (4)
components/log-ingestor/src/ingestion_job_manager.rs (2)
create_s3_scanner_job(106-118)create_sqs_listener_job(131-149)components/clp-rust-utils/src/clp_config/package/config.rs (2)
serde_json(315-315)serde_json(339-339)components/log-ingestor/src/ingestion_job/sqs_listener.rs (1)
serde_json(94-94)components/log-ingestor/src/compression/compression_job_submitter.rs (1)
new(58-102)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: package-image
- GitHub Check: build (ubuntu-24.04)
- GitHub Check: lint-check (ubuntu-24.04)
- GitHub Check: rust-checks
🔇 Additional comments (13)
components/log-ingestor/src/bin/log_ingestor.rs (1)
98-102: LGTM!The error handling for
create_router()follows the same pattern used forIngestionJobManagerState::from_config()above (lines 92-96), maintaining consistency. Usinginspect_errfor logging while propagating the error is idiomatic.components/log-ingestor/Cargo.toml (2)
6-16: LGTM!The library and binary target structure is well-organized. Using underscores for the lib name (
log_ingestor) and hyphens for binary names (log-ingestor,log-ingestor-openapi-codegen) follows Rust conventions.
37-41: Dependency versions are compatible.utoipa-axum 0.2.0 is compatible with utoipa 5.4.0 and axum 0.8.6. The dependency versions align correctly.
components/log-ingestor/src/routes.rs (5)
74-74: Permissive CORS configuration.
allow_origin(Any)permits requests from any origin. This is appropriate for a public API or when accessed via Swagger UI from different origins. If this service should only be accessed from specific origins in production, consider restricting CORS origins via configuration.
18-46: Well-documented workaround for utoipa quirks.The module structure with explicit imports to avoid "super" appearing as a tag in the OpenAPI documentation is a good workaround. The
#[allow(clippy::needless_for_each)]is appropriately scoped to the module.
111-121: LGTM!The response types
CreationResponseandErrorResponseare correctly annotated withToSchemafor OpenAPI schema generation.
132-172: LGTM!The
create_s3_scanner_jobendpoint is well-documented with comprehensive OpenAPI annotations covering all response scenarios (OK, CONFLICT, INTERNAL_SERVER_ERROR).
174-214: LGTM!The
create_sqs_listener_jobendpoint documentation mirrors the S3 scanner endpoint appropriately, with clear descriptions of the SQS-specific behaviour.components/log-ingestor/src/bin/log_ingestor_openapi_codegen.rs (1)
13-17: LGTM!The codegen binary is simple and focused. It correctly retrieves the OpenAPI document from
ApiDoc::openapi()and serializes it to the specified file path.components/clp-rust-utils/Cargo.toml (1)
19-19: LGTM!The
utoipaversion (5.4.0) is consistent with the version used incomponents/log-ingestor/Cargo.toml, which is good practice for avoiding version conflicts within the workspace. Based on learnings, ensureCargo.lockis updated and in sync with these changes.components/clp-rust-utils/src/job_config/ingestion.rs (3)
4-4: LGTM!The
utoipa::ToSchemaimport is correctly added to support OpenAPI schema generation for the configuration structs.
41-50: LGTM!The
ToSchemaderive and schema annotations are correctly applied. Thequeue_urlfield's schema annotation properly represents theNonEmptyStringconstraint, and utoipa should correctly handle the flattenedbasefield by includingBaseConfig's fields in the generated schema.
53-67: LGTM!The
ToSchemaderive and schema annotations are correctly applied. Thestart_afterfield's schema annotation properly represents theNonEmptyStringconstraint. Thescanning_interval_secfield doesn't require an explicit schema annotation as utoipa can correctly infer the schema for primitive types likeu32.
There was a problem hiding this comment.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
components/log-ingestor/src/routes.rs(4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: hoophalab
Repo: y-scope/clp PR: 1535
File: components/clp-rust-utils/src/clp_config/package/config.rs:47-61
Timestamp: 2025-11-03T16:17:40.223Z
Learning: In the y-scope/clp repository, the `ApiServer` struct in `components/clp-rust-utils/src/clp_config/package/config.rs` is a Rust-native configuration type and does not mirror any Python code, unlike other structs in the same file (Config, Database, ResultsCache, Package) which are mirrors of Python definitions.
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 549
File: components/core/tests/test-ir_encoding_methods.cpp:1180-1186
Timestamp: 2024-10-08T15:52:50.753Z
Learning: In the context of loop constructs, LinZhihao-723 prefers using `while (true)` loops and does not consider alternative loop constructs necessarily more readable.
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 549
File: components/core/tests/test-ir_encoding_methods.cpp:1180-1186
Timestamp: 2024-10-01T07:59:11.208Z
Learning: In the context of loop constructs, LinZhihao-723 prefers using `while (true)` loops and does not consider alternative loop constructs necessarily more readable.
🧬 Code graph analysis (1)
components/log-ingestor/src/routes.rs (1)
components/log-ingestor/src/ingestion_job_manager.rs (2)
create_s3_scanner_job(106-118)create_sqs_listener_job(131-149)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: package-image
- GitHub Check: rust-checks
- GitHub Check: build (macos-15)
- GitHub Check: build (ubuntu-24.04)
- GitHub Check: lint-check (ubuntu-24.04)
- GitHub Check: lint-check (macos-15)
🔇 Additional comments (4)
components/log-ingestor/src/routes.rs (4)
18-46: LGTM! Well-structured OpenAPI documentation module.The api_doc module is properly configured with appropriate metadata and path imports. The clippy suppression is justified and well-commented.
78-109: LGTM! Proper error handling with structured responses.The error type and
IntoResponseimplementation correctly map internal errors to appropriate HTTP status codes and structured error responses.
111-121: LGTM! Response types properly configured for OpenAPI.Both
CreationResponseandErrorResponsecorrectly derive the necessary traits for serialization and schema generation.
123-130: LGTM! Health endpoint properly documented.The OpenAPI annotation correctly describes the health check endpoint.
| fn main() -> Result<()> { | ||
| let mut file = std::fs::File::create(Args::parse().path)?; | ||
| let api = log_ingestor::routes::ApiDoc::openapi(); | ||
| write!(file, "{}", api.to_json()?)?; |
There was a problem hiding this comment.
just curious, where do we plan to write this file to? instead of a temporary directory, we may want to write it to a source directory, so that we can generate typing info for any clients who use the HTTP endpoints with tools like: https://openapi-ts.dev/
we can check if the file is up-to-date in a CI workflow.
There was a problem hiding this comment.
- This part of code is mirroring the API server. The generated API doc will be stored under
docs/_staticand will be packaged into the doc site. - I'm planning to enable pre-generation after this PR is merged, together with the API server.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (4)
components/log-ingestor/src/routes.rs (4)
61-62: Duplicate route registration for health endpoint.The health endpoint is registered twice: once manually at
/(line 61) and once via theroutes!macro at/health(line 62). This appears intentional to support both paths, but consider adding a comment to clarify this design decision.
74-74: Permissive CORS policy may need justification for this internal service.The
allow_origin(Any)setting permits requests from any origin. While this service is internal infrastructure bound to127.0.0.1:3002by default (with network isolation), consider whether this broad CORS permission is necessary. If external callers (e.g., browser-based clients) need access, document this decision or restrict origins to known domains in production.
132-155: Document the request body in the OpenAPI annotation.The
#[utoipa::path]annotation should include arequest_bodyattribute to document the expectedS3ScannerConfiginput format for API consumers.Apply this diff to add the request body documentation:
#[utoipa::path( post, path = "/s3_scanner", + request_body = S3ScannerConfig, description = "Creates an ingestion job that periodically scans the specified S3 bucket and \
174-197: Document the request body in the OpenAPI annotation.Similar to
create_s3_scanner_job, this endpoint should document itsSqsListenerConfigrequest body in the OpenAPI annotation.Apply this diff:
#[utoipa::path( post, path = "/sqs_listener", + request_body = SqsListenerConfig, description = "Creates an ingestion job that listens to an SQS queue for notifications about \
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
components/log-ingestor/src/routes.rs(4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 549
File: components/core/tests/test-ir_encoding_methods.cpp:1180-1186
Timestamp: 2024-10-08T15:52:50.753Z
Learning: In the context of loop constructs, LinZhihao-723 prefers using `while (true)` loops and does not consider alternative loop constructs necessarily more readable.
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 549
File: components/core/tests/test-ir_encoding_methods.cpp:1180-1186
Timestamp: 2024-10-01T07:59:11.208Z
Learning: In the context of loop constructs, LinZhihao-723 prefers using `while (true)` loops and does not consider alternative loop constructs necessarily more readable.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: package-image
- GitHub Check: lint-check (ubuntu-24.04)
- GitHub Check: build (ubuntu-24.04)
- GitHub Check: lint-check (macos-15)
- GitHub Check: build (macos-15)
- GitHub Check: rust-checks
🔇 Additional comments (3)
components/log-ingestor/src/routes.rs (3)
111-121: Well-structured response types for OpenAPI.The response types are properly annotated with
ToSchemafor OpenAPI schema generation, and theErrorResponsestruct provides consistent error handling across all endpoints.
123-130: Health endpoint properly documented.The OpenAPI annotation is complete and the implementation is straightforward.
216-246: OpenAPI annotation is now complete.The path parameter documentation has been properly added, including the
paramsattribute with description. The path placeholder{job_id}correctly matches the handler signature.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (4)
components/log-ingestor/src/routes.rs (4)
65-66: Duplicate route registration for health endpoint.The health endpoint is registered at both
/(line 65) and/health(via routes! macro on line 66). This was previously flagged - consider adding a clarifying comment if intentional.
78-78: Permissive CORS policy previously flagged.The
allow_origin(Any)setting was previously noted. If this is intentional for the OpenAPI endpoint to be accessible from Swagger UI at any origin, consider documenting this decision.
137-161: Request body documentation still missing.The handler accepts
Json<S3ScannerConfig>but the OpenAPI annotation lacksrequest_body = S3ScannerConfig. This was previously flagged.#[utoipa::path( post, path = "/s3_scanner", tags = ["IngestionJob"], + request_body = S3ScannerConfig, description = "Creates an ingestion job that periodically scans the specified S3 bucket and \
180-204: Request body documentation still missing.The handler accepts
Json<SqsListenerConfig>but the OpenAPI annotation lacksrequest_body = SqsListenerConfig. This was previously flagged.#[utoipa::path( post, path = "/sqs_listener", tags = ["IngestionJob"], + request_body = SqsListenerConfig, description = "Creates an ingestion job that listens to an SQS queue for notifications about \
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
components/log-ingestor/src/routes.rs(4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 549
File: components/core/tests/test-ir_encoding_methods.cpp:1180-1186
Timestamp: 2024-10-08T15:52:50.753Z
Learning: In the context of loop constructs, LinZhihao-723 prefers using `while (true)` loops and does not consider alternative loop constructs necessarily more readable.
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 549
File: components/core/tests/test-ir_encoding_methods.cpp:1180-1186
Timestamp: 2024-10-01T07:59:11.208Z
Learning: In the context of loop constructs, LinZhihao-723 prefers using `while (true)` loops and does not consider alternative loop constructs necessarily more readable.
🧬 Code graph analysis (1)
components/log-ingestor/src/routes.rs (1)
components/log-ingestor/src/ingestion_job_manager.rs (2)
create_s3_scanner_job(106-118)create_sqs_listener_job(131-149)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: package-image
- GitHub Check: rust-checks
- GitHub Check: build (ubuntu-24.04)
- GitHub Check: lint-check (macos-15)
- GitHub Check: lint-check (ubuntu-24.04)
🔇 Additional comments (7)
components/log-ingestor/src/routes.rs (7)
8-14: LGTM!The imports are well-organized and appropriate for the OpenAPI integration with utoipa and CORS support via tower-http.
18-50: Well-structured OpenAPI module with proper tag organization.The module correctly addresses the previous suggestion by adding
tagsfor endpoint categorization. The import pattern to avoidsuperappearing as a tag is well-documented.
91-113: LGTM!The error handling correctly maps internal errors to appropriate HTTP status codes and uses the new
ErrorResponsestruct for consistent JSON error payloads that align with the OpenAPI schema.
115-125: LGTM!The response structs are properly annotated with
ToSchemafor OpenAPI schema generation, and the doc comments provide clear field descriptions that will appear in the generated documentation.
127-135: LGTM!The health endpoint OpenAPI annotation is correct with appropriate path, tags, and response documentation.
223-254: LGTM!The OpenAPI annotation correctly documents the path parameter
{job_id}with theparamsattribute, addressing previous review feedback. The responses comprehensively cover success and error cases.
255-273: LGTM!The handler implementation correctly validates the UUID format with appropriate error handling and logging at each stage.
| // `utoipa::OpenApi` triggers `clippy::needless_for_each` | ||
| #[allow(clippy::needless_for_each)] | ||
| mod api_doc { | ||
| // Using `super::...` can cause `super` to appear as a tag in the generated OpenAPI | ||
| // documentation. Importing the paths directly prevents this issue. | ||
| use super::{ | ||
| __path_create_s3_scanner_job, | ||
| __path_create_sqs_listener_job, | ||
| __path_health, | ||
| __path_stop_and_delete_job, | ||
| }; |
There was a problem hiding this comment.
Reading this code again, mod api_doc is needed only because #[allow(clippy::needless_for_each)] cannot be applied to a dervie/attr macro. And to add a new mod, we imports use super::{ __path_create_s3_scanner_job, __path_create_sqs_listener_job, __path_health, __path_stop_and_delete_job, }; manually. Do you think we should simply disable clippy::needless_for_each for this file to avoid hassle?
There was a problem hiding this comment.
Cargo.lock has changed a lot. Did you remove Cargo.lock and run task rust?
There was a problem hiding this comment.
Yeah, to fix a merge conflict. Is it a problem?
There was a problem hiding this comment.
It is likely safest to checkout the Cargo.lock file from the main branch and then rerun task rust when there is a conflict. The Cargo.lock file pins the working versions of all dependencies. After updating the lock file, we probably should verify whether the dependencies have broken. (Though there won't be an issue most of the time)
| description = "Creates an ingestion job that listens to an SQS queue for notifications about \ | ||
| new objects to ingest from the specified S3 bucket and key prefix.\n\n\ | ||
| The specified SQS queue must be dedicated to this ingestion job. After successfully \ | ||
| processing a notification, the ingestor deletes the corresponding message from the queue \ | ||
| to prevent duplicate ingestion.", |
There was a problem hiding this comment.
The first sentence is too long. How about
Creates an ingestion job that monitors an SQS queue. The queue receives notifications whenever new objects are added to the specified S3 bucket and key prefix.
The specified SQS queue must be dedicated to this ingestion job. Upon successful ingestion, the job deletes the corresponding message from the queue to ensure objects are not ingested multiple times.
There was a problem hiding this comment.
Will add another paragraph to explain we may also delete any irrelevant message.
| The scanner assumes that objects under the given prefix are immutable and are added in \ | ||
| lexicographical order. Based on this assumption, the scanner ingests objects sequentially, \ | ||
| ensuring that no eligible objects are skipped.", |
There was a problem hiding this comment.
How about this
| The scanner assumes that objects under the given prefix are immutable and are added in \ | |
| lexicographical order. Based on this assumption, the scanner ingests objects sequentially, \ | |
| ensuring that no eligible objects are skipped.", | |
| This scanner ingests objects sequentially, relying on the assumption that all objects under the prefix are immutable and are added in lexicographical order. |
There was a problem hiding this comment.
Rewrote this section with more details for clarity.
| let log_ingestor_router = create_router().with_state(log_ingestor_manager_state); | ||
| let log_ingestor_router = create_router() | ||
| .inspect_err(|err| { | ||
| tracing::error!(err = ? err, "Failed to create router."); |
There was a problem hiding this comment.
We probably need to delete this after we implement proper logging by writing to stderr. Otherwise, the error will be printed twice by anyhow and tracing. It's good for now
…23/clp into log-ingestor-api-doc
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (3)
components/log-ingestor/src/routes.rs (3)
50-67: Router construction is functional but consider past feedback.The router is properly constructed with OpenAPI integration. Note that previous review comments have flagged:
- The permissive CORS
allow_origin(Any)policy (line 65)- The potential optimization of using a static reference for
api_json(lines 59-64)- The intentional duplicate health route registration at both "/" and "/health" (lines 52-53)
124-153: Document the request body in the OpenAPI annotation.The
#[utoipa::path]annotation is missing therequest_bodyattribute to document the expectedS3ScannerConfiginput. This was flagged in a previous review and remains unaddressed.Apply this diff to add request body documentation:
#[utoipa::path( post, path = "/s3_scanner", tags = ["IngestionJob"], + request_body = S3ScannerConfig, description = "Creates an ingestion job that periodically scans the specified S3 bucket and \Based on past review comments, this is essential for complete API documentation.
172-199: Document the request body in the OpenAPI annotation.Similar to the S3 scanner endpoint, the
#[utoipa::path]annotation is missing therequest_bodyattribute forSqsListenerConfig. This was previously flagged and remains unaddressed.Apply this diff:
#[utoipa::path( post, path = "/sqs_listener", tags = ["IngestionJob"], + request_body = SqsListenerConfig, description = "Creates an ingestion job that monitors an SQS queue. The queue receives \Based on past review comments, this documentation is necessary for API consumers.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
components/log-ingestor/src/routes.rs(4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 549
File: components/core/tests/test-ir_encoding_methods.cpp:1180-1186
Timestamp: 2024-10-08T15:52:50.753Z
Learning: In the context of loop constructs, LinZhihao-723 prefers using `while (true)` loops and does not consider alternative loop constructs necessarily more readable.
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 549
File: components/core/tests/test-ir_encoding_methods.cpp:1180-1186
Timestamp: 2024-10-01T07:59:11.208Z
Learning: In the context of loop constructs, LinZhihao-723 prefers using `while (true)` loops and does not consider alternative loop constructs necessarily more readable.
🧬 Code graph analysis (1)
components/log-ingestor/src/routes.rs (1)
components/log-ingestor/src/ingestion_job_manager.rs (2)
create_s3_scanner_job(106-118)create_sqs_listener_job(131-149)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: package-image
- GitHub Check: lint-check (macos-15)
- GitHub Check: lint-check (ubuntu-24.04)
- GitHub Check: rust-checks
- GitHub Check: build (macos-15)
- GitHub Check: build (ubuntu-24.04)
🔇 Additional comments (6)
components/log-ingestor/src/routes.rs (6)
2-16: LGTM!The imports are well-organized and all necessary dependencies for OpenAPI integration are properly included.
19-37: LGTM!The OpenAPI configuration is well-structured with appropriate metadata, tags for endpoint organization, and all paths properly registered.
69-100: LGTM!The error handling implementation is well-structured with appropriate HTTP status codes for each error variant and consistent use of the
ErrorResponsepayload.
102-112: LGTM!The response structures are properly defined with appropriate derives (
ToSchemafor OpenAPI,Serializefor JSON) and clear field documentation.
114-122: LGTM!The health endpoint is properly documented with OpenAPI annotations and implements a simple, effective health check.
218-268: LGTM!The delete job endpoint is well-documented with proper OpenAPI annotations including path parameter documentation, comprehensive response codes, and appropriate UUID validation in the handler.
hoophalab
left a comment
There was a problem hiding this comment.
lgtm
Validations: openapi.json exports correctly and looks correct.
…enAPI documentation static generator. (y-scope#1783)
Description
As the title suggested. This PR adds docs for server APIs and an OpenAPI doc generator.
Checklist
breaking change.
Validation performed
Summary by CodeRabbit
New Features
Bug Fixes / Improvements
✏️ Tip: You can customize this high-level summary in your review settings.