Skip to content

Phase 4: Cloud storage clients + archive orchestration + GHES version checker (Go port)#1535

Draft
offbyone wants to merge 2 commits intoo1/golang-port/3from
o1/golang-port/4
Draft

Phase 4: Cloud storage clients + archive orchestration + GHES version checker (Go port)#1535
offbyone wants to merge 2 commits intoo1/golang-port/3from
o1/golang-port/4

Conversation

@offbyone
Copy link
Copy Markdown
Contributor

@offbyone offbyone commented Mar 31, 2026

Implements cloud storage clients, archive upload orchestration, and GHES version checking.

  • Azure Blob Storage client (pkg/storage/azure/) with connection string parsing, container creation, blob upload

  • AWS S3 client (pkg/storage/aws/) with upload + presigned URL generation

  • GitHub-owned multipart upload (pkg/storage/ghowned/) — pure HTTP, small/large archive flows, configurable part size

  • Archive upload orchestration (pkg/archive/) with priority-based routing: GitHub-owned > AWS > Azure > error

  • GHES version checker (pkg/ghes/) — determines storage requirements based on GHES version

  • Consumer-defined interfaces throughout for testability

  • 57 tests across all new packages, all passing with -race

  • Did you write/update appropriate tests

  • Release notes updated (if appropriate) — not user-facing yet (parallel Go port)

  • Appropriate logging output

  • Issue linked — tracking via PR stack

  • Docs updated (or issue created) — internal packages, covered by godoc

  • New package licenses are added to ThirdPartyNotices.txt (if applicable)


PR Stack (Go port)

offbyone added 2 commits April 1, 2026 08:58
…-owned multipart

Port three storage backends used for migration archive upload:

## Azure Blob Storage (pkg/storage/azure/)
- BlobService interface for testability over Azure SDK
- Upload: creates container migration-archives-<uuid>, uploads blob with
  4MB block size, generates SAS URL (48h read-only expiry)
- Download: HTTP GET returning bytes
- Progress logging throttled to every 10 seconds
- 15 tests

## AWS S3 (pkg/storage/aws/)
- S3Uploader/S3Presigner interfaces for testability
- Upload from stream or file path, returns 48h pre-signed URL
- Session token support (SessionCredentials vs BasicCredentials)
- Timeout detection wrapped as user-friendly error
- Progress logging with 10-second throttle
- 10 tests

## GitHub-owned storage multipart (pkg/storage/ghowned/)
- Small archives (<= 100 MiB): single POST, returns URI from JSON
- Large archives: 3-phase multipart (Start POST → Part PATCHes with
  Location header following → Complete PUT)
- Configurable part size via env var (min 5 MiB)
- UserError wrapping for all failure modes
- 15 tests

Dependencies added: azure-sdk-for-go/sdk/storage/azblob, aws-sdk-go-v2,
google/uuid. All 40 tests passing, 0 lint issues.
- Archive uploader (pkg/archive/uploader.go): Priority-based routing — GitHub-owned > AWS > Azure > error. Validates credentials and dispatches to appropriate storage client. 10 tests.
- GHES version checker (pkg/ghes/version.go): Determines if GHES instance requires blob storage credentials (< 3.8.0) or can use GitHub-owned storage (>= 3.8.0). Local semver parsing. 7 tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant