Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up for orch-446 after the effect-boundary refactor:
capture-all,resolve, andpsto per-command deps injection (removed globalgetAPIFunc)github.Clientinternal/testutilgenerated mocks importable as regular.gofilestestutil.TestHelperProcessforFakeExecutorWhat changed
1) Semgrep: broad raw exec rule
no-raw-exec-in-boundary-layersexec.Command(...)andexec.CommandContext(...)internal/daemon/,internal/cli/,internal/monitor/File:
.semgrep/architecture.yaml2) Generated mocks:
_test.go->.gogo:generateoutputs ininternal/testutil/generate.gointernal/testutil/mock_orchapi.gointernal/testutil/mock_store.gointernal/testutil/mock_multiplexer.gointernal/testutil/mock_git_runner.gointernal/testutil/mock_github_client.go3) CLI DI: removed global mutable API override
getAPIFuncfrominternal/cli/root.go...WithDepsexecution paths for:capture_all.go(captureDeps)resolve.go(resolveDeps)ps.go(psDeps)4) PR cache injectable public entrypoints
PopulateRunInfoWithClient(client github.Client, runs []*model.Run) InfoMapLookupInfoWithClient(client github.Client, repoRoot, branch string) (*Info, error)internal/pr/cache_test.go5)
computeBranchStatewrapper shared-runner pathcomputeBranchStatenow accepts optional runner variadicallyenrichRunProtonow takes runner and uses shareds.gitRunnerhandleProtoGetRunandhandleProtoGetRunByShortIDcallsites6) FakeExecutor helper
testutil.TestHelperProcess(t *testing.T)ininternal/testutil/fake_executor.goFakeExecutorAcceptance criteria verification
Semgrep catches raw
exec.Command/exec.CommandContextacross boundary layers with allowlist.semgrep/architecture.yamlmake lint=> pass (0 findings)Generated mocks are importable
.gofilesls -1 internal/testutil/mock_*.gogo build ./...=> passCLI commands use per-command deps structs and
getAPIFuncremovedrg -n "getAPIFunc" internal/cli -g'*.go'=> no matchescapture_all.go,resolve.go,ps.gopr/cache.gopublic functions accept injectablegithub.Clientinternal/pr/cache.gogo test ./internal/pr=> passcomputeBranchStateuses shared runner from caller contextenrichRunProto(..., runner)+ callsites passs.gitRunnercomputeBranchState(..., runner ...git.Runner)presentFakeExecutorincludes helper processinternal/testutil/fake_executor.gocontainsTestHelperProcessmake lintpassesmake lint=> pass (0 findings)go build ./...passesgo build ./...=> passgo test ./...passes (excluding known pre-existing failures)go test ./...currently fails in pre-existing/unrelated tests:internal/cli:TestBuildAgentPromptCustomTemplateinternal/cli:TestApplyConfigDefaultsFallbacksgo test ./internal/cli -run 'TestRunCaptureAllJSON|TestRunCaptureAllPlain|TestRunResolve|TestOutputTableTruncatesSummary|TestOutputTableUsesTopic|TestOutputTableTruncatesTopicChars|TestRunPsShowsAllIssuesByDefault|TestRunPsAllIncludesResolvedIssues'go test ./internal/prgo test ./internal/daemongo test ./internal/multiplexerIssue link