feat: some new api frame#1933
Conversation
Signed-off-by: Wangyan <topshihun@foxmail.com>
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new API framework for Orion server with four v2 endpoints for task retry, task retrieval, build event retrieval, and target retrieval. The changes include three new database entity models (orion_tasks, build_events, build_targets) that define the data structures for these operations, along with OpenAPI schema definitions.
Changes:
- Added three new SeaORM entity models for orion_tasks, build_events, and build_targets tables
- Added four new v2 API endpoints with OpenAPI documentation
- Registered new DTOs and handlers in OpenAPI schema
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| orion-server/src/server.rs | Added new API handler imports and DTO schema registrations to OpenAPI configuration |
| orion-server/src/model/orion_tasks.rs | New entity model for orion_tasks table with relationships to build_events and build_targets |
| orion-server/src/model/mod.rs | Module declarations for new entities (currently commented out) |
| orion-server/src/model/build_targets.rs | New entity model for build_targets table with foreign key to orion_tasks |
| orion-server/src/model/build_events.rs | New entity model for build_events table with foreign key to orion_tasks |
| orion-server/src/api.rs | Added four new v2 API endpoints (task-retry, task, build-event, target) with stub implementations and DTOs |
| #[utoipa::path( | ||
| get, | ||
| path = "v2/task/{cl}", | ||
| params(("cl" = String, Path, description = "cl")), |
There was a problem hiding this comment.
The description "cl" for the path parameter is too vague. Based on the context and existing codebase patterns (e.g., cl_id in tasks model), this appears to be a Change List identifier. The description should be more descriptive, such as "Change List identifier".
| params(("cl" = String, Path, description = "cl")), | |
| params(("cl" = String, Path, description = "Change List identifier")), |
| .route("/v2/task-retry/{id}", post(task_retry_handler)) | ||
| .route("/v2/task/{cl}", get(task_get_handler)) | ||
| .route("/v2/build-event/{task-id}", get(build_event_get_handler)) | ||
| .route("/v2/target/{task-id}", get(target_get_handler)) |
There was a problem hiding this comment.
The path parameter uses a hyphen 'task-id' which is inconsistent with the existing codebase conventions. All other route parameters in this file use underscores (e.g., 'task_id' at line 108, 'target_id' at line 106). The parameter should be '{task_id}' with an underscore to match the rest of the codebase.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc1150bf56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
link #1852 |
No description provided.