Skip to content

fix(docker): 修复源码镜像构建输入 - #497

Merged
tbphp merged 1 commit into
v2from
tbphp/fix-docker-source-build-root-files
Aug 29, 2026
Merged

fix(docker): 修复源码镜像构建输入#497
tbphp merged 1 commit into
v2from
tbphp/fix-docker-source-build-root-files

Conversation

@tbphp

@tbphp tbphp commented Aug 29, 2026

Copy link
Copy Markdown
Owner

关联 Issue / Related Issue

无 / None

变更内容 / Change Content

  • Bug 修复 / Bug fix
  • 新功能 / New feature
  • 其他改动 / Other changes
  • 将 Docker 源码构建阶段从仅复制 main.go 改为复制全部根目录 Go 源文件,修复新增 runtime.goservice_*.go 后的未定义符号错误。
  • 增加 Dockerfile 契约测试,防止源码构建再次退化为只复制单个入口文件。
  • 不改变 native 构建矩阵、平台 build tags、运行时镜像内容或数据格式。

验证:

  • go test -count=1 -run TestDockerfileSourceBuildCopiesAllRootGoSources ./internal/webui
  • RELEASE_SMOKE_SKIP_SCAN=true .github/scripts/release-docker-smoke.sh
  • make check

自查清单 / Checklist

  • 我已运行 make check,或在说明中写明无法运行的原因和未验证范围。 / I ran make check, or documented why it could not run and what remains unverified.
  • 本 PR 范围聚焦,未包含无关改动。 / This PR is focused and contains no unrelated changes.
  • 我已更新必要的公开文档或发布说明。 / I updated any required public documentation or release notes.
  • 我已确认提交、日志和测试数据不包含敏感信息。 / I confirmed that commits, logs, and fixtures contain no sensitive data.
  • 如适用,我已说明兼容性或数据迁移影响。 / Where applicable, I documented compatibility or data-migration impact.

Summary by CodeRabbit

  • 改进

    • 优化容器构建流程,确保构建时包含项目根目录下的全部 Go 源文件。
  • 测试

    • 新增构建配置检查,验证所有根目录 Go 源文件均会被正确复制。

Copilot AI lite review requested due to automatic review settings August 29, 2026 15:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T15:54:25.258306Z b41bc40 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Dockerfile 的 go-builder 阶段现在复制全部根目录 Go 源文件。新增契约测试读取 Dockerfile,并验证存在 COPY *.go ./,且不存在 COPY main.go ./

Merge Risk: 🔵 Low · up to b41bc

The PR restores Docker source builds that include all required root Go files, preventing undefined-symbol build failures. It is mergeable with owner awareness that the new contract test should be tightened to validate the active go-builder stage specifically, otherwise a future Dockerfile regression could escape detection.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 标题明确说明修复 Docker 源码镜像构建输入,准确对应将 Dockerfile 从仅复制 main.go 改为复制全部根目录 Go 源文件的主要变更。
Description check ✅ Passed PR 描述完整覆盖关联 Issue、变更内容、详细说明、验证步骤和自查清单。描述准确说明了 Dockerfile 修复、契约测试、兼容性影响及已执行的检查。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch tbphp/fix-docker-source-build-root-files

Warning

Some tools did not complete. Review the errors below.

🔧 golangci-lint (2.12.2)

Error: can't load config: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.0)
The command is terminated due to an error: can't load config: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.0)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
internal/webui/container_contract_test.go-336-339 (1)

336-339: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

将断言限定到 go-builder 阶段。

当前断言搜索整个 Dockerfile,且不区分活动指令与注释。若 go-builder 将来退化为 COPY runtime.go ./,但其他阶段或注释中仍包含 COPY *.go ./,该测试仍会通过。请先提取 go-builder 阶段,再匹配该阶段中的活动 COPY *.go ./ 指令,并检查单文件 Go 源复制规则。


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: 1ac40c4d-b4da-4b25-88d7-9aa34a7a9796

📥 Commits

Reviewing files that changed from the base of the PR and between 5c16ed8 and b41bc40.

📒 Files selected for processing (2)
  • Dockerfile
  • internal/webui/container_contract_test.go

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@tbphp tbphp self-assigned this Aug 29, 2026
@tbphp tbphp added bug Something isn't working dependencies Pull requests that update a dependency file labels Aug 29, 2026
@tbphp tbphp added this to the v2.0.0 milestone Aug 29, 2026
@tbphp
tbphp merged commit 93ab487 into v2 Aug 29, 2026
7 checks passed
@tbphp
tbphp deleted the tbphp/fix-docker-source-build-root-files branch August 29, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants