Skip to content

feat: add S3-compatible target manager interactor - #431

Open
lvlcn-t wants to merge 3 commits into
mainfrom
feat/s3-target-manager
Open

lvlcn-t wants to merge 3 commits into
mainfrom
feat/s3-target-manager

Conversation

@lvlcn-t

@lvlcn-t lvlcn-t commented May 10, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

The target manager currently only supports GitLab as a remote state backend
(issue #414). This couples sparrow to GitLab infrastructure and limits
deployment flexibility across AWS, GCP, Azure, and on-prem environments.

An S3-compatible backend removes this dependency — any provider that speaks
the S3 API (AWS, MinIO, Ceph, GCS via interop) can serve as the target store.

Stack: PR 1/3 — S3 interactor + static auth. Followed by OIDC auth and
polling jitter PRs stacked on top.

Changes

  • Add pkg/sparrow/targets/remote/s3/ package with Interactor implementation
    using minio-go/v7 (Apache 2.0)
  • Implement FetchFiles, PostFile, PutFile, DeleteFile against S3 objects
  • Add ETag-based caching (If-None-Match / 304 detection) to reduce bandwidth
  • Add AuthConfig with static provider (access key + secret key)
  • Refactor remote.File to generic struct (Name + Content); move
    GitLab-specific fields into gitlab package
  • Wire S3 type into interactor.Config factory and targetmanager.Validate()
  • Make NewManager and sparrow.New() return errors for invalid config
  • Add S3 config block to chart/values.yaml (commented)
  • 15 unit tests covering auth, CRUD operations, ETag caching, and validation

For additional information look at the commits.

Tests done

  • Unit tests succeeded
  • E2E tests succeeded

TODO

  • I've assigned this PR to myself
  • I've labeled this PR correctly

@lvlcn-t lvlcn-t self-assigned this May 10, 2026
@lvlcn-t lvlcn-t added feature Introduces a new feature area/target-manager Issues/PRs related to the TargetManager labels May 10, 2026
Base automatically changed from fix/linting-tests to main May 11, 2026 16:55
lvlcn-t added 2 commits May 14, 2026 20:17
Add S3 backend as an alternative to GitLab for target file storage,
enabling sparrow deployments on any S3-compatible object storage
(AWS, GCP, Azure, MinIO, etc.) without requiring a GitLab instance.

- Implement S3 interactor with FetchFiles, PostFile, PutFile, DeleteFile
- Add ETag-based conditional GETs to reduce bandwidth on polling
- Refactor remote.File to generic struct (Name + Content only)
- Move GitLab-specific commit metadata into gitlab package
- Add config validation with sentinel errors for all auth paths
- Support static credentials with OIDC auth stubs for PR 2
- Wire S3 validation into TargetManagerConfig.Validate
- Change NewManager and sparrow.New to return errors
- Add Helm values.yaml S3 config block (commented)
- Add comprehensive tests: S3 operations, ETag caching, config
  validation, and targetmanager S3 validation cases
- Fix fumpt formatting on multi-line fmt.Sprintf call
- Update gosec annotation to gosec:disable directive format
@lvlcn-t
lvlcn-t force-pushed the feat/s3-target-manager branch from d1f8db1 to 6044698 Compare May 14, 2026 18:22
Signed-off-by: lvlcn-t <75443136+lvlcn-t@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/target-manager Issues/PRs related to the TargetManager feature Introduces a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant