fix(api,orchestrator): fix remaining dependency injection issues
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
API: - Add AuthModule import to JobEventsModule - Add AuthModule import to JobStepsModule - Fixes: AuthGuard dependency resolution in job modules Orchestrator: - Add @Optional() decorator to docker parameter in DockerSandboxService - Fixes: NestJS trying to inject Docker class as dependency All modules using AuthGuard must import AuthModule. Docker parameter is optional for testing, needs @Optional() decorator.
This commit is contained in:
@@ -2,6 +2,7 @@ import { Module } from "@nestjs/common";
|
||||
import { JobEventsController } from "./job-events.controller";
|
||||
import { JobEventsService } from "./job-events.service";
|
||||
import { PrismaModule } from "../prisma/prisma.module";
|
||||
import { AuthModule } from "../auth/auth.module";
|
||||
|
||||
/**
|
||||
* Job Events Module
|
||||
@@ -10,7 +11,7 @@ import { PrismaModule } from "../prisma/prisma.module";
|
||||
* Events are stored in PostgreSQL and provide a complete audit trail.
|
||||
*/
|
||||
@Module({
|
||||
imports: [PrismaModule],
|
||||
imports: [PrismaModule, AuthModule],
|
||||
controllers: [JobEventsController],
|
||||
providers: [JobEventsService],
|
||||
exports: [JobEventsService],
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Module } from "@nestjs/common";
|
||||
import { JobStepsController } from "./job-steps.controller";
|
||||
import { JobStepsService } from "./job-steps.service";
|
||||
import { PrismaModule } from "../prisma/prisma.module";
|
||||
import { AuthModule } from "../auth/auth.module";
|
||||
|
||||
/**
|
||||
* Job Steps Module
|
||||
@@ -10,7 +11,7 @@ import { PrismaModule } from "../prisma/prisma.module";
|
||||
* Tracks step status transitions, token usage, and duration.
|
||||
*/
|
||||
@Module({
|
||||
imports: [PrismaModule],
|
||||
imports: [PrismaModule, AuthModule],
|
||||
controllers: [JobStepsController],
|
||||
providers: [JobStepsService],
|
||||
exports: [JobStepsService],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Injectable, Logger } from "@nestjs/common";
|
||||
import { Injectable, Logger, Optional } from "@nestjs/common";
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
import { randomBytes } from "crypto";
|
||||
import Docker from "dockerode";
|
||||
@@ -86,7 +86,7 @@ export class DockerSandboxService {
|
||||
|
||||
constructor(
|
||||
private readonly configService: ConfigService,
|
||||
docker?: Docker
|
||||
@Optional() docker?: Docker
|
||||
) {
|
||||
const socketPath = this.configService.get<string>(
|
||||
"orchestrator.docker.socketPath",
|
||||
|
||||
Reference in New Issue
Block a user