Skip to content

chore: remove test harness, docker and reflect2 from prod binaries - #1829

Merged
Thegaram merged 1 commit into
developfrom
chore/remove-test-code-from-binaries
Oct 27, 2026
Merged

Thegaram merged 1 commit into
developfrom
chore/remove-test-code-from-binaries

Conversation

@Thegaram

@Thegaram Thegaram commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Purpose or design rationale of this PR

Production binaries linked test-only code:

  • coordinator/cmd/api/app/mock_app.go lived in the coordinator API's production package, so coordinator_api linked testing, testcontainers, docker compose, containerd, buildkit, gRPC and OpenTelemetry. It now lives in coordinator/cmd, like rollup/cmd/mock_app.go. The integration test blank-imports coordinator/cmd/api/app to keep the coordinator-api-test registration.
  • common/utils and common/cmd used github.com/docker/docker/pkg/reexec, which pulled docker/docker into every binary. Replaced with github.com/moby/sys/reexec (same API).
  • utils.IsNil (using modern-go/reflect2) had one caller, on a pointer; replaced with != nil.

Result: coordinator_api 228 → 96 modules. No production binary links testing, testcontainers, docker/docker or reflect2. Reachable govulncheck findings 34 → 6, none new.

PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)

Deployment tag versioning

Has tag in common/version.go been updated or have you added bump-version label to this PR?

  • No, this PR doesn't involve a new deployment, git tag, docker image tag
  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change
  • Yes

Summary by CodeRabbit

  • Bug Fixes

    • Coordinator cleanup now handles an unset command without attempting to wait for a process that does not exist.
  • Chores

    • Updated internal process-launching components and dependencies.
    • Removed an internal nil-checking helper and adjusted the affected cleanup behavior.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 873678cc-403f-4741-bb48-4fbcdc07763d
Commits

Reviewing files that changed from the base of the PR and between f40edfd and 1e16ebe.

Files ignored due to path filters: 1
  • common/go.sum is excluded by !**/*.sum
Files selected for processing: 7
  • common/cmd/cmd.go
  • common/go.mod
  • common/utils/simulation.go
  • common/utils/utils.go
  • common/version/version.go
  • coordinator/cmd/mock_app.go
  • tests/integration-test/integration_test.go
Files with no reviewable changes: 1
  • common/utils/utils.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Walkthrough

The changes replace Docker’s re-exec imports with the Moby module, remove the exported IsNil helper and update its caller, and adjust the package version and integration test imports.

Changes: Common package and integration updates

Layer / File(s) Summary
Update re-exec imports
common/cmd/cmd.go, common/utils/simulation.go, common/go.mod
The command and simulation packages import reexec from github.com/moby/sys/reexec. The module adds that dependency directly.
Remove IsNil and update its caller
common/utils/utils.go, common/go.mod, coordinator/cmd/mock_app.go
The utils package removes IsNil and its reflect2 import. The module lists reflect2 as indirect. CoordinatorApp.Free checks whether Cmd is nil before calling WaitExit.
Update integration imports and version tag
tests/integration-test/integration_test.go, common/version/version.go
The integration test aliases the coordinator command package as capp and separately blank-imports the API app package. The version tag changes from v4.8.8 to v4.8.9.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: mask-pp, colinlyguo, 0xmountaintop

Merge Risk: Minimal · up to 1e16e

The changes preserve integration registration while keeping test-only dependencies out of the production API path.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title uses the conventional commit type "chore" and names the main change: removing the test harness, docker, and reflect2 from production binaries. The raw summary and objectives confirm that the…
Description check Passed The description covers the purpose, the rationale, and the approach. It explains why each change was made and how it was done, and it gives measurable results (module counts, govulncheck findings). It…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
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: Title check

Explanation

The title uses the conventional commit type "chore" and names the main change: removing the test harness, docker, and reflect2 from production binaries. The raw summary and objectives confirm that the changeset moves mock_app.go out of the coordinator API package, swaps the docker reexec import for moby/sys/reexec, and removes the reflect2-based IsNil helper. The title is clear and specific.

Full details: Description check

Explanation

The description covers the purpose, the rationale, and the approach. It explains why each change was made and how it was done, and it gives measurable results (module counts, govulncheck findings). It also fills in the deployment tag and breaking change sections. Two items are incomplete: the PR title section marks only the build type, which matches the title's chore prefix only loosely (the conventional-commit type is not checked as chore, and build is checked instead), and the description gives no test names or commands. The template's conventional commit type list does not include chore, so the title and the checked type disagree.

Resolution

Align the checked conventional commit type with the PR title. The title uses "chore", but the description checks "build". Either change the title type to "build" or check the type that matches the title. Optionally, list the test commands or results that verify the change.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 5 files. (1 skipped: 1 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov-commenter

codecov-commenter commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 30.71%. Comparing base (f40edfd) to head (1e16ebe).

Files with missing lines Patch % Lines
coordinator/cmd/mock_app.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1829   +/-   ##
========================================
  Coverage    30.71%   30.71%           
========================================
  Files          263      263           
  Lines        22827    22825    -2     
========================================
  Hits          7011     7011           
+ Misses       15127    15125    -2     
  Partials       689      689           
Flag Coverage Δ
common 31.47% <ø> (+0.04%) ⬆️
coordinator 7.29% <0.00%> (ø)
database 36.24% <ø> (ø)
rollup 34.84% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Thegaram
Thegaram merged commit d0a7719 into develop Oct 27, 2026
15 checks passed
@Thegaram
Thegaram deleted the chore/remove-test-code-from-binaries branch October 27, 2026 15:54
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