-
-
Notifications
You must be signed in to change notification settings - Fork 135
Update mockgen to go.uber.org/mock #1681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughReplace usages of the archived github.com/golang/mock with go.uber.org/mock across the repo: update .golangci.yml forbidigo rule, swap gomock import paths, change //go:generate directives to run Uber's mockgen, update go.mod, and regenerate many mock files (adding unexported isgomock fields and replacing recorder parameter types from interface{} to any). Changes
Sequence Diagram(s)(omitted — changes are build/config and generated mocks; no runtime control-flow alterations) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
pkg/validator/schema_validator_test.go (1)
76-81: Test scenario not exercising schema fetch error.Case "Schema fetch error" sets fetcherErr but never configures the mock to return it; defaults return (nil, nil). Configure an expectation to return the error so the test matches its name.
{ name: "Schema fetch error", schemaSource: "schema.json", yamlSource: "data.yaml", - fetcherErr: ErrFailedToFetchSchema, - wantErr: true, + fetcherErr: ErrFailedToFetchSchema, + wantErr: true, + setMockExpect: func(mockFetcher *datafetcher.MockDataFetcher) { + // YAML fetch succeeds (minimal input), schema fetch fails. + mockFetcher.EXPECT().GetData("data.yaml").Return([]byte("name: test"), nil) + mockFetcher.EXPECT().GetData("schema.json").Return(nil, ErrFailedToFetchSchema) + }, },pkg/filematch/mock_interface.go (1)
95-132: Update mock type references in test file; rename incomplete.The old mock type name
MockFileMatcherInterfaceis still referenced ininternal/exec/validate_schema_test.go(lines 105, 112, 122). Rename these toMockFileMatcherto match the changes inpkg/filematch/mock_interface.go.
🧹 Nitpick comments (12)
pkg/list/list_instances_upload_test.go (1)
7-9: Migration to go.uber.org/mock looks good.The import path change correctly migrates from the archived golang/mock to the maintained uber fork. The gomock API remains compatible throughout the file.
Minor: The third-party imports could be alphabetically sorted (go.uber.org should come after github.com/stretchr). As per coding guidelines, imports should be sorted alphabetically within each group.
git "github.com/go-git/go-git/v5" - "go.uber.org/mock/gomock" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock"pkg/config/interface.go (1)
10-10: Pin mockgen version for reproducible codegen.Using @latest can churn diffs and break CI when mockgen output changes. Recommend pinning to a known good tag (e.g., v0.6.0) and updating intentionally.
Based on learnings.
-//go:generate go run go.uber.org/mock/mockgen@latest -source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGEpkg/filesystem/homedir.go (1)
9-9: Pin mockgen version for reproducible mocks.Using @latest can cause diff churn across machines/CI. Pin to a known version (e.g., v0.6.0).
Based on learnings.
-//go:generate go run go.uber.org/mock/mockgen@latest -source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGECLAUDE.md (1)
321-332: Doc examples: prefer pinning mockgen version.Use a fixed version in examples to avoid churn and flaky diffs in CI.
Based on learnings.
-//go:generate go run go.uber.org/mock/mockgen@latest -package=yourpkg -destination=mock_interface_test.go github.com/external/package InterfaceName +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -package=yourpkg -destination=mock_interface_test.go github.com/external/package InterfaceName-//go:generate go run go.uber.org/mock/mockgen@latest -source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGEinternal/exec/mock_describe_dependents.go (1)
3-7: Generated mock updated for Uber gomock; suggest pinning generator for reproducibility.
- Import switched to go.uber.org/mock/gomock and recorder uses any — expected with Uber mockgen. LGTM.
- Recommend pinning the generator instead of @latest in go:generate to avoid CI churn from upstream releases.
-// mockgen -source=describe_dependents.go -destination=mock_describe_dependents.go -package=exec +// go run go.uber.org/mock/mockgen@v0.6.0 -source=describe_dependents.go -destination=mock_describe_dependents.go -package=execAlso applies to: 15-16, 22-22, 51-54
pkg/filesystem/mock_homedir.go (1)
3-7: Uber gomock migration looks correct; consider pinning mockgen.Changes align with regenerated output (isgomock marker, any in recorder). Recommend pinning generator for stable diffs.
-// mockgen -source=homedir.go -destination=mock_homedir.go -package=filesystem +// go run go.uber.org/mock/mockgen@v0.6.0 -source=homedir.go -destination=mock_homedir.go -package=filesystemAlso applies to: 15-16, 22-22, 67-70
pkg/pro/mock_interface.go (1)
3-7: Uber gomock regeneration is consistent; consider pinning generator.All updates align with Uber mockgen. Recommend pinning mockgen for reproducibility.
Also applies to: 17-18, 24-24, 53-56, 62-62, 92-95
pkg/filesystem/mock_interface.go (1)
3-7: Large mock regen diff is expected; minor suggestion.Migration to go.uber.org/mock and any-typed recorders look good. Consider pinning mockgen for stable outputs.
Also applies to: 18-19, 25-25, 55-57, 69-72, 84-87, 113-116, 128-131, 143-146, 158-161, 172-175, 186-189, 201-204, 215-218, 229-232, 239-239, 268-271, 283-286, 292-292, 322-325
pkg/datafetcher/fetch_schema.go (1)
19-19: Pin mockgen version for deterministic builds.Using
@latestcauses mock output to drift between runs. Pin to a specific version (e.g., v0.6.0) to ensure reproducible builds.-//go:generate go run go.uber.org/mock/mockgen@latest -source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGENote: golangci-lint is already configured with
generated: lax, so generated mock files are properly exempted from strict linting rules like godot.pkg/git/mock_interface.go (1)
3-7: Pin mockgen and exclude generated mocks from godot lints.The codebase currently uses
mockgen@latest(unpinned) inpkg/git/interface.go:10. Recommend pinning to a specific version (e.g.,@v0.6.0) per coding guidelines.Additionally,
.golangci.ymlenforces godot period termination but has no exclusions for mock files. Generated code from mockgen may not pass godot checks. Addmock_*.goexclusion patterns to thegodotlinter config to prevent false positives on generated files.pkg/filematch/interface.go (2)
16-16: Pin mockgen version for reproducible builds.Using @latest can cause churn across machines/CI. Pin to a known version (e.g., v0.6.0) or your repo’s chosen pin.
-//go:generate go run go.uber.org/mock/mockgen@latest -source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE +//go:generate go run go.uber.org/mock/mockgen@v0.6.0 -source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGEBased on learnings.
16-16: Optional: move go:generate to tests/tools.Consider placing //go:generate in a test file (or tools.go) to keep prod sources minimal and follow the project’s mockgen placement convention.
Based on learnings.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (65)
.golangci.yml(1 hunks)CLAUDE.md(2 hunks)cmd/describe_affected_test.go(1 hunks)cmd/describe_dependents_test.go(1 hunks)cmd/describe_stacks_test.go(1 hunks)cmd/describe_workflows_test.go(1 hunks)go.mod(1 hunks)internal/exec/copy_glob_error_paths_test.go(1 hunks)internal/exec/describe_affected.go(1 hunks)internal/exec/describe_affected_test.go(1 hunks)internal/exec/describe_affected_utils_test.go(1 hunks)internal/exec/describe_component_test.go(1 hunks)internal/exec/describe_config_test.go(1 hunks)internal/exec/describe_dependents.go(1 hunks)internal/exec/describe_dependents_test.go(1 hunks)internal/exec/describe_stacks.go(1 hunks)internal/exec/describe_stacks_test.go(1 hunks)internal/exec/describe_workflows.go(1 hunks)internal/exec/mock_describe_affected.go(2 hunks)internal/exec/mock_describe_dependents.go(2 hunks)internal/exec/mock_describe_stacks.go(3 hunks)internal/exec/mock_describe_workflows.go(3 hunks)internal/exec/mock_stacks_processor.go(3 hunks)internal/exec/mock_storer_test.go(15 hunks)internal/exec/mock_version_test.go(4 hunks)internal/exec/oci_utils_test.go(1 hunks)internal/exec/stacks_processor.go(1 hunks)internal/exec/validate_schema_test.go(1 hunks)internal/exec/version_test.go(1 hunks)internal/tui/templates/term/mock_term_writer.go(1 hunks)internal/tui/templates/term/term_writer.go(1 hunks)pkg/config/imports_error_paths_test.go(1 hunks)pkg/config/interface.go(1 hunks)pkg/config/load_error_paths_test.go(1 hunks)pkg/config/mock_interface.go(3 hunks)pkg/datafetcher/fetch_schema.go(1 hunks)pkg/datafetcher/mock_fetch_schema.go(4 hunks)pkg/downloader/file_downloader_interface.go(2 hunks)pkg/downloader/file_downloader_test.go(1 hunks)pkg/downloader/mock_file_downloader_interface.go(10 hunks)pkg/filematch/interface.go(1 hunks)pkg/filematch/mock_interface.go(5 hunks)pkg/filesystem/homedir.go(1 hunks)pkg/filesystem/interface.go(3 hunks)pkg/filesystem/mock_homedir.go(2 hunks)pkg/filesystem/mock_interface.go(19 hunks)pkg/git/interface.go(1 hunks)pkg/git/mock_interface.go(4 hunks)pkg/list/list_instances_process_test.go(1 hunks)pkg/list/list_instances_upload_test.go(1 hunks)pkg/pager/mock_pager.go(2 hunks)pkg/pager/pager.go(1 hunks)pkg/pro/interface.go(1 hunks)pkg/pro/mock_interface.go(5 hunks)pkg/telemetry/mock/mock_posthog_client.go(1 hunks)pkg/telemetry/mock/mock_telemetry_provider.go(1 hunks)pkg/telemetry/telemetry_logger_selection_test.go(1 hunks)pkg/telemetry/telemetry_test.go(1 hunks)pkg/telemetry/utils_test.go(1 hunks)pkg/validator/mock_schema_validator.go(2 hunks)pkg/validator/schema_validator.go(1 hunks)pkg/validator/schema_validator_test.go(1 hunks)tests/testhelpers/README.md(1 hunks)tests/testhelpers/filesystem.go(1 hunks)tests/testhelpers/filesystem_test.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (14)
**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments
**/*.go: All comments must end with periods; enforced by golangci-lint godot across all Go comments.
Organize imports into three groups (stdlib, third-party, Atmos) separated by blank lines and sorted alphabetically within each group; keep existing aliases.
All errors must be wrapped using static errors defined in errors/errors.go; prefer errors.Join for multiple, fmt.Errorf with %w for context, and errors.Is for checks; never rely on string comparisons.
Prefer cross-platform implementations: use SDKs over external binaries; use filepath/os facilities; gate OS-specific logic with runtime.GOOS or build tags.
Files:
internal/tui/templates/term/mock_term_writer.gointernal/exec/describe_dependents_test.gointernal/exec/describe_stacks.gopkg/config/imports_error_paths_test.gointernal/tui/templates/term/term_writer.gopkg/config/interface.gopkg/git/interface.gointernal/exec/version_test.gocmd/describe_dependents_test.gointernal/exec/describe_workflows.gointernal/exec/stacks_processor.gocmd/describe_stacks_test.gointernal/exec/describe_config_test.gopkg/filesystem/interface.gointernal/exec/oci_utils_test.gotests/testhelpers/filesystem_test.gopkg/telemetry/telemetry_logger_selection_test.gopkg/filematch/interface.gopkg/filesystem/homedir.gocmd/describe_affected_test.gopkg/downloader/file_downloader_interface.gointernal/exec/mock_describe_affected.gointernal/exec/copy_glob_error_paths_test.gointernal/exec/mock_describe_dependents.gointernal/exec/describe_affected_utils_test.gopkg/downloader/file_downloader_test.gointernal/exec/validate_schema_test.gointernal/exec/mock_stacks_processor.gointernal/exec/mock_describe_stacks.gointernal/exec/mock_describe_workflows.gopkg/telemetry/telemetry_test.gopkg/validator/schema_validator.gointernal/exec/describe_affected_test.gointernal/exec/describe_stacks_test.gopkg/telemetry/mock/mock_posthog_client.gotests/testhelpers/filesystem.gocmd/describe_workflows_test.gointernal/exec/mock_version_test.gopkg/telemetry/utils_test.gopkg/config/mock_interface.gopkg/validator/mock_schema_validator.gopkg/datafetcher/fetch_schema.gopkg/telemetry/mock/mock_telemetry_provider.gointernal/exec/describe_component_test.gopkg/pager/pager.gopkg/list/list_instances_process_test.gointernal/exec/describe_dependents.gopkg/config/load_error_paths_test.gopkg/validator/schema_validator_test.gointernal/exec/describe_affected.gopkg/list/list_instances_upload_test.gopkg/pro/interface.gopkg/pro/mock_interface.gopkg/filesystem/mock_homedir.gopkg/pager/mock_pager.gopkg/datafetcher/mock_fetch_schema.gopkg/downloader/mock_file_downloader_interface.gopkg/git/mock_interface.gopkg/filesystem/mock_interface.gopkg/filematch/mock_interface.gointernal/exec/mock_storer_test.go
**/!(*_test).go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Document all exported functions, types, and methods with Go doc comments
Files:
internal/tui/templates/term/mock_term_writer.gointernal/exec/describe_stacks.gointernal/tui/templates/term/term_writer.gopkg/config/interface.gopkg/git/interface.gointernal/exec/describe_workflows.gointernal/exec/stacks_processor.gopkg/filesystem/interface.gopkg/filematch/interface.gopkg/filesystem/homedir.gopkg/downloader/file_downloader_interface.gointernal/exec/mock_describe_affected.gointernal/exec/mock_describe_dependents.gointernal/exec/mock_stacks_processor.gointernal/exec/mock_describe_stacks.gointernal/exec/mock_describe_workflows.gopkg/validator/schema_validator.gopkg/telemetry/mock/mock_posthog_client.gotests/testhelpers/filesystem.gopkg/config/mock_interface.gopkg/validator/mock_schema_validator.gopkg/datafetcher/fetch_schema.gopkg/telemetry/mock/mock_telemetry_provider.gopkg/pager/pager.gointernal/exec/describe_dependents.gointernal/exec/describe_affected.gopkg/pro/interface.gopkg/pro/mock_interface.gopkg/filesystem/mock_homedir.gopkg/pager/mock_pager.gopkg/datafetcher/mock_fetch_schema.gopkg/downloader/mock_file_downloader_interface.gopkg/git/mock_interface.gopkg/filesystem/mock_interface.gopkg/filematch/mock_interface.go
{cmd,internal,pkg}/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
{cmd,internal,pkg}/**/*.go: Adddefer perf.Track()to all public functions and critical private ones, include a blank line after it, and use package-qualified names (e.g., "exec.ProcessComponent"). Use atmosConfig if available, else nil.
Always bind environment variables with viper.BindEnv; every var must have an ATMOS_ alternative and prefer ATMOS_ over external names.
Distinguish structured logging from UI output: UI prompts/errors/status to stderr; data/results to stdout; logging for system/debug only; no UI via logging.
Most text UI must go to stderr (via utils.PrintfMessageToTUI or fmt.Fprintf(os.Stderr,...)); only data/results to stdout.
Files:
internal/tui/templates/term/mock_term_writer.gointernal/exec/describe_dependents_test.gointernal/exec/describe_stacks.gopkg/config/imports_error_paths_test.gointernal/tui/templates/term/term_writer.gopkg/config/interface.gopkg/git/interface.gointernal/exec/version_test.gocmd/describe_dependents_test.gointernal/exec/describe_workflows.gointernal/exec/stacks_processor.gocmd/describe_stacks_test.gointernal/exec/describe_config_test.gopkg/filesystem/interface.gointernal/exec/oci_utils_test.gopkg/telemetry/telemetry_logger_selection_test.gopkg/filematch/interface.gopkg/filesystem/homedir.gocmd/describe_affected_test.gopkg/downloader/file_downloader_interface.gointernal/exec/mock_describe_affected.gointernal/exec/copy_glob_error_paths_test.gointernal/exec/mock_describe_dependents.gointernal/exec/describe_affected_utils_test.gopkg/downloader/file_downloader_test.gointernal/exec/validate_schema_test.gointernal/exec/mock_stacks_processor.gointernal/exec/mock_describe_stacks.gointernal/exec/mock_describe_workflows.gopkg/telemetry/telemetry_test.gopkg/validator/schema_validator.gointernal/exec/describe_affected_test.gointernal/exec/describe_stacks_test.gopkg/telemetry/mock/mock_posthog_client.gocmd/describe_workflows_test.gointernal/exec/mock_version_test.gopkg/telemetry/utils_test.gopkg/config/mock_interface.gopkg/validator/mock_schema_validator.gopkg/datafetcher/fetch_schema.gopkg/telemetry/mock/mock_telemetry_provider.gointernal/exec/describe_component_test.gopkg/pager/pager.gopkg/list/list_instances_process_test.gointernal/exec/describe_dependents.gopkg/config/load_error_paths_test.gopkg/validator/schema_validator_test.gointernal/exec/describe_affected.gopkg/list/list_instances_upload_test.gopkg/pro/interface.gopkg/pro/mock_interface.gopkg/filesystem/mock_homedir.gopkg/pager/mock_pager.gopkg/datafetcher/mock_fetch_schema.gopkg/downloader/mock_file_downloader_interface.gopkg/git/mock_interface.gopkg/filesystem/mock_interface.gopkg/filematch/mock_interface.gointernal/exec/mock_storer_test.go
{pkg,internal,cmd}/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
Always use mockgen for interface mocks; never write manual mocks with many stub methods.
Files:
internal/tui/templates/term/mock_term_writer.gointernal/exec/describe_dependents_test.gointernal/exec/describe_stacks.gopkg/config/imports_error_paths_test.gointernal/tui/templates/term/term_writer.gopkg/config/interface.gopkg/git/interface.gointernal/exec/version_test.gocmd/describe_dependents_test.gointernal/exec/describe_workflows.gointernal/exec/stacks_processor.gocmd/describe_stacks_test.gointernal/exec/describe_config_test.gopkg/filesystem/interface.gointernal/exec/oci_utils_test.gopkg/telemetry/telemetry_logger_selection_test.gopkg/filematch/interface.gopkg/filesystem/homedir.gocmd/describe_affected_test.gopkg/downloader/file_downloader_interface.gointernal/exec/mock_describe_affected.gointernal/exec/copy_glob_error_paths_test.gointernal/exec/mock_describe_dependents.gointernal/exec/describe_affected_utils_test.gopkg/downloader/file_downloader_test.gointernal/exec/validate_schema_test.gointernal/exec/mock_stacks_processor.gointernal/exec/mock_describe_stacks.gointernal/exec/mock_describe_workflows.gopkg/telemetry/telemetry_test.gopkg/validator/schema_validator.gointernal/exec/describe_affected_test.gointernal/exec/describe_stacks_test.gopkg/telemetry/mock/mock_posthog_client.gocmd/describe_workflows_test.gointernal/exec/mock_version_test.gopkg/telemetry/utils_test.gopkg/config/mock_interface.gopkg/validator/mock_schema_validator.gopkg/datafetcher/fetch_schema.gopkg/telemetry/mock/mock_telemetry_provider.gointernal/exec/describe_component_test.gopkg/pager/pager.gopkg/list/list_instances_process_test.gointernal/exec/describe_dependents.gopkg/config/load_error_paths_test.gopkg/validator/schema_validator_test.gointernal/exec/describe_affected.gopkg/list/list_instances_upload_test.gopkg/pro/interface.gopkg/pro/mock_interface.gopkg/filesystem/mock_homedir.gopkg/pager/mock_pager.gopkg/datafetcher/mock_fetch_schema.gopkg/downloader/mock_file_downloader_interface.gopkg/git/mock_interface.gopkg/filesystem/mock_interface.gopkg/filematch/mock_interface.gointernal/exec/mock_storer_test.go
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Target minimum 80% coverage on new/changed lines; exclude mock files from coverage: **/mock_.go, mock_.go, **/mock/*.go.
Files:
internal/tui/templates/term/mock_term_writer.gointernal/exec/describe_dependents_test.gointernal/exec/describe_stacks.gopkg/config/imports_error_paths_test.gointernal/tui/templates/term/term_writer.gopkg/config/interface.gopkg/git/interface.gointernal/exec/version_test.gocmd/describe_dependents_test.gointernal/exec/describe_workflows.gointernal/exec/stacks_processor.gocmd/describe_stacks_test.gointernal/exec/describe_config_test.gopkg/filesystem/interface.gointernal/exec/oci_utils_test.gotests/testhelpers/filesystem_test.gopkg/telemetry/telemetry_logger_selection_test.gopkg/filematch/interface.gopkg/filesystem/homedir.gocmd/describe_affected_test.gopkg/downloader/file_downloader_interface.gointernal/exec/mock_describe_affected.gointernal/exec/copy_glob_error_paths_test.gointernal/exec/mock_describe_dependents.gointernal/exec/describe_affected_utils_test.gopkg/downloader/file_downloader_test.gointernal/exec/validate_schema_test.gointernal/exec/mock_stacks_processor.gointernal/exec/mock_describe_stacks.gointernal/exec/mock_describe_workflows.gopkg/telemetry/telemetry_test.gopkg/validator/schema_validator.gointernal/exec/describe_affected_test.gointernal/exec/describe_stacks_test.gopkg/telemetry/mock/mock_posthog_client.gotests/testhelpers/filesystem.gocmd/describe_workflows_test.gointernal/exec/mock_version_test.gopkg/telemetry/utils_test.gopkg/config/mock_interface.gopkg/validator/mock_schema_validator.gopkg/datafetcher/fetch_schema.gopkg/telemetry/mock/mock_telemetry_provider.gointernal/exec/describe_component_test.gopkg/pager/pager.gopkg/list/list_instances_process_test.gointernal/exec/describe_dependents.gogo.modCLAUDE.mdpkg/config/load_error_paths_test.gopkg/validator/schema_validator_test.gointernal/exec/describe_affected.gopkg/list/list_instances_upload_test.gopkg/pro/interface.gopkg/pro/mock_interface.gopkg/filesystem/mock_homedir.gopkg/pager/mock_pager.gopkg/datafetcher/mock_fetch_schema.gotests/testhelpers/README.mdpkg/downloader/mock_file_downloader_interface.gopkg/git/mock_interface.gopkg/filesystem/mock_interface.gopkg/filematch/mock_interface.gointernal/exec/mock_storer_test.go
**/*_test.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*_test.go: Every new feature must include comprehensive unit tests
Test both happy paths and error conditions
Use table-driven tests for multiple scenarios
**/*_test.go: Unit tests should be table-driven where appropriate and focus on pure functions; target >80% coverage with emphasis on pkg/ and internal/exec/.
Test behavior, not implementation; avoid tautological or stub-only tests; use dependency injection to make code testable; remove always-skipped tests; table-driven tests must use realistic scenarios.
Place//go:generate mockgendirectives for mocks at the top of test files; for internal interfaces use-source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE.
Tests must call production code paths (do not duplicate production logic within tests).
Always use t.Skipf with a reason (never t.Skip or Skipf without context).
Test files should mirror implementation structure and be co-located with source files (foo.go ↔ foo_test.go).
Use precondition-based test skipping helpers from tests/test_preconditions.go (e.g., RequireAWSProfile, RequireGitHubAccess).
Files:
internal/exec/describe_dependents_test.gopkg/config/imports_error_paths_test.gointernal/exec/version_test.gocmd/describe_dependents_test.gocmd/describe_stacks_test.gointernal/exec/describe_config_test.gointernal/exec/oci_utils_test.gotests/testhelpers/filesystem_test.gopkg/telemetry/telemetry_logger_selection_test.gocmd/describe_affected_test.gointernal/exec/copy_glob_error_paths_test.gointernal/exec/describe_affected_utils_test.gopkg/downloader/file_downloader_test.gointernal/exec/validate_schema_test.gopkg/telemetry/telemetry_test.gointernal/exec/describe_affected_test.gointernal/exec/describe_stacks_test.gocmd/describe_workflows_test.gointernal/exec/mock_version_test.gopkg/telemetry/utils_test.gointernal/exec/describe_component_test.gopkg/list/list_instances_process_test.gopkg/config/load_error_paths_test.gopkg/validator/schema_validator_test.gopkg/list/list_instances_upload_test.gointernal/exec/mock_storer_test.go
pkg/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Place business logic in pkg rather than in cmd
Files:
pkg/config/imports_error_paths_test.gopkg/config/interface.gopkg/git/interface.gopkg/filesystem/interface.gopkg/telemetry/telemetry_logger_selection_test.gopkg/filematch/interface.gopkg/filesystem/homedir.gopkg/downloader/file_downloader_interface.gopkg/downloader/file_downloader_test.gopkg/telemetry/telemetry_test.gopkg/validator/schema_validator.gopkg/telemetry/mock/mock_posthog_client.gopkg/telemetry/utils_test.gopkg/config/mock_interface.gopkg/validator/mock_schema_validator.gopkg/datafetcher/fetch_schema.gopkg/telemetry/mock/mock_telemetry_provider.gopkg/pager/pager.gopkg/list/list_instances_process_test.gopkg/config/load_error_paths_test.gopkg/validator/schema_validator_test.gopkg/list/list_instances_upload_test.gopkg/pro/interface.gopkg/pro/mock_interface.gopkg/filesystem/mock_homedir.gopkg/pager/mock_pager.gopkg/datafetcher/mock_fetch_schema.gopkg/downloader/mock_file_downloader_interface.gopkg/git/mock_interface.gopkg/filesystem/mock_interface.gopkg/filematch/mock_interface.go
pkg/config/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
Use Viper for configuration loading with precedence (CLI→ENV→files→defaults) and the shown setup snippet (SetConfigName, AddConfigPath, AutomaticEnv, SetEnvPrefix).
Files:
pkg/config/imports_error_paths_test.gopkg/config/interface.gopkg/config/mock_interface.gopkg/config/load_error_paths_test.go
pkg/{,**/}**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Unit tests should primarily cover pkg/ code; ensure meaningful coverage with real scenarios (not coverage theater).
Files:
pkg/config/imports_error_paths_test.gopkg/telemetry/telemetry_logger_selection_test.gopkg/downloader/file_downloader_test.gopkg/telemetry/telemetry_test.gopkg/telemetry/utils_test.gopkg/list/list_instances_process_test.gopkg/config/load_error_paths_test.gopkg/validator/schema_validator_test.gopkg/list/list_instances_upload_test.go
cmd/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
cmd/**/*.go: Use Cobra's recommended command structure with a root command and subcommands
Implement each CLI command in a separate file under cmd/
Use Viper for managing configuration, environment variables, and flags in the CLI
Keep separation of concerns between CLI interface (cmd) and business logic
Use kebab-case for command-line flags
Provide comprehensive help text for all commands and flags
Include examples in Cobra command help
Use Viper for configuration management; support files, env vars, and flags with precedence flags > env > config > defaults
Follow single responsibility; separate command interface from business logic
Provide meaningful user feedback and include progress indicators for long-running operations
Provide clear error messages to users and troubleshooting hints where appropriate
cmd/**/*.go: Follow Cobra command pattern: one command per file; load examples via //go:embed and render via utils.PrintfMarkdown in RunE.
Telemetry for new commands is automatic via RootCmd.ExecuteC(); for non-standard paths use telemetry.CaptureCmd or telemetry.CaptureCmdString.
Files:
cmd/describe_dependents_test.gocmd/describe_stacks_test.gocmd/describe_affected_test.gocmd/describe_workflows_test.go
cmd/**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
cmd/**/*_test.go: Always use cmd.NewTestKit(t) in ALL cmd package tests, including subtests, to snapshot and restore RootCmd state.
Command tests live under cmd/ and must use temporary binaries when needed; TestMain must call os.Exit(m.Run()) to propagate exit code.
Files:
cmd/describe_dependents_test.gocmd/describe_stacks_test.gocmd/describe_affected_test.gocmd/describe_workflows_test.go
tests/**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Integration tests live under tests/ with fixtures in tests/test-cases/.
Files:
tests/testhelpers/filesystem_test.go
.golangci.yml
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Configure golangci-lint with gofmt, goimports, govet, staticcheck, errcheck, ineffassign, misspell, unused, revive, gocritic enabled
Files:
.golangci.yml
go.{mod,sum}
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
go.{mod,sum}: Manage dependencies with Go modules
Keep dependencies up to date
Files:
go.mod
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to pkg/store/**/mock_*.go : Generate mocks for all store interfaces using mockgen (via //go:generate) rather than manual implementations.
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to {pkg,internal,cmd}/**/*.go : Always use mockgen for interface mocks; never write manual mocks with many stub methods.
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/*_test.go : Place `//go:generate mockgen` directives for mocks at the top of test files; for internal interfaces use `-source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE`.
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to pkg/store/**/mock_*.go : Generate mocks for all store interfaces using mockgen (via //go:generate) rather than manual implementations.
Applied to files:
internal/exec/describe_stacks.gointernal/tui/templates/term/term_writer.gopkg/config/interface.gopkg/git/interface.gointernal/exec/version_test.gointernal/exec/describe_workflows.gointernal/exec/stacks_processor.gopkg/filesystem/interface.gotests/testhelpers/filesystem_test.gopkg/filematch/interface.gopkg/filesystem/homedir.gopkg/downloader/file_downloader_interface.gointernal/exec/describe_affected_utils_test.gopkg/downloader/file_downloader_test.gopkg/validator/schema_validator.gopkg/telemetry/mock/mock_posthog_client.gotests/testhelpers/filesystem.gointernal/exec/mock_version_test.gopkg/telemetry/utils_test.gopkg/config/mock_interface.gopkg/datafetcher/fetch_schema.gopkg/telemetry/mock/mock_telemetry_provider.gopkg/pager/pager.gointernal/exec/describe_dependents.goCLAUDE.mdpkg/validator/schema_validator_test.gopkg/list/list_instances_upload_test.gopkg/pro/interface.gopkg/pro/mock_interface.gopkg/filesystem/mock_homedir.gopkg/pager/mock_pager.gopkg/datafetcher/mock_fetch_schema.gopkg/downloader/mock_file_downloader_interface.gopkg/git/mock_interface.gopkg/filesystem/mock_interface.gopkg/filematch/mock_interface.gointernal/exec/mock_storer_test.go
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/*_test.go : Place `//go:generate mockgen` directives for mocks at the top of test files; for internal interfaces use `-source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE`.
Applied to files:
internal/exec/describe_stacks.gointernal/tui/templates/term/term_writer.gopkg/config/interface.gopkg/git/interface.gointernal/exec/version_test.gointernal/exec/stacks_processor.gopkg/filesystem/interface.gotests/testhelpers/filesystem_test.gopkg/filematch/interface.gopkg/filesystem/homedir.gopkg/downloader/file_downloader_interface.gointernal/exec/describe_affected_utils_test.gopkg/validator/schema_validator.gotests/testhelpers/filesystem.gopkg/telemetry/utils_test.gopkg/config/mock_interface.gopkg/datafetcher/fetch_schema.gopkg/pager/pager.gointernal/exec/describe_dependents.goCLAUDE.mdpkg/validator/schema_validator_test.gopkg/pro/interface.gopkg/filematch/mock_interface.go
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to {pkg,internal,cmd}/**/*.go : Always use mockgen for interface mocks; never write manual mocks with many stub methods.
Applied to files:
internal/exec/describe_stacks.gointernal/tui/templates/term/term_writer.gopkg/config/interface.gopkg/git/interface.gointernal/exec/version_test.gointernal/exec/stacks_processor.gopkg/filesystem/interface.gopkg/filematch/interface.gopkg/filesystem/homedir.gocmd/describe_affected_test.gopkg/downloader/file_downloader_interface.gointernal/exec/describe_affected_utils_test.gopkg/validator/schema_validator.gopkg/telemetry/mock/mock_posthog_client.gotests/testhelpers/filesystem.gointernal/exec/mock_version_test.gopkg/config/mock_interface.gopkg/datafetcher/fetch_schema.go.golangci.ymlpkg/telemetry/mock/mock_telemetry_provider.gopkg/pager/pager.gointernal/exec/describe_dependents.goCLAUDE.mdpkg/validator/schema_validator_test.gopkg/list/list_instances_upload_test.gopkg/pro/interface.gopkg/pro/mock_interface.go
📚 Learning: 2024-11-13T21:37:07.852Z
Learnt from: Cerebrovinny
PR: cloudposse/atmos#764
File: internal/exec/describe_stacks.go:289-295
Timestamp: 2024-11-13T21:37:07.852Z
Learning: In the `internal/exec/describe_stacks.go` file of the `atmos` project written in Go, avoid extracting the stack name handling logic into a helper function within the `ExecuteDescribeStacks` method, even if the logic appears duplicated.
Applied to files:
internal/exec/describe_stacks.go
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
PR: cloudposse/atmos#0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Consider using testify/mock for creating mock implementations
Applied to files:
internal/exec/copy_glob_error_paths_test.goCLAUDE.mdtests/testhelpers/README.md
📚 Learning: 2025-07-05T20:59:02.914Z
Learnt from: aknysh
PR: cloudposse/atmos#1363
File: internal/exec/template_utils.go:18-18
Timestamp: 2025-07-05T20:59:02.914Z
Learning: In the Atmos project, gomplate v4 is imported with a blank import (`_ "github.com/hairyhenderson/gomplate/v4"`) alongside v3 imports to resolve AWS SDK version conflicts. V3 uses older AWS SDK versions that conflict with newer AWS modules used by Atmos. A full migration to v4 requires extensive refactoring due to API changes and should be handled in a separate PR.
Applied to files:
internal/exec/validate_schema_test.go
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/*_test.go : Tests must call production code paths (do not duplicate production logic within tests).
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/*_test.go : Test behavior, not implementation; avoid tautological or stub-only tests; use dependency injection to make code testable; remove always-skipped tests; table-driven tests must use realistic scenarios.
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/*_test.go : Unit tests should be table-driven where appropriate and focus on pure functions; target >80% coverage with emphasis on pkg/ and internal/exec/.
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to pkg/{,**/}**/*_test.go : Unit tests should primarily cover pkg/ code; ensure meaningful coverage with real scenarios (not coverage theater).
Applied to files:
CLAUDE.md
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
PR: cloudposse/atmos#0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to **/*_test.go : Test both happy paths and error conditions
Applied to files:
CLAUDE.md
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
PR: cloudposse/atmos#0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to **/*_test.go : Every new feature must include comprehensive unit tests
Applied to files:
CLAUDE.md
🧬 Code graph analysis (7)
internal/exec/mock_version_test.go (3)
pkg/utils/log_utils.go (1)
PrintMessage(21-23)pkg/utils/version_utils.go (1)
PrintMessageToUpgradeToAtmosLatestRelease(15-44)internal/tui/utils/utils.go (1)
PrintStyledText(32-38)
pkg/config/mock_interface.go (1)
pkg/config/config.go (1)
InitCliConfig(25-62)
pkg/pro/mock_interface.go (1)
pkg/downloader/mock_file_downloader_interface.go (1)
MockClientFactoryMockRecorder(126-128)
pkg/filesystem/mock_homedir.go (1)
pkg/config/homedir/homedir.go (1)
Expand(68-87)
pkg/downloader/mock_file_downloader_interface.go (1)
pkg/pro/mock_interface.go (1)
MockClientFactoryMockRecorder(66-68)
pkg/git/mock_interface.go (1)
pkg/git/git.go (3)
GetLocalRepo(14-26)GetRepoInfo(60-110)RepoInfo(50-58)
pkg/filesystem/mock_interface.go (1)
pkg/utils/glob_utils.go (2)
GetGlobMatches(36-65)PathMatch(74-106)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Build (linux)
- GitHub Check: Build (windows)
- GitHub Check: Analyze (go)
- GitHub Check: autofix
- GitHub Check: Summary
🔇 Additional comments (69)
pkg/pager/pager.go (1)
11-11: Migration verified—mock regenerated correctly.The
go:generatedirective successfully migrated togo.uber.org/mock/mockgen, andmock_pager.gowas properly regenerated with the correct uber import at line 15.Optionally consider pinning a specific version (e.g.,
@v0.6.0) instead of@latestfor reproducible builds across environments—this would be a codebase-wide decision affecting all go:generate directives.pkg/config/imports_error_paths_test.go (1)
9-9: Import migration complete and verified.The update from archived
golang/mockto maintainedgo.uber.org/mockis correct. Mock files have been regenerated with the new tool, and go:generate directives are properly configured. No issues.internal/exec/describe_config_test.go (1)
8-8: Migration looks good.The import path update from
github.com/golang/mock/gomocktogo.uber.org/mock/gomockis correct, and all gomock API usage remains compatible.tests/testhelpers/README.md (1)
38-38: Documentation updated correctly.The example code now reflects the migration to
go.uber.org/mock/gomock, keeping documentation in sync with the codebase.internal/exec/copy_glob_error_paths_test.go (1)
10-10: Import migration complete.The gomock import path has been correctly updated to
go.uber.org/mock/gomockwith no impact on test functionality.pkg/git/interface.go (1)
10-10: Code generation directive updated correctly.The
go:generatedirective now usesgo run go.uber.org/mock/mockgen@latest, which ensures version pinning and aligns with the migration to Uber's maintained mock framework. Based on learnings.internal/exec/oci_utils_test.go (1)
11-11: Import path migrated successfully.The gomock import has been updated to
go.uber.org/mock/gomock, maintaining full compatibility with existing test code.internal/exec/validate_schema_test.go (1)
10-10: Mock import updated correctly.The migration to
go.uber.org/mock/gomockis complete for this test file with no functional impact.tests/testhelpers/filesystem_test.go (1)
8-8: Test helpers updated for new mock framework.The gomock import path has been correctly updated to
go.uber.org/mock/gomock, ensuring test helpers work with the migrated mock framework.pkg/list/list_instances_process_test.go (1)
7-7: Migration complete for this test file.The gomock import has been successfully updated to
go.uber.org/mock/gomock, maintaining compatibility with all existing test logic.pkg/telemetry/mock/mock_posthog_client.go (1)
15-17: Migration to Uber gomock looks good.Generated file; import switch is correct and matches project-wide migration. No manual edits needed here.
internal/exec/describe_component_test.go (1)
9-9: Good swap to go.uber.org/mock/gomock.No behavior change; aligns with the new dependency.
pkg/telemetry/telemetry_test.go (1)
12-12: Uber gomock import looks correct.No test behavior changes; consistent with the migration.
pkg/config/load_error_paths_test.go (1)
11-11: Import migration complete and verified repo-wide.Script confirms all
go:generatedirectives usego run go.uber.org/mock/mockgen@,go.modhas the correct dependency, and.golangci.ymlenforces the rule. No active stragglers—references in CLAUDE.md and go.sum are documentation and historical respectively. The change is solid.pkg/telemetry/telemetry_logger_selection_test.go (3)
7-7: Import migration looks good.The gomock import path has been correctly updated to the maintained Uber fork.
67-68: Linter rule prevents regression.Excellent addition to prevent accidental use of the archived library going forward.
67-68: Remove review comment—no misalignment exists.The test file legitimately tests telemetry logger selection (a real feature), and the mock library migration to
go.uber.org/mockis the technical update mechanism for that test. The codebase already supports telemetry opt-in/opt-out viasettings.telemetry.enabled. The PR objectives and actual changes are aligned; there's no contradiction. Lines 67-68 are routine test closure syntax.Likely an incorrect or invalid review comment.
go.mod (1)
92-92: Dependency migration complete.Updated to go.uber.org/mock v0.6.0, the maintained successor to the archived golang/mock library.
pkg/telemetry/mock/mock_telemetry_provider.go (1)
15-15: Generated mock updated correctly.Import path successfully migrated in the generated mock file. The presence of the
isgomockmarker field at line 23 confirms this mock was regenerated with Uber's mockgen.pkg/filesystem/interface.go (1)
12-12: Mock generation directives migrated.All three go:generate directives now correctly invoke Uber's mockgen via
go run go.uber.org/mock/mockgen@latest, ensuring future mock regeneration uses the maintained tooling.Based on learnings
Also applies to: 58-58, 69-69
tests/testhelpers/filesystem.go (1)
6-6: Test helper import updated.The gomock import path has been successfully migrated. The MockFSBuilder continues to work seamlessly with Uber's gomock API.
pkg/validator/schema_validator.go (1)
16-16: Mock generation directive updated.The go:generate directive now uses Uber's mockgen, ensuring the Validator interface mock will be generated with the maintained tooling.
Based on learnings
pkg/pro/interface.go (1)
11-11: Mock generation directive migrated.The go:generate directive now correctly references Uber's mockgen for future mock regeneration.
Based on learnings
pkg/pager/mock_pager.go (1)
15-16: Generated mocks migrated to Uber gomock — looks good.Import swap, isgomock marker, and any-typed recorder params match Uber mockgen output.
Also applies to: 22-22, 51-51
CLAUDE.md (1)
321-332: Quick PR hygiene check: confirm linked issue.PR text says “closes #123” (analytics opt-in/out). This PR migrates mocks; no analytics config surfaced here. Please verify the issue linkage before merge.
pkg/validator/mock_schema_validator.go (1)
16-16: Validator mock migration looks correct.Changes align with Uber mockgen output; no action needed.
Also applies to: 24-24, 53-53
pkg/telemetry/utils_test.go (1)
20-20: Uber gomock import verified—no issues.The codebase is fully migrated: all
//go:generatedirectives usego.uber.org/mock/mockgen, no deprecatedgithub.com/golang/mockimports remain in active code, andgo.modcorrectly referencesgo.uber.org/mock v0.6.0. The change is good to merge.pkg/datafetcher/mock_fetch_schema.go (1)
3-7: Mock regeneration matches Uber gomock expectations.Import path, isgomock markers, and any-typed recorder params look good. No functional concerns.
Also applies to: 15-16, 22-22, 52-55, 61-62, 91-94
pkg/downloader/mock_file_downloader_interface.go (1)
3-7: Mock updates look correct with Uber gomock.Recorder parameters generalized to any are expected; no issues spotted.
Also applies to: 17-18, 24-24, 53-56, 68-71, 83-86, 98-101, 113-116, 122-122, 152-155, 161-161
pkg/validator/schema_validator_test.go (1)
7-13: Import migration verified—all checks pass.The verification confirms the migration to go.uber.org/mock is complete and consistent across the codebase:
- No deprecated
github.com/golang/mockimports in actual code- All 21 go:generate directives use the correct
go run go.uber.org/mock/mockgen@latestpattern- Dependency properly declared in go.mod (v0.6.0)
- No bare mockgen invocations found
Code changes look good.
internal/exec/mock_storer_test.go (1)
1-350: LGTM! Generated mock successfully migrated.This generated mock file has been correctly updated to use
go.uber.org/mock. The new format includes theisgomockmarker field and updated recorder signatures usingany, which aligns with the v0.6.0 API.cmd/describe_workflows_test.go (1)
6-6: LGTM! Import path cleanly updated.The gomock import has been correctly updated to the maintained fork without affecting test logic.
internal/exec/stacks_processor.go (1)
7-7: LGTM! Code generation directive properly updated.The
go:generatedirective now invokes mockgen viago runwith version pinning, ensuring reproducible mock generation.Based on learnings.
pkg/downloader/file_downloader_test.go (1)
9-9: LGTM! Import migration complete.The gomock import path has been correctly updated while preserving all test functionality.
cmd/describe_affected_test.go (1)
7-7: LGTM! Import updated consistently.The import migration follows the same pattern as other test files, maintaining test behavior.
internal/exec/describe_stacks_test.go (1)
9-9: LGTM! Import path correctly updated.Clean migration to the maintained mock framework without impacting test logic.
internal/exec/mock_describe_affected.go (1)
1-54: LGTM! Generated mock properly updated.The mock has been regenerated with the new tooling, including the
isgomockmarker andany-typed recorder parameters that match the updated API.internal/exec/describe_stacks.go (1)
34-34: LGTM! Code generation updated correctly.The
go:generatedirective now uses the maintained mockgen with version pinning and appropriate source-mode parameters.Based on learnings.
pkg/downloader/file_downloader_interface.go (1)
11-11: LGTM! Clean migration to maintained mock tooling.The
go:generatedirectives have been correctly updated to usego run go.uber.org/mock/mockgen@latest, ensuring mocks are generated with the actively maintained fork.Also applies to: 31-31
internal/exec/version_test.go (1)
9-9: LGTM! Import and mock generation updated correctly.The migration to
go.uber.org/mock/gomockis complete with no impact on test logic.Also applies to: 17-17
cmd/describe_dependents_test.go (1)
6-6: LGTM! Import path updated correctly.The switch to
go.uber.org/mock/gomockmaintains full compatibility with existing test logic.internal/exec/describe_affected_test.go (1)
10-10: LGTM! Import migration complete.The update to
go.uber.org/mock/gomockis correct and preserves all test functionality.cmd/describe_stacks_test.go (1)
7-7: LGTM! Import path correctly updated.Migration to
go.uber.org/mock/gomockcompleted without affecting test behavior.internal/tui/templates/term/term_writer.go (1)
11-11: LGTM! Mock generation directive updated correctly.The switch to
go run go.uber.org/mock/mockgen@latestaligns with the maintained mock tooling.internal/exec/describe_affected.go (1)
51-51: LGTM! Mock generation updated to maintained tooling.The directive change ensures mocks are generated using
go.uber.org/mock/mockgen@latest.internal/exec/describe_dependents.go (1)
32-32: LGTM! Mock generation directive correctly migrated.The update to
go run go.uber.org/mock/mockgen@latestcompletes the migration to actively maintained mock tooling.internal/exec/describe_workflows.go (1)
17-17: LGTM! Updated go:generate directive aligns with Uber's mock framework.The change to
go run go.uber.org/mock/mockgen@latestensures version consistency and follows the modern approach for running mockgen.internal/exec/describe_dependents_test.go (1)
9-9: LGTM! Import path successfully migrated to Uber's mock framework.The gomock API remains compatible, so no test logic changes are needed.
internal/exec/describe_affected_utils_test.go (2)
3-3: LGTM! Mock generation directive properly migrated.Using
go run go.uber.org/mock/mockgen@latestensures reproducible mock generation for the external go-git Storer interface.
11-11: LGTM! Import path correctly updated.The migration to
go.uber.org/mock/gomockis consistent with the repository-wide migration.internal/tui/templates/term/mock_term_writer.go (2)
15-15: LGTM! Generated mock uses correct import path.The migration to
go.uber.org/mock/gomockis properly reflected in the generated mock.
22-22: LGTM! New isgomock marker field added by Uber's mockgen.This is a standard marker field that the new mockgen adds to identify mock types.
pkg/config/mock_interface.go (3)
16-16: LGTM! Import path correctly migrated.The generated mock now uses
go.uber.org/mock/gomockas expected.
23-23: LGTM! Marker field added by new mockgen.The
isgomock struct{}field is a standard addition by Uber's mockgen.
53-53: LGTM! Modern type alias used in recorder method.The change from
interface{}toanyreflects modern Go conventions (Go 1.18+) and is automatically generated by the new mockgen.internal/exec/mock_describe_stacks.go (1)
16-16: LGTM! Generated mock properly migrated to Uber's framework.All changes (import path, isgomock marker field, and any type usage) are consistent with the new mockgen output.
Also applies to: 23-23, 52-52
internal/exec/mock_describe_workflows.go (1)
16-16: LGTM! Generated mock correctly reflects Uber's mockgen output.Import path, marker field, and modern type usage are all properly updated.
Also applies to: 23-23, 52-52
internal/exec/mock_stacks_processor.go (1)
16-16: LGTM! Generated mock successfully migrated.All structural changes (import, marker field, and type aliases) align with Uber's mockgen conventions.
Also applies to: 23-23, 53-53
internal/exec/mock_version_test.go (3)
15-15: Good: migrated to go.uber.org/mock/gomock.Correct import path for the maintained fork.
22-22: isgomock marker is expected with Uber mockgen.No action needed.
64-67: Verified: Go version and recorder signatures are compatible.Go 1.24.8 (from go.mod) exceeds the 1.18 minimum, confirming the
anyparameter change is appropriate. Test usage shows the recorder methods work as expected with the updated signatures (PrintMessage withgomock.Any(), PrintMessageToUpgradeToAtmosLatestRelease withgomock.Eq()). No compatibility concerns.pkg/git/mock_interface.go (4)
15-17: Imports look correct and ordered.go-git v5 and Uber gomock are properly grouped; aliases are consistent.
23-23: isgomock marker acknowledged.Expected with Uber mockgen; no changes needed.
44-49: *Return type updated to git.Repository matches implementation.Aligns with pkg/git/git.go:GetLocalRepo returning *git.Repository. Looks good.
59-65: No action required—types and callers are already aligned.The mock implementation correctly uses
*git.Repositorywhile the recorder usesany(standard gomock pattern for flexible test expectations). All callsites—test mocks and production code—properly pass*git.Repository. No lingering v5 aliases or import issues found. The type migration is complete and consistent.pkg/filematch/mock_interface.go (3)
15-15: Import migration LGTM.Runtime import updated to go.uber.org/mock/gomock as intended.
22-23: Uber mock sentinel fields expected.The isgomock markers are part of go.uber.org/mock. No action.
Also applies to: 61-62, 99-100
51-55: No issues found.The Go version is confirmed at 1.24.8, which exceeds the 1.18 minimum requirement for
anytype support. The mock file is properly generated by mockgen (per coding guidelines), andanyusage is correct..golangci.yml (1)
67-68: Linter rule correctly prevents use of archived mock library.The forbidigo pattern is syntactically valid and properly integrated into the configuration. The rule will catch imports and references to
github.com/golang/mockacross the codebase, enforcing the migration togo.uber.org/mockand preventing accidental regressions.To confirm the pattern functions as intended, you may want to verify it catches both standard imports (
github.com/golang/mock/gomock) and package-level references during a local lint run.
Reorder imports to comply with Atmos import organization conventions: 1. Go native imports 2. 3rd-party imports (alphabetically sorted) 3. Atmos imports Moved go.uber.org/mock/gomock to correct alphabetical position in 3rd-party section (after github.com/stretchr/testify). Also fixed MockFileMatcherInterface → MockFileMatcher to match regenerated mock interface names. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Run gofumpt to correctly order imports in all files using uber/mock. Ensures go.uber.org/mock/gomock comes after other 3rd-party imports alphabetically (after github.com/stretchr/testify). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1681 +/- ##
==========================================
+ Coverage 66.01% 66.04% +0.02%
==========================================
Files 351 351
Lines 40032 40032
==========================================
+ Hits 26429 26441 +12
+ Misses 11586 11575 -11
+ Partials 2017 2016 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
- Pin go:generate directives to mockgen@v0.6.0 for reproducible builds - Add godoc comment to FileMatcher interface - Exclude mock_*.go files from godot linter checks - Regenerate all mocks with pinned version 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/tui/templates/term/term_writer.go (1)
79-79: Add periods to inline comments.Per coding guidelines, all comments must end with periods (enforced by golangci-lint godot). Lines 79, 104, and 111 are missing them.
Apply this diff:
- // Use optimal width based on terminal size + // Use optimal width based on terminal size.- // Preserving the original length for correct return value + // Preserving the original length for correct return value.- // return the original length as per io.Writer contract + // Return the original length as per io.Writer contract.Also applies to: 104-104, 111-111
🧹 Nitpick comments (3)
internal/tui/templates/term/term_writer.go (1)
28-31: Consider adding performance tracking to public functions.Per coding guidelines, public functions should include
defer perf.Track(). While these TUI methods are lightweight, tracking would provide visibility into terminal operations during debugging.Example for
NewResponsiveWriter:func NewResponsiveWriter(w io.Writer) io.Writer { + defer perf.Track() + file, ok := w.(*os.File)Apply similar pattern to other public functions and methods as appropriate.
Based on coding guidelines.
Also applies to: 34-37, 40-43, 64-97, 99-113, 115-117, 121-123, 127-129, 133-135
pkg/config/imports_error_paths_test.go (1)
260-262: Consider asserting expected behavior.The test calls
processLocalImportbut doesn't verify whether it should succeed or fail. Either assertNoErrorif nested imports should be processed successfully, orErrorif they should fail at max depth.Apply this diff to clarify the expected behavior:
- // Process with depth that will hit max _, err = processLocalImport(tempDir, "config.yaml", tempDir, MaximumImportLvL, MaximumImportLvL) - // Should complete but nested import will fail at max depth - _ = err + // The first-level import succeeds, but nested import processing should fail at max depth + assert.NoError(t, err)Or if nested processing should bubble up an error:
_, err = processLocalImport(tempDir, "config.yaml", tempDir, MaximumImportLvL, MaximumImportLvL) - // Should complete but nested import will fail at max depth - _ = err + assert.Error(t, err) + assert.ErrorIs(t, err, errUtils.ErrMaxImportDepth)internal/exec/version_test.go (1)
6-6: Consider using stdliberrorsinstead ofpkg/errors.The file only uses
errors.New()to create simple test mock errors (lines 61, 230). The standard libraryerrorspackage would suffice here;pkg/errorsis typically reserved for production code that needs stack traces or error wrapping.- "github.com/pkg/errors" + "errors"
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (44)
.golangci.yml(2 hunks)cmd/describe_affected_test.go(1 hunks)cmd/describe_dependents_test.go(1 hunks)cmd/describe_stacks_test.go(1 hunks)cmd/describe_workflows_test.go(1 hunks)go.mod(1 hunks)internal/exec/copy_glob_error_paths_test.go(1 hunks)internal/exec/describe_affected.go(1 hunks)internal/exec/describe_affected_test.go(1 hunks)internal/exec/describe_affected_utils_test.go(1 hunks)internal/exec/describe_component_test.go(1 hunks)internal/exec/describe_config_test.go(1 hunks)internal/exec/describe_dependents.go(1 hunks)internal/exec/describe_dependents_test.go(1 hunks)internal/exec/describe_stacks.go(1 hunks)internal/exec/describe_stacks_test.go(1 hunks)internal/exec/describe_workflows.go(1 hunks)internal/exec/oci_utils_test.go(1 hunks)internal/exec/stacks_processor.go(1 hunks)internal/exec/validate_schema_test.go(4 hunks)internal/exec/version_test.go(1 hunks)internal/tui/templates/term/term_writer.go(1 hunks)pkg/config/imports_error_paths_test.go(1 hunks)pkg/config/interface.go(1 hunks)pkg/config/load_error_paths_test.go(1 hunks)pkg/datafetcher/fetch_schema.go(1 hunks)pkg/downloader/file_downloader_interface.go(2 hunks)pkg/downloader/file_downloader_test.go(1 hunks)pkg/filematch/interface.go(1 hunks)pkg/filesystem/homedir.go(1 hunks)pkg/filesystem/interface.go(3 hunks)pkg/git/interface.go(1 hunks)pkg/list/list_instances_process_test.go(1 hunks)pkg/list/list_instances_upload_test.go(1 hunks)pkg/pager/pager.go(1 hunks)pkg/pro/interface.go(1 hunks)pkg/telemetry/mock/mock_posthog_client.go(1 hunks)pkg/telemetry/mock/mock_telemetry_provider.go(1 hunks)pkg/telemetry/telemetry_logger_selection_test.go(1 hunks)pkg/telemetry/telemetry_test.go(1 hunks)pkg/telemetry/utils_test.go(1 hunks)pkg/validator/schema_validator.go(1 hunks)pkg/validator/schema_validator_test.go(1 hunks)tests/testhelpers/filesystem_test.go(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- cmd/describe_stacks_test.go
- internal/exec/stacks_processor.go
🚧 Files skipped from review as they are similar to previous changes (21)
- pkg/validator/schema_validator_test.go
- pkg/config/load_error_paths_test.go
- cmd/describe_workflows_test.go
- internal/exec/oci_utils_test.go
- pkg/downloader/file_downloader_test.go
- pkg/list/list_instances_process_test.go
- internal/exec/copy_glob_error_paths_test.go
- pkg/pro/interface.go
- pkg/git/interface.go
- cmd/describe_dependents_test.go
- internal/exec/describe_dependents_test.go
- internal/exec/describe_workflows.go
- pkg/downloader/file_downloader_interface.go
- pkg/config/interface.go
- pkg/datafetcher/fetch_schema.go
- go.mod
- internal/exec/describe_config_test.go
- pkg/telemetry/telemetry_test.go
- internal/exec/describe_dependents.go
- pkg/telemetry/telemetry_logger_selection_test.go
- pkg/list/list_instances_upload_test.go
🧰 Additional context used
📓 Path-based instructions (13)
pkg/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Place business logic in pkg rather than in cmd
Files:
pkg/telemetry/utils_test.gopkg/telemetry/mock/mock_telemetry_provider.gopkg/filesystem/homedir.gopkg/config/imports_error_paths_test.gopkg/pager/pager.gopkg/filematch/interface.gopkg/validator/schema_validator.gopkg/telemetry/mock/mock_posthog_client.gopkg/filesystem/interface.go
**/*_test.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*_test.go: Every new feature must include comprehensive unit tests
Test both happy paths and error conditions
Use table-driven tests for multiple scenarios
**/*_test.go: Unit tests should be table-driven where appropriate and focus on pure functions; target >80% coverage with emphasis on pkg/ and internal/exec/.
Test behavior, not implementation; avoid tautological or stub-only tests; use dependency injection to make code testable; remove always-skipped tests; table-driven tests must use realistic scenarios.
Place//go:generate mockgendirectives for mocks at the top of test files; for internal interfaces use-source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE.
Tests must call production code paths (do not duplicate production logic within tests).
Always use t.Skipf with a reason (never t.Skip or Skipf without context).
Test files should mirror implementation structure and be co-located with source files (foo.go ↔ foo_test.go).
Use precondition-based test skipping helpers from tests/test_preconditions.go (e.g., RequireAWSProfile, RequireGitHubAccess).
Files:
pkg/telemetry/utils_test.gopkg/config/imports_error_paths_test.gointernal/exec/describe_affected_utils_test.gointernal/exec/describe_component_test.gointernal/exec/version_test.gointernal/exec/describe_stacks_test.gointernal/exec/describe_affected_test.gocmd/describe_affected_test.gotests/testhelpers/filesystem_test.gointernal/exec/validate_schema_test.go
**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments
**/*.go: All comments must end with periods; enforced by golangci-lint godot across all Go comments.
Organize imports into three groups (stdlib, third-party, Atmos) separated by blank lines and sorted alphabetically within each group; keep existing aliases.
All errors must be wrapped using static errors defined in errors/errors.go; prefer errors.Join for multiple, fmt.Errorf with %w for context, and errors.Is for checks; never rely on string comparisons.
Prefer cross-platform implementations: use SDKs over external binaries; use filepath/os facilities; gate OS-specific logic with runtime.GOOS or build tags.
Files:
pkg/telemetry/utils_test.gopkg/telemetry/mock/mock_telemetry_provider.gointernal/tui/templates/term/term_writer.gointernal/exec/describe_affected.gopkg/filesystem/homedir.gopkg/config/imports_error_paths_test.gointernal/exec/describe_stacks.gopkg/pager/pager.gopkg/filematch/interface.gointernal/exec/describe_affected_utils_test.gointernal/exec/describe_component_test.gopkg/validator/schema_validator.gointernal/exec/version_test.gointernal/exec/describe_stacks_test.gopkg/telemetry/mock/mock_posthog_client.gointernal/exec/describe_affected_test.gopkg/filesystem/interface.gocmd/describe_affected_test.gotests/testhelpers/filesystem_test.gointernal/exec/validate_schema_test.go
{cmd,internal,pkg}/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
{cmd,internal,pkg}/**/*.go: Adddefer perf.Track()to all public functions and critical private ones, include a blank line after it, and use package-qualified names (e.g., "exec.ProcessComponent"). Use atmosConfig if available, else nil.
Always bind environment variables with viper.BindEnv; every var must have an ATMOS_ alternative and prefer ATMOS_ over external names.
Distinguish structured logging from UI output: UI prompts/errors/status to stderr; data/results to stdout; logging for system/debug only; no UI via logging.
Most text UI must go to stderr (via utils.PrintfMessageToTUI or fmt.Fprintf(os.Stderr,...)); only data/results to stdout.
Files:
pkg/telemetry/utils_test.gopkg/telemetry/mock/mock_telemetry_provider.gointernal/tui/templates/term/term_writer.gointernal/exec/describe_affected.gopkg/filesystem/homedir.gopkg/config/imports_error_paths_test.gointernal/exec/describe_stacks.gopkg/pager/pager.gopkg/filematch/interface.gointernal/exec/describe_affected_utils_test.gointernal/exec/describe_component_test.gopkg/validator/schema_validator.gointernal/exec/version_test.gointernal/exec/describe_stacks_test.gopkg/telemetry/mock/mock_posthog_client.gointernal/exec/describe_affected_test.gopkg/filesystem/interface.gocmd/describe_affected_test.gointernal/exec/validate_schema_test.go
{pkg,internal,cmd}/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
Always use mockgen for interface mocks; never write manual mocks with many stub methods.
Files:
pkg/telemetry/utils_test.gopkg/telemetry/mock/mock_telemetry_provider.gointernal/tui/templates/term/term_writer.gointernal/exec/describe_affected.gopkg/filesystem/homedir.gopkg/config/imports_error_paths_test.gointernal/exec/describe_stacks.gopkg/pager/pager.gopkg/filematch/interface.gointernal/exec/describe_affected_utils_test.gointernal/exec/describe_component_test.gopkg/validator/schema_validator.gointernal/exec/version_test.gointernal/exec/describe_stacks_test.gopkg/telemetry/mock/mock_posthog_client.gointernal/exec/describe_affected_test.gopkg/filesystem/interface.gocmd/describe_affected_test.gointernal/exec/validate_schema_test.go
pkg/{,**/}**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Unit tests should primarily cover pkg/ code; ensure meaningful coverage with real scenarios (not coverage theater).
Files:
pkg/telemetry/utils_test.gopkg/config/imports_error_paths_test.go
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Target minimum 80% coverage on new/changed lines; exclude mock files from coverage: **/mock_.go, mock_.go, **/mock/*.go.
Files:
pkg/telemetry/utils_test.gopkg/telemetry/mock/mock_telemetry_provider.gointernal/tui/templates/term/term_writer.gointernal/exec/describe_affected.gopkg/filesystem/homedir.gopkg/config/imports_error_paths_test.gointernal/exec/describe_stacks.gopkg/pager/pager.gopkg/filematch/interface.gointernal/exec/describe_affected_utils_test.gointernal/exec/describe_component_test.gopkg/validator/schema_validator.gointernal/exec/version_test.gointernal/exec/describe_stacks_test.gopkg/telemetry/mock/mock_posthog_client.gointernal/exec/describe_affected_test.gopkg/filesystem/interface.gocmd/describe_affected_test.gotests/testhelpers/filesystem_test.gointernal/exec/validate_schema_test.go
**/!(*_test).go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Document all exported functions, types, and methods with Go doc comments
Files:
pkg/telemetry/mock/mock_telemetry_provider.gointernal/tui/templates/term/term_writer.gointernal/exec/describe_affected.gopkg/filesystem/homedir.gointernal/exec/describe_stacks.gopkg/pager/pager.gopkg/filematch/interface.gopkg/validator/schema_validator.gopkg/telemetry/mock/mock_posthog_client.gopkg/filesystem/interface.go
pkg/config/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
Use Viper for configuration loading with precedence (CLI→ENV→files→defaults) and the shown setup snippet (SetConfigName, AddConfigPath, AutomaticEnv, SetEnvPrefix).
Files:
pkg/config/imports_error_paths_test.go
.golangci.yml
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Configure golangci-lint with gofmt, goimports, govet, staticcheck, errcheck, ineffassign, misspell, unused, revive, gocritic enabled
Files:
.golangci.yml
cmd/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
cmd/**/*.go: Use Cobra's recommended command structure with a root command and subcommands
Implement each CLI command in a separate file under cmd/
Use Viper for managing configuration, environment variables, and flags in the CLI
Keep separation of concerns between CLI interface (cmd) and business logic
Use kebab-case for command-line flags
Provide comprehensive help text for all commands and flags
Include examples in Cobra command help
Use Viper for configuration management; support files, env vars, and flags with precedence flags > env > config > defaults
Follow single responsibility; separate command interface from business logic
Provide meaningful user feedback and include progress indicators for long-running operations
Provide clear error messages to users and troubleshooting hints where appropriate
cmd/**/*.go: Follow Cobra command pattern: one command per file; load examples via //go:embed and render via utils.PrintfMarkdown in RunE.
Telemetry for new commands is automatic via RootCmd.ExecuteC(); for non-standard paths use telemetry.CaptureCmd or telemetry.CaptureCmdString.
Files:
cmd/describe_affected_test.go
cmd/**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
cmd/**/*_test.go: Always use cmd.NewTestKit(t) in ALL cmd package tests, including subtests, to snapshot and restore RootCmd state.
Command tests live under cmd/ and must use temporary binaries when needed; TestMain must call os.Exit(m.Run()) to propagate exit code.
Files:
cmd/describe_affected_test.go
tests/**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Integration tests live under tests/ with fixtures in tests/test-cases/.
Files:
tests/testhelpers/filesystem_test.go
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to pkg/store/**/mock_*.go : Generate mocks for all store interfaces using mockgen (via //go:generate) rather than manual implementations.
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to {pkg,internal,cmd}/**/*.go : Always use mockgen for interface mocks; never write manual mocks with many stub methods.
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/*_test.go : Place `//go:generate mockgen` directives for mocks at the top of test files; for internal interfaces use `-source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE`.
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to pkg/store/**/mock_*.go : Generate mocks for all store interfaces using mockgen (via //go:generate) rather than manual implementations.
Applied to files:
pkg/telemetry/utils_test.gopkg/telemetry/mock/mock_telemetry_provider.gointernal/tui/templates/term/term_writer.gopkg/filesystem/homedir.gointernal/exec/describe_stacks.gopkg/pager/pager.gopkg/filematch/interface.gointernal/exec/describe_affected_utils_test.gopkg/validator/schema_validator.gointernal/exec/version_test.gopkg/telemetry/mock/mock_posthog_client.gopkg/filesystem/interface.gotests/testhelpers/filesystem_test.go
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/*_test.go : Place `//go:generate mockgen` directives for mocks at the top of test files; for internal interfaces use `-source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE`.
Applied to files:
pkg/telemetry/utils_test.gointernal/tui/templates/term/term_writer.gopkg/filesystem/homedir.gointernal/exec/describe_stacks.gopkg/pager/pager.gopkg/filematch/interface.gointernal/exec/describe_affected_utils_test.gopkg/validator/schema_validator.gointernal/exec/version_test.gopkg/filesystem/interface.gotests/testhelpers/filesystem_test.go
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to {pkg,internal,cmd}/**/*.go : Always use mockgen for interface mocks; never write manual mocks with many stub methods.
Applied to files:
pkg/telemetry/utils_test.gointernal/tui/templates/term/term_writer.gopkg/filesystem/homedir.gointernal/exec/describe_stacks.gopkg/pager/pager.gopkg/filematch/interface.gointernal/exec/describe_affected_utils_test.go.golangci.ymlpkg/validator/schema_validator.gointernal/exec/version_test.gopkg/filesystem/interface.gocmd/describe_affected_test.go
📚 Learning: 2024-11-13T21:37:07.852Z
Learnt from: Cerebrovinny
PR: cloudposse/atmos#764
File: internal/exec/describe_stacks.go:289-295
Timestamp: 2024-11-13T21:37:07.852Z
Learning: In the `internal/exec/describe_stacks.go` file of the `atmos` project written in Go, avoid extracting the stack name handling logic into a helper function within the `ExecuteDescribeStacks` method, even if the logic appears duplicated.
Applied to files:
internal/exec/describe_stacks.go
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
PR: cloudposse/atmos#0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to **/!(*_test).go : Document all exported functions, types, and methods with Go doc comments
Applied to files:
pkg/filematch/interface.go
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/* : Target minimum 80% coverage on new/changed lines; exclude mock files from coverage: **/mock_*.go, mock_*.go, **/mock/*.go.
Applied to files:
.golangci.yml
📚 Learning: 2025-09-23T02:30:42.362Z
Learnt from: CR
PR: cloudposse/atmos#0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-09-23T02:30:42.362Z
Learning: Applies to **/*.go : All code must pass golangci-lint checks
Applied to files:
.golangci.yml
📚 Learning: 2025-07-05T20:59:02.914Z
Learnt from: aknysh
PR: cloudposse/atmos#1363
File: internal/exec/template_utils.go:18-18
Timestamp: 2025-07-05T20:59:02.914Z
Learning: In the Atmos project, gomplate v4 is imported with a blank import (`_ "github.com/hairyhenderson/gomplate/v4"`) alongside v3 imports to resolve AWS SDK version conflicts. V3 uses older AWS SDK versions that conflict with newer AWS modules used by Atmos. A full migration to v4 requires extensive refactoring due to API changes and should be handled in a separate PR.
Applied to files:
internal/exec/describe_stacks_test.go
🧬 Code graph analysis (1)
internal/exec/validate_schema_test.go (3)
pkg/validator/mock_schema_validator.go (1)
MockValidator(20-24)pkg/downloader/mock_file_downloader_interface.go (1)
MockFileDownloader(21-25)pkg/filematch/mock_interface.go (2)
MockFileMatcher(96-100)NewMockFileMatcher(108-112)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Build (linux)
- GitHub Check: Build (windows)
- GitHub Check: Build (macos)
- GitHub Check: Run pre-commit hooks
- GitHub Check: Analyze (go)
- GitHub Check: Lint (golangci)
- GitHub Check: Summary
🔇 Additional comments (28)
pkg/telemetry/utils_test.go (1)
24-24: LGTM! Clean migration to the maintained mock library.The import path update to
go.uber.org/mock/gomockis correct. All test logic remains intact since the APIs are compatible.pkg/validator/schema_validator.go (1)
16-16: Migration to go.uber.org/mock looks good.The directive correctly migrates to the maintained mock library. Pinning to
@v0.6.0rather than using@latestis actually solid practice—ensures reproducible builds across environments.internal/exec/describe_component_test.go (1)
10-10: LGTM! Import path correctly updated.The migration from the archived
github.com/golang/mockto the maintainedgo.uber.org/mockis correct. The API remains compatible, so no changes to the gomock usage elsewhere in the file are needed.tests/testhelpers/filesystem_test.go (1)
9-9: Import path updated correctly.The migration from
github.com/golang/mock/gomocktogo.uber.org/mock/gomockis clean and aligns with the PR's goal to use the maintained fork. All gomock API usage remains unchanged.pkg/filematch/interface.go (2)
18-21: Doc comment properly added.Addresses previous feedback. The comment follows Go conventions and satisfies the coding guidelines.
16-16: No issues found; version pinning is consistent and intentional.All
go:generate mockgendirectives across the codebase consistently use@v0.6.0. This is a deliberate choice for reproducibility and stability—pinned versions are preferred over@latest. The directive inpkg/filematch/interface.go:16aligns with the codebase-wide pattern.pkg/telemetry/mock/mock_posthog_client.go (1)
1-187: Migration looks good for this generated mock.The import path update to
go.uber.org/mock/gomockis correct, and the generated code includes expected changes from the Uber fork (theisgomockfield at line 23 andanytype usage in recorder methods). Since this is generated code, no manual edits are needed.Note: Per the coding guidelines, ensure a
//go:generate mockgen ...directive exists in the appropriate location (likely in the interface definition or test file) to regenerate this mock when needed. Based on learnings.internal/tui/templates/term/term_writer.go (1)
11-11: Migration to go.uber.org/mock looks good.The go:generate directive correctly invokes the Uber mock generator with proper flags and version pinning.
cmd/describe_affected_test.go (1)
9-9: LGTM!The gomock import path has been correctly updated to use Uber's maintained fork. The test logic and mock usage remain unchanged.
.golangci.yml (2)
67-68: LGTM!The new forbidigo rule correctly prevents future use of the archived
github.com/golang/mocklibrary and directs developers to usego.uber.org/mock. This proactive lint rule helps maintain consistency after the migration.
200-202: LGTM!Excluding generated mock files from the godot linter is appropriate. Generated code may not follow comment style conventions, and this exclusion prevents noisy linting errors.
internal/exec/validate_schema_test.go (2)
6-8: LGTM!Import paths correctly updated to use Uber's mock library. The test dependencies are now aligned with the migrated mock framework.
106-136: LGTM!The mock type has been correctly updated from
MockFileMatcherInterfacetoMockFileMatcher, reflecting the naming conventions of Uber's mockgen. The test logic and assertions remain unchanged.internal/exec/describe_affected_test.go (1)
13-13: LGTM!The gomock import path has been correctly updated. All test logic and mock expectations remain functionally identical.
internal/exec/describe_stacks.go (1)
34-34: LGTM!The go:generate directive has been updated to use
go runwith explicit version pinning (@v0.6.0). This approach is more reproducible than relying on a globally installed mockgen binary.internal/exec/describe_affected_utils_test.go (2)
3-3: LGTM!The go:generate directive has been updated to use the versioned
go runapproach, consistent with other files in this PR. This ensures reproducible mock generation.
12-12: LGTM!The gomock import path has been correctly updated. Test logic remains unchanged.
internal/exec/describe_affected.go (1)
51-51: LGTM!The go:generate directive has been updated to use the versioned
go runapproach, ensuring reproducible and consistent mock generation across the codebase.internal/exec/describe_stacks_test.go (1)
9-12: LGTM!The gomock import path has been correctly updated to Uber's maintained fork. Import ordering follows the project's conventions (stdlib, third-party, Atmos packages).
pkg/config/imports_error_paths_test.go (2)
11-11: LGTM! Import path correctly updated.The migration from the archived
github.com/golang/mockto the maintainedgo.uber.org/mockis correct. The API is fully compatible, so no other changes are needed in this file.
62-80: LGTM! Proper gomock usage for testing hard-to-trigger error path.The mock-based test correctly verifies the MkdirTemp error handling. Good use of dependency injection with the
processConfigImportsWithFSfunction to make this testable.pkg/filesystem/interface.go (1)
12-12: Verify the version pinning choice.The PR description states directives should use
@latest, but the implementation pins to@v0.6.0. While pinning to a specific version is generally better for reproducibility, confirm this deviation from the PR description is intentional.Also applies to: 58-58, 69-69
pkg/filesystem/homedir.go (1)
9-9: Rewrite unnecessary—no code issues found.All 21 go:generate mockgen directives in the codebase consistently use
@v0.6.0, not@latest. The change topkg/filesystem/homedir.go:9follows the established pattern and is correct as-is. The original concern about version inconsistency was based on incorrect assumptions about PR objectives.Likely an incorrect or invalid review comment.
internal/exec/version_test.go (2)
18-18: Migration to uber/mock looks good.The go:generate directive correctly migrates to
go.uber.org/mock/mockgenand follows the learned pattern for test file mock generation. Using@v0.6.0instead of@latestis solid for reproducible builds.Based on learnings.
3-13: Add blank line between import groups.Import organization should follow the three-group pattern (stdlib, third-party, Atmos) with blank lines separating each group. A blank line is needed between line 4 (stdlib) and line 6 (third-party).
As per coding guidelines.
import ( "testing" + "github.com/pkg/errors" "github.com/stretchr/testify/assert" "go.uber.org/mock/gomock"⛔ Skipped due to learnings
Learnt from: CR PR: cloudposse/atmos#0 File: CLAUDE.md:0-0 Timestamp: 2025-10-19T22:59:32.333Z Learning: Applies to **/*_test.go : Unit tests should be table-driven where appropriate and focus on pure functions; target >80% coverage with emphasis on pkg/ and internal/exec/.Learnt from: CR PR: cloudposse/atmos#0 File: CLAUDE.md:0-0 Timestamp: 2025-10-19T22:59:32.333Z Learning: Applies to **/*_test.go : Place `//go:generate mockgen` directives for mocks at the top of test files; for internal interfaces use `-source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE`.pkg/telemetry/mock/mock_telemetry_provider.go (3)
16-16: Import migration looks good.The import path correctly points to the maintained
go.uber.org/mocklibrary.
23-23: Expected addition from uber's mockgen.The
isgomockmarker field is a zero-sized sentinel added by the new mockgen version—no impact on behavior or memory.
53-53: Stylistic update to modern Go.The parameter type switch from
interface{}toanyis a cosmetic change—they're aliases. The new mockgen favors the shorter form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
internal/exec/version_test.go (1)
15-15: Comment period issue addressed.The missing period on the comment has been fixed as flagged in the previous review.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (6)
go.mod(2 hunks)internal/exec/version_test.go(1 hunks)internal/tui/templates/term/term_writer.go(3 hunks)pkg/config/imports_error_paths_test.go(2 hunks)pkg/downloader/file_downloader_interface.go(2 hunks)pkg/filesystem/interface.go(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- pkg/downloader/file_downloader_interface.go
🚧 Files skipped from review as they are similar to previous changes (1)
- pkg/filesystem/interface.go
🧰 Additional context used
📓 Path-based instructions (10)
**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*.go: All code must pass golangci-lint checks
Follow Go error handling idioms and use meaningful error messages
Wrap errors with context using fmt.Errorf("context: %w", err)
Consider custom error types for domain-specific errors
Follow standard Go coding style; run gofmt and goimports
Use snake_case for environment variables
Document complex logic with inline comments
**/*.go: All comments must end with periods; enforced by golangci-lint godot across all Go comments.
Organize imports into three groups (stdlib, third-party, Atmos) separated by blank lines and sorted alphabetically within each group; keep existing aliases.
All errors must be wrapped using static errors defined in errors/errors.go; prefer errors.Join for multiple, fmt.Errorf with %w for context, and errors.Is for checks; never rely on string comparisons.
Prefer cross-platform implementations: use SDKs over external binaries; use filepath/os facilities; gate OS-specific logic with runtime.GOOS or build tags.
Files:
internal/tui/templates/term/term_writer.gopkg/config/imports_error_paths_test.gointernal/exec/version_test.go
**/!(*_test).go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Document all exported functions, types, and methods with Go doc comments
Files:
internal/tui/templates/term/term_writer.go
{cmd,internal,pkg}/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
{cmd,internal,pkg}/**/*.go: Adddefer perf.Track()to all public functions and critical private ones, include a blank line after it, and use package-qualified names (e.g., "exec.ProcessComponent"). Use atmosConfig if available, else nil.
Always bind environment variables with viper.BindEnv; every var must have an ATMOS_ alternative and prefer ATMOS_ over external names.
Distinguish structured logging from UI output: UI prompts/errors/status to stderr; data/results to stdout; logging for system/debug only; no UI via logging.
Most text UI must go to stderr (via utils.PrintfMessageToTUI or fmt.Fprintf(os.Stderr,...)); only data/results to stdout.
Files:
internal/tui/templates/term/term_writer.gopkg/config/imports_error_paths_test.gointernal/exec/version_test.go
{pkg,internal,cmd}/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
Always use mockgen for interface mocks; never write manual mocks with many stub methods.
Files:
internal/tui/templates/term/term_writer.gopkg/config/imports_error_paths_test.gointernal/exec/version_test.go
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Target minimum 80% coverage on new/changed lines; exclude mock files from coverage: **/mock_.go, mock_.go, **/mock/*.go.
Files:
internal/tui/templates/term/term_writer.gogo.modpkg/config/imports_error_paths_test.gointernal/exec/version_test.go
go.{mod,sum}
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
go.{mod,sum}: Manage dependencies with Go modules
Keep dependencies up to date
Files:
go.mod
pkg/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
Place business logic in pkg rather than in cmd
Files:
pkg/config/imports_error_paths_test.go
**/*_test.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*_test.go: Every new feature must include comprehensive unit tests
Test both happy paths and error conditions
Use table-driven tests for multiple scenarios
**/*_test.go: Unit tests should be table-driven where appropriate and focus on pure functions; target >80% coverage with emphasis on pkg/ and internal/exec/.
Test behavior, not implementation; avoid tautological or stub-only tests; use dependency injection to make code testable; remove always-skipped tests; table-driven tests must use realistic scenarios.
Place//go:generate mockgendirectives for mocks at the top of test files; for internal interfaces use-source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE.
Tests must call production code paths (do not duplicate production logic within tests).
Always use t.Skipf with a reason (never t.Skip or Skipf without context).
Test files should mirror implementation structure and be co-located with source files (foo.go ↔ foo_test.go).
Use precondition-based test skipping helpers from tests/test_preconditions.go (e.g., RequireAWSProfile, RequireGitHubAccess).
Files:
pkg/config/imports_error_paths_test.gointernal/exec/version_test.go
pkg/config/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
Use Viper for configuration loading with precedence (CLI→ENV→files→defaults) and the shown setup snippet (SetConfigName, AddConfigPath, AutomaticEnv, SetEnvPrefix).
Files:
pkg/config/imports_error_paths_test.go
pkg/{,**/}**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Unit tests should primarily cover pkg/ code; ensure meaningful coverage with real scenarios (not coverage theater).
Files:
pkg/config/imports_error_paths_test.go
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to pkg/store/**/mock_*.go : Generate mocks for all store interfaces using mockgen (via //go:generate) rather than manual implementations.
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to {pkg,internal,cmd}/**/*.go : Always use mockgen for interface mocks; never write manual mocks with many stub methods.
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/*_test.go : Place `//go:generate mockgen` directives for mocks at the top of test files; for internal interfaces use `-source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE`.
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to pkg/store/**/mock_*.go : Generate mocks for all store interfaces using mockgen (via //go:generate) rather than manual implementations.
Applied to files:
internal/tui/templates/term/term_writer.go
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/*_test.go : Place `//go:generate mockgen` directives for mocks at the top of test files; for internal interfaces use `-source=$GOFILE -destination=mock_$GOFILE -package=$GOPACKAGE`.
Applied to files:
internal/tui/templates/term/term_writer.go
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to {pkg,internal,cmd}/**/*.go : Always use mockgen for interface mocks; never write manual mocks with many stub methods.
Applied to files:
internal/tui/templates/term/term_writer.go
📚 Learning: 2025-10-19T22:59:32.333Z
Learnt from: CR
PR: cloudposse/atmos#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-19T22:59:32.333Z
Learning: Applies to **/*.go : All comments must end with periods; enforced by golangci-lint godot across all Go comments.
Applied to files:
internal/exec/version_test.go
🧬 Code graph analysis (1)
pkg/config/imports_error_paths_test.go (1)
pkg/config/load.go (1)
MaximumImportLvL(28-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Build (linux)
- GitHub Check: Build (macos)
- GitHub Check: Build (windows)
- GitHub Check: Run pre-commit hooks
- GitHub Check: Analyze (go)
- GitHub Check: Lint (golangci)
- GitHub Check: Summary
🔇 Additional comments (7)
go.mod (1)
6-6: LGTM - dependency migration looks good.The switch from archived
golang/mockto maintainedgo.uber.org/mockv0.6.0 aligns perfectly with the PR objectives. The version is consistent with the@v0.6.0used in go:generate directives throughout the codebase.Also applies to: 90-90
internal/tui/templates/term/term_writer.go (2)
11-11: Good migration to Uber's mock framework.The directive now uses
go runwith version pinning (@v0.6.0), ensuring reproducible mock generation across environments without requiring a globally installed mockgen binary.
79-79: Comments now properly punctuated.The period additions ensure compliance with the godot linter requirement that all Go comments must end with periods.
Also applies to: 104-104, 111-111
pkg/config/imports_error_paths_test.go (2)
11-11: Import updated correctly.The switch to
go.uber.org/mock/gomockcompletes the migration from the archived golang/mock package.
259-264: Test correctly verifies graceful depth-limit handling.The implementation confirms the test's expected behavior:
processLocalImportat max depth succeeds and gracefully skips nested imports that exceed the limit (lines 259–261 log and continue rather than propagate errors). The assertionNoErroris correct—the function doesn't fail the operation when nested imports hit the depth ceiling, it just processes what fits.internal/exec/version_test.go (2)
3-13: Migration to go.uber.org/mock looks good.The import path has been correctly updated from
github.com/golang/mock/gomocktogo.uber.org/mock/gomock, and the import organization follows the coding guidelines with proper grouping.
26-306: Test implementation is solid.The table-driven tests are well-structured, cover both happy paths and error conditions, and properly utilize gomock for mocking. The migration to
go.uber.org/mockhasn't affected the test logic.
|
These changes were released in v1.196.0-rc.0. |
what
github.com/golang/mockwithgo.uber.org/mock.github.com/golang/mock/gomocktogo.uber.org/mock/gomock.//go:generate mockgendirectives to usego run go.uber.org/mock/mockgen@v0.6.0(pinned version for reproducible builds)..golangci.ymlto disallow usage ofgithub.com/golang/mock..golangci.ymlto exclude generated mock files (mock_*.go) from godot linter checks.why
github.com/golang/mockis an archived repository and should no longer be used.go.uber.org/mockis the maintained successor.@v0.6.0ensures reproducible builds across different environments.references