-
Notifications
You must be signed in to change notification settings - Fork 0
feat: introduce v1 API structure with jobs, stages, and tasks endpoints MAPCO-8959 #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
🎫 Related Jira Issue: MAPCO-8959 |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a versioned API structure by introducing a v1 namespace for the existing API endpoints. The changes update all jobs, stages, and tasks endpoints to be prefixed with /v1, modify the OpenAPI specification file to openapi3-v1.yaml, and reorganize controllers and routers under a new /api/v1 directory structure.
Key Changes:
- Introduced
/v1path prefix for all API endpoints (jobs, stages, tasks) - Renamed OpenAPI specification from
openapi3.yamltoopenapi3-v1.yaml - Restructured controllers and routers into versioned directories under
/src/api/v1
Reviewed changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| openapi3-v1.yaml | Updated all endpoint paths to include /v1 prefix and modified API title/description to reflect v1 versioning |
| src/serverBuilder.ts | Consolidated v1 router mounting and updated OpenAPI middleware configuration to use v1 spec file |
| src/containerConfig.ts | Updated dependency injection to register v1-specific router factories |
| src/api/v1/index.ts | New v1 router aggregator that mounts jobs, stages, and tasks routers under /v1 namespace |
| src/api/v1/jobs/router.ts | Renamed job router factory and symbols to v1-specific names |
| src/api/v1/jobs/controller.ts | Updated JobController to JobControllerV1 with v1-prefixed endpoint paths |
| src/api/v1/stages/router.ts | Renamed stage router factory and symbols to v1-specific names |
| src/api/v1/stages/controller.ts | Updated StageController to StageControllerV1 with v1-prefixed endpoint paths |
| src/api/v1/tasks/router.ts | Renamed task router factory and symbols to v1-specific names |
| src/api/v1/tasks/controller.ts | Updated TaskController to TaskControllerV1 with v1-prefixed endpoint paths |
| src/common/interfaces.ts | Renamed OpenApiConfig to ApiVersionConfig with updated properties |
| package.json | Updated npm scripts to reference new openapi3-v1.yaml file |
| tests/integration/jobs/jobs.spec.ts | Updated tests to use new OpenAPI spec file and corrected test data |
| tests/integration/stages/stages.spec.ts | Updated tests to use new OpenAPI spec file |
| tests/integration/tasks/tasks.spec.ts | Updated tests to use new OpenAPI spec file |
| tests/integration/docs/helpers/docsRequestSender.ts | Updated docs endpoint paths to include v1 prefix |
| tests/configurations/initJestOpenapi.setup.ts | Updated jest-openapi configuration to use new spec file |
| .github/workflows/pull_request.yaml | Updated OpenAPI linting workflow to reference new spec file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const stageRouter = dependencyContainer.resolve<Router>(STAGE_ROUTER_V1_SYMBOL); | ||
| const taskRouter = dependencyContainer.resolve<Router>(TASK_ROUTER_V1_SYMBOL); | ||
|
|
||
| // Mount under v1 namespace |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states 'Mount under v1 namespace' but the routers are already mounted under the v1 prefix in serverBuilder.ts. This comment is misleading as these are mounting resource routes (jobs, stages, tasks) not the v1 namespace itself. Consider updating to 'Mount resource routers' or 'Register jobs, stages, and tasks routes'.
| // Mount under v1 namespace | |
| // Mount resource routers |
Implement a new versioned API structure, including endpoints for jobs, stages, and tasks, while updating related configurations and routes to support the new version.