Skip to content

Conversation

@ronenkapelian
Copy link
Collaborator

Implement a new versioned API structure, including endpoints for jobs, stages, and tasks, while updating related configurations and routes to support the new version.

@ronenkapelian ronenkapelian self-assigned this Dec 7, 2025
@github-actions
Copy link

github-actions bot commented Dec 7, 2025

🎫 Related Jira Issue: MAPCO-8959

@github-actions
Copy link

github-actions bot commented Dec 7, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 100% (🎯 80%) 1714 / 1714
🔵 Statements 100% (🎯 80%) 1714 / 1714
🔵 Functions 100% (🎯 80%) 102 / 102
🔵 Branches 100% (🎯 80%) 426 / 426
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/containerConfig.ts 100% 100% 100% 100%
src/serverBuilder.ts 100% 100% 100% 100%
Generated in workflow #649 for commit 524f73f by the Vitest Coverage Report Action

@ronenkapelian ronenkapelian requested a review from Copilot December 9, 2025 09:11
Copy link
Contributor

Copilot AI left a 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 /v1 path prefix for all API endpoints (jobs, stages, tasks)
  • Renamed OpenAPI specification from openapi3.yaml to openapi3-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
Copy link

Copilot AI Dec 9, 2025

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'.

Suggested change
// Mount under v1 namespace
// Mount resource routers

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants