Skip to content

[infra] CI 優化:backend unit test 改用 native Go,移除 artifact roundtrip#438

Merged
github-actions[bot] merged 4 commits intodevelopfrom
fix/backend-ci-native-go
Apr 30, 2026
Merged

[infra] CI 優化:backend unit test 改用 native Go,移除 artifact roundtrip#438
github-actions[bot] merged 4 commits intodevelopfrom
fix/backend-ci-native-go

Conversation

@nurockplayer
Copy link
Copy Markdown
Owner

@nurockplayer nurockplayer commented Apr 30, 2026

Summary

  • backend job removes artifact download / docker load and runs native Go tests with actions/setup-go@v6.
  • backend now runs go test ./... and go vet ./... from services/api.
  • backend-build keeps Docker build cache validation but removes image artifact export/upload roundtrip.
  • backend no longer depends on backend-build; backend-ci gate still depends on backend-build, backend, and backend-integration.
  • Workflow regression tests assert the native Go backend path and ensure CI workflow changes are not treated as metadata-only skips.
  • Backend CI wiring guard now validates the native-Go path and rejects the removed artifact roundtrip.

Source of truth:#437

Closes #437

Depends on PR:none

Backend contract already in develop:

  • yes
  • no

本 PR 明確不做

  • Does not change Go source code or runtime behavior.
  • Does not change Docker Compose runtime configuration.
  • Does not change backend-integration beyond staying aligned with the services/api service root from [backend] Move backend service into services/api #435.
  • Does not remove the backend Docker build job; it only removes the backend image artifact roundtrip.

Verification

  • bash scripts/check-backend-ci-cache.sh
  • node --test .github/workflows/ci.test.mjs — 10/10 passed
  • ruby -e "require 'yaml'; YAML.safe_load(File.read('.github/workflows/ci.yml'), permitted_classes: [], aliases: false); YAML.safe_load(File.read('.github/workflows/pr-scope-police.yml'), permitted_classes: [], aliases: false); puts 'yaml ok'"
  • go test ./... from services/api
  • go vet ./... from services/api
  • git diff --check

@github-actions github-actions Bot added the needs-codex-review New commits pushed after CHANGES_REQUESTED — pending Codex review label Apr 30, 2026
@github-actions github-actions Bot enabled auto-merge April 30, 2026 08:57
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

PR Scope Police

  • PASS: scope checks passed.

Snapshot

  • Mode: standard PR
  • Docs/template/metadata only: no
  • Changed files: 3
  • Diff lines (+/-): 75
  • Product surfaces: none
  • Dependency blocked: no
  • Auto-close triggered: no
  • Auto-close label: scope-violation
  • Dependency block label: blocked-by-dependency
  • Bypass label: scope-exception

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f2df75eed

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Walkthrough

CI 工作流程移除了後端 Docker image artifact 的上傳/下載環節,改為直接在 runner 上用原生 Go 工具執行測試與檢查。同時刪除 backendbackend-build 的依賴,讓兩者平行執行。相應更新了 CI 測試斷言。

Changes

Cohort / File(s) Summary
CI 工作流程簡化
.github/workflows/ci.yml
移除 backend-build 的 Docker image artifact 上傳、backend 的 artifact 下載和 docker load 步驟;改用 actions/setup-go 直接在 services/api 執行 go testgo vet;刪除 backendbackend-build 的依賴。
測試斷言更新
.github/workflows/ci.test.mjs
更新後端 job 斷言以驗證不含 docker loadactions/download-artifactbackend-image 字串,且 vet 步驟改為檢查新的 working-directory: services/api 與原生 Go 模式。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

needs-codex-review

Suggested reviewers

  • k49778749-stack
  • Erick52106

Poem

🐳 Docker 映像被丟棄,
工作流輕装上陣,
原生 Go 飛速跑過,
節省百秒測試時光——
平行、迅捷、向前衝!⚡

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR title clearly describes the main change: switching backend unit tests from Docker artifact roundtrip to native Go execution.
Linked Issues check ✅ Passed All coding requirements from issue #437 are fully implemented: native Go setup with setup-go, parallel execution via reduced dependencies, artifact steps removed from backend-build, and native go test/vet runs verified by tests.
Out of Scope Changes check ✅ Passed Changes are strictly scoped to CI workflow files and tests as specified in issue #437; no unrelated modifications to source code, Dockerfile, or other systems detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/backend-ci-native-go

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 and usage tips.

@nurockplayer nurockplayer requested a review from Erick52106 April 30, 2026 09:09
Copy link
Copy Markdown
Collaborator

@Erick52106 Erick52106 left a comment

Choose a reason for hiding this comment

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

Summary

先留一般 review comment,不提交 Change Request。

Blockers

  1. .github/workflows/ci.yml:257 / :260 / :264

backend job 指向 services/api/go.mod 並在 services/api 執行,但 PR head 上 services/api/go.mod 目前是 404;repo 目前存在的是 backend/go.mod。一旦 scope gate 放行 backend CI,actions/setup-go 或後續 working-directory 會直接失敗。建議改回 backend/go.mod / working-directory: backend,並同步修正 .github/workflows/ci.test.mjs 斷言。

  1. .github/workflows/ci.yml:351-376

這輪 checks 顯示 Backend testsBuild backend imageBackend integration tests 都是 SKIPPED,但 Backend CI (gate) 仍通過,因為 gate 接受 skipped。也就是說,PR 目前沒有實際驗證本次修改的 backend CI 路徑,也無法證明 issue #437 的「backend critical path 縮短」完成條件。建議先修 PR body / scope gate 條件讓 heavy CI 跑起來,再確認 backend jobs 真正成功。

Notes

actions/setup-go@v6 本身已發布,使用 ubuntu-latest GitHub-hosted runner 通常可接受;這點不是 blocker。

nurockplayer and others added 2 commits April 30, 2026 18:41
refs #437

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
refs #437

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nurockplayer nurockplayer force-pushed the fix/backend-ci-native-go branch from 8b0a9fb to d5da829 Compare April 30, 2026 09:42
refs #437

Co-Authored-By: Codex <codex[bot]@openai.com>
@nurockplayer nurockplayer force-pushed the fix/backend-ci-native-go branch from d5da829 to 366a37f Compare April 30, 2026 09:44
refs #437

Co-Authored-By: Codex <codex[bot]@openai.com>
@nurockplayer nurockplayer requested a review from Erick52106 April 30, 2026 10:06
Copy link
Copy Markdown
Collaborator

@Erick52106 Erick52106 left a comment

Choose a reason for hiding this comment

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

再審後確認上一輪兩個 blocker 都已解除:

  • services/api/go.mod 在 PR head 已存在,backend / backend-integration 改用 services/api 的路徑可以成立。
  • 最新 CI 已實際跑過並通過 Build backend imageBackend testsBackend integration testsCheck backend CI cache wiringWorkflow regression tests

沒有發現新的 blocker / major。建議 merge。

@github-actions github-actions Bot merged commit d9f8efe into develop Apr 30, 2026
19 checks passed
@nurockplayer nurockplayer deleted the fix/backend-ci-native-go branch May 3, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-codex-review New commits pushed after CHANGES_REQUESTED — pending Codex review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants