Skip to content

[WIP] Multicloud Support#141

Draft
mpyw wants to merge 9 commits intomainfrom
multicloud
Draft

[WIP] Multicloud Support#141
mpyw wants to merge 9 commits intomainfrom
multicloud

Conversation

@mpyw
Copy link
Owner

@mpyw mpyw commented Jan 19, 2026

No description provided.

…t architecture (#140)

This commit implements phase A.1 (Scope type) and B.2 (Store Scope support)
from the multi-cloud refactoring plan.

Key changes:
- Add staging.Scope type with Provider enum (AWS, GoogleCloud, Azure)
- Add helper constructors: AWSScope, GoogleCloudScope, AzureKeyVaultScope, AzureAppConfigScope
- Refactor daemon to be scope-independent at startup
- Move scope from daemon initialization to per-request handling
- Update protocol to include Scope in Request messages
- Update all stores (agent, file) to accept Scope parameter

Architecture change:
Before: One daemon per scope (accountID + region)
After: Single daemon handles all scopes (scope passed per-request)

This enables future multi-cloud support where different providers
have different scope structures.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added go Pull requests that update Go code cli CLI functionality gui GUI functionality staging Staging workflow functionality labels Jan 19, 2026
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 74.03017% with 241 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.29%. Comparing base (6433dd4) to head (a3a2fa6).

Files with missing lines Patch % Lines
internal/provider/aws/secret/adapter.go 38.17% 110 Missing and 5 partials ⚠️
internal/provider/aws/param/adapter.go 73.44% 39 Missing and 8 partials ⚠️
internal/staging/scope.go 20.00% 36 Missing ⚠️
internal/model/parameter.go 71.87% 9 Missing ⚠️
internal/model/secret.go 70.00% 9 Missing ⚠️
...nal/staging/store/agent/internal/server/handler.go 62.50% 0 Missing and 6 partials ⚠️
internal/usecase/param/update.go 68.75% 5 Missing ⚠️
internal/cli/commands/stage/agent/command.go 0.00% 3 Missing ⚠️
...ernal/staging/store/agent/internal/client/store.go 96.07% 2 Missing ⚠️
...aging/store/agent/internal/protocol/socket_unix.go 0.00% 2 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
- Coverage   90.35%   88.29%   -2.07%     
==========================================
  Files         132      139       +7     
  Lines        7746     8168     +422     
==========================================
+ Hits         6999     7212     +213     
- Misses        503      699     +196     
- Partials      244      257      +13     
Flag Coverage Δ
e2e 66.36% <60.80%> (-1.42%) ⬇️
platform-darwin 64.38% <57.14%> (ø)
platform-linux 62.85% <57.14%> (ø)
platform-windows 73.46% <66.66%> (ø)
unittests 75.82% <41.47%> (-3.88%) ⬇️

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.

- Set TMPDIR for Darwin
- Set XDG_RUNTIME_DIR for Linux
- Set LOCALAPPDATA for Windows

Also enable Windows GUI tests on multicloud branch.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added the github_actions Pull requests that update GitHub Actions code label Jan 19, 2026
mpyw and others added 3 commits January 19, 2026 01:58
Add multicloud branch alongside main for:
- test.yml: push and pull_request triggers
- labels.yml: push trigger

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Refactor file-based staging store to use separate files for each service:
- param.json for Parameter Store entries
- secret.json for Secrets Manager entries

Changes:
- Store now uses stateDir instead of stateFilePath
- Add NewStoreWithDir constructor, deprecate NewStoreWithPath
- Drain merges state from both service files
- WriteState writes to appropriate file(s) based on service filter
- Delete removes both files
- Exists returns true if either file exists
- IsEncrypted checks both files

This separation prepares for multi-cloud support where different
providers may have different service availability.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…ud support (#145)

This commit implements Phase A.2, A.3, and B.1 of the multi-cloud refactoring:

A.2: Model type definitions
- Add internal/model/parameter.go with TypedParameter, Parameter, ParameterHistory,
  and provider-specific metadata types (AWSParameterMeta, AzureAppConfigMeta)
- Add internal/model/secret.go with TypedSecret, Secret, SecretVersion,
  and provider-specific metadata types (AWSSecretMeta, GCPSecretMeta, AzureKeyVaultMeta)
- Generic types enable type-safe metadata access at provider layer
- Base types with `any` metadata for UseCase layer abstraction

A.3: Provider interface definitions
- Add internal/provider/parameter.go with ParameterReader, ParameterWriter,
  ParameterTagger, and ParameterService interfaces
- Add internal/provider/secret.go with SecretReader, SecretWriter,
  SecretTagger, SecretService, SecretRestorer, and SecretDescriber interfaces
- Interfaces are provider-agnostic, enabling future GCP/Azure implementations

B.1: AWS adapter implementations
- Add internal/provider/aws/param/adapter.go implementing ParameterService
  for AWS SSM Parameter Store
- Add internal/provider/aws/secret/adapter.go implementing SecretService
  (plus SecretRestorer, SecretDescriber) for AWS Secrets Manager
- Adapters convert between AWS SDK types and model types
- Add ParameterTier and ParameterInlinePolicy to paramapi/types.go

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added the param AWS Parameter Store related label Jan 19, 2026
- Update param and secret TagUseCase to use provider.ParameterTagger
  and provider.SecretTagger interfaces instead of AWS SDK types
- Add NewAdapter() factory functions to provider/aws/param and
  provider/aws/secret packages (moved from infra package)
- Update CLI commands (tag, untag) and GUI to use new adapter locations
- Simplify test mocks to implement provider interfaces

This reduces coupling to AWS SDK and prepares for multi-cloud support.
Code reduced by ~160 lines while improving maintainability.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added the secret AWS Secrets Manager related label Jan 19, 2026
mpyw and others added 3 commits January 20, 2026 08:46
Move provider-specific fields from base types to metadata:
- Parameter.Type -> AWSParameterMeta.Type
- ParameterListItem.Type -> AWSParameterListItemMeta.Type (new)
- Secret.ARN -> AWSSecretMeta.ARN
- SecretListItem.ARN, DeletedDate -> AWSSecretListItemMeta (new)

Add AWSMeta() helper methods for type-safe metadata access.
Update AWS adapters to populate metadata fields correctly.

This makes base types provider-agnostic for multi-cloud support.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(usecase): migrate param/show to provider interfaces

- Change ShowClient interface to use provider.ParameterReader and
  provider.ParameterTagger instead of paramapi types
- Move version resolution logic (shift handling) to usecase layer
- Update ShowOutput to use string types for Version and Type
  (provider-agnostic, no longer tied to AWS-specific enums)
- Update CLI show command to use awsparam.NewAdapter
- Update GUI ParamShow to use awsparam.NewAdapter with parseInt64 helper
- Update all tests to use model.Parameter and model.AWSParameterMeta

Part of multi-cloud refactoring: PR #2 (Read UseCase Migration)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(model): unify field names for multi-cloud compatibility

- Rename Secret.VersionID to Version (consistent with Parameter)
- Rename Parameter.LastModified to UpdatedAt
- Rename Secret.CreatedDate to CreatedAt
- Add UpdatedAt field to Secret for providers that track both dates
- Update all layers: model, provider, usecase, cli, gui

This makes the model layer truly provider-agnostic, supporting
AWS, Azure, and GCP field semantics uniformly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(usecase): simplify param/diff and param/show using paramversion helper

- Move version resolution logic from usecase to paramversion.GetParameterWithVersion()
- Update paramversion to use provider.ParameterReader interface
- Add ParamReader field to staging diff runner for version resolution
- Use hybrid approach in staging: Client for apply ops, Reader for version resolution
- Update all test files with correct mocks for new interfaces

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
)

Migrate all write use cases (create, update, delete, restore) from
AWS-specific API interfaces to cloud-agnostic provider interfaces.

Changes:
- Update provider interfaces with write result types
- Migrate param/create, param/update, param/delete use cases
- Migrate secret/create, secret/update, secret/delete, secret/restore
- Update CLI commands to use AWS adapters
- Update GUI to use AWS adapters
- Update all related tests with new mock implementations

This completes PR #3 of the multi-cloud refactoring roadmap.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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