From a891bf9b4b71bd82e732c9d96bb192622b6a94f8 Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Fri, 17 Apr 2026 18:08:53 -0700 Subject: [PATCH] =?UTF-8?q?fix(ci):=20remove=20go.mod=20replace=20/plugin?= =?UTF-8?q?=20=E2=80=94=20add=20it=20at=20Docker=20build=20time=20only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The replace directive `=> /plugin` breaks CI builds where go build runs natively (no /plugin directory). Move the replace to Dockerfile RUN so it only applies during Docker builds where the plugin is COPYed. Fixes: "replacement directory /plugin does not exist" on CI runner. Co-Authored-By: Claude Opus 4.6 (1M context) --- platform/Dockerfile | 2 ++ platform/Dockerfile.tenant | 2 ++ platform/go.mod | 2 -- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/Dockerfile b/platform/Dockerfile index f2bb0ef9..08540278 100644 --- a/platform/Dockerfile +++ b/platform/Dockerfile @@ -8,6 +8,8 @@ WORKDIR /app # Plugin source for replace directive in go.mod COPY molecule-ai-plugin-github-app-auth/ /plugin/ COPY platform/go.mod platform/go.sum ./ +# Add replace directive for Docker builds (plugin is COPYed to /plugin above) +RUN echo 'replace github.com/Molecule-AI/molecule-ai-plugin-github-app-auth => /plugin' >> go.mod RUN go mod download COPY platform/ . RUN CGO_ENABLED=0 GOOS=linux go build -o /platform ./cmd/server diff --git a/platform/Dockerfile.tenant b/platform/Dockerfile.tenant index 99bef4e0..213a628a 100644 --- a/platform/Dockerfile.tenant +++ b/platform/Dockerfile.tenant @@ -16,7 +16,9 @@ # ── Stage 1: Go platform binary ────────────────────────────────────── FROM golang:1.25-alpine AS go-builder WORKDIR /app +COPY molecule-ai-plugin-github-app-auth/ /plugin/ COPY platform/go.mod platform/go.sum ./ +RUN echo 'replace github.com/Molecule-AI/molecule-ai-plugin-github-app-auth => /plugin' >> go.mod RUN go mod download COPY platform/ . RUN CGO_ENABLED=0 GOOS=linux go build -o /platform ./cmd/server diff --git a/platform/go.mod b/platform/go.mod index a3614168..40a93c6c 100644 --- a/platform/go.mod +++ b/platform/go.mod @@ -90,5 +90,3 @@ require ( google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/Molecule-AI/molecule-ai-plugin-github-app-auth => /plugin