Skip to content

refactor(usecase): migrate show operations to provider interfaces#149

Closed
mpyw wants to merge 2 commits intomulticloudfrom
refactor/usecase-tag-provider-interfaces
Closed

refactor(usecase): migrate show operations to provider interfaces#149
mpyw wants to merge 2 commits intomulticloudfrom
refactor/usecase-tag-provider-interfaces

Conversation

@mpyw
Copy link
Owner

@mpyw mpyw commented Jan 19, 2026

Summary

  • Migrate show usecases to use provider interfaces
  • Move version resolution logic to paramversion and secretversion packages
  • Add shared shift resolution helper in version/internal

Changes

Version Package Updates

  • version/internal/resolve.go: New ApplyShift helper for shared shift logic
  • paramversion/resolve.go: New Resolve function using provider.ParameterReader
  • secretversion/resolve.go: New Resolve function using provider.SecretReader

Show Migration

  • usecase/param/show.go: Use paramversion.Resolve instead of local resolver
  • usecase/secret/show.go: Use secretversion.Resolve instead of local resolver
  • Remove usecase/param/version_resolver.go (moved to paramversion)
  • Simplify usecase/secret/version_resolver.go (keep only VersionResolverClient for diff/log)

Unchanged (for future PRs)

  • diff.go and log.go still use old AWS SDK types
  • VersionResolverClient kept for backward compatibility

Test plan

  • make test passes
  • make lint passes

🤖 Generated with Claude Code

@github-actions github-actions bot added go Pull requests that update Go code github_actions Pull requests that update GitHub Actions code cli CLI functionality gui GUI functionality staging Staging workflow functionality param AWS Parameter Store related secret AWS Secrets Manager related labels Jan 19, 2026
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 80.66298% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.39%. Comparing base (53ecc39) to head (ac8a207).

Files with missing lines Patch % Lines
internal/version/secretversion/resolve.go 61.22% 10 Missing and 9 partials ⚠️
internal/version/paramversion/resolve.go 77.27% 5 Missing and 5 partials ⚠️
internal/usecase/param/show.go 87.50% 1 Missing and 1 partial ⚠️
internal/usecase/secret/show.go 87.50% 1 Missing and 1 partial ⚠️
internal/version/internal/resolve.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           multicloud     #149      +/-   ##
==============================================
+ Coverage       87.14%   88.39%   +1.24%     
==============================================
  Files             139      144       +5     
  Lines            8170     8306     +136     
==============================================
+ Hits             7120     7342     +222     
+ Misses            806      696     -110     
- Partials          244      268      +24     
Flag Coverage Δ
e2e 66.21% <78.45%> (+1.46%) ⬆️
platform-darwin 64.38% <ø> (ø)
platform-linux 62.85% <ø> (ø)
platform-windows 73.46% <ø> (ø)
unittests 76.22% <70.71%> (-0.21%) ⬇️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mpyw mpyw changed the base branch from main to multicloud January 19, 2026 05:58
@mpyw mpyw force-pushed the refactor/usecase-tag-provider-interfaces branch from 19a2738 to 59d1af2 Compare January 19, 2026 06:01
@mpyw mpyw changed the title refactor(usecase): migrate tag and show operations to provider interfaces refactor(usecase): migrate show operations to provider interfaces Jan 19, 2026
- Add Resolve functions to paramversion and secretversion packages
- Add shared ApplyShift helper in version/internal
- Update param/show.go to use paramversion.Resolve
- Update secret/show.go to use secretversion.Resolve
- Remove version resolution logic from usecase layer
- Keep VersionResolverClient for backward compatibility (diff/log not migrated yet)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mpyw mpyw force-pushed the refactor/usecase-tag-provider-interfaces branch from 59d1af2 to e7ab094 Compare January 19, 2026 06:10
- Add model/resource.go with unified Resource type and ResourceKind enum
- Add provider/resource.go with unified Tagger interface
- Add usecase/resource/show.go with unified ShowUseCase
- Refactor param.ShowUseCase to use resource.ShowUseCase internally
- Refactor secret.ShowUseCase to use resource.ShowUseCase internally

This provides a foundation for multi-cloud support by:
- Unifying common logic (tag fetching) in resource.ShowUseCase
- Using Kind enum to distinguish parameter vs secret resources
- Keeping backward-compatible interfaces for CLI/GUI layers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mpyw
Copy link
Owner Author

mpyw commented Jan 19, 2026

Closing this PR due to design issue: AWS-specific knowledge (ARN, Type) leaking into provider-agnostic Resource model.

Root cause: model.Secret.ARN and model.Parameter.Type are already AWS-specific in base models. Need to fix model design first (move to Metadata) before retrying show unification.

Tag migration (PR #147) is kept as it doesn't have this problem.

@mpyw mpyw closed this Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI functionality github_actions Pull requests that update GitHub Actions code go Pull requests that update Go code gui GUI functionality param AWS Parameter Store related secret AWS Secrets Manager related staging Staging workflow functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant