-
Notifications
You must be signed in to change notification settings - Fork 4
Add Azure Blob Storage support (M0) #2446
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
b100b18
docs: add Azure support implementation plan
jh125486 b45f811
azureauth: add package doc and Azurite dev account constants
jh125486 590d2ea
azureauth: add SharedKey Authorization header parsing
jh125486 340f0ac
azureauth: add SharedKey/SharedKeyLite canonicalization and string-to…
jh125486 6fe548d
azureauth: add SharedKey signing and opt-in verification
jh125486 8bf165f
azureauth: fix CanonicalizedResource double-counting the account path…
jh125486 9e398b4
azureblob: add skeleton, in-memory backend, and REST handler
jh125486 62a702a
azureblob: add unit tests for handler, backend, and persistence
jh125486 2744ef8
azureblob: add README and PARITY docs
jh125486 cd602c2
merge: pkgs/azureauth (SharedKey parsing/signing)
jh125486 1b89203
merge: services/azureblob MVP skeleton
jh125486 402df94
cli: register AzureBlob provider
jh125486 6dbdefb
azureblob: wire pkgs/azureauth for Authorization header parsing
jh125486 e7e5330
test/integration: add Azure Blob container/blob lifecycle tests
jh125486 f142711
test: allowlist azureblob's MD5 use and seed its snapshot golden entry
jh125486 ddfa4c7
Merge branch 'main' into azure/m0-blob-storage
agbishop f747c62
azureauth: fix header-mutation bug in CanonicalizedHeaders, add regre…
jh125486 f068c81
azureblob: reject null containers/blobs in Restore
jh125486 fee5c3d
azureblob: fix ETag reuse on identical-content overwrite, use lockmet…
jh125486 4b64a97
azureblob: synchronous port bind, fixed-port design, observability wi…
jh125486 0f08c31
cli: wire AzureBlob port through the CLI settings struct
jh125486 c627524
checkpins: support azure-sdk-for-go's nested module paths
jh125486 786dbb4
docs: fix stale claims, machine-specific paths, and a discarded Close…
jh125486 c618b2b
test,docs: drop unneeded MD5 allowlist entry, canonicalize test heade…
jh125486 92e3fd1
portalloc,cli: reserve AzureBlob's fixed port in the shared pool
jh125486 e892321
azureblob,portalloc: fieldalignment fixes
jh125486 7792308
azureblob: cyclop, goconst, mnd, nonamedreturns, noctx fixes
jh125486 3f497bf
azureblob: golines formatting fixes
jh125486 0fd3459
cli: fix funlen regression from reserveFixedServicePorts call
jh125486 cf7836e
errcodeaudit: replace pre-squash commit hash fa0e68c21 with c7817795
jh125486 8eb595a
azureblob,portalloc: fieldalignment fixes (models.go, portalloc_test.go)
jh125486 28902ff
errcodeaudit: invert TestScanServiceDir_ECSTwelfthCodeAlsoFixed's ass…
jh125486 1cb0b57
lint: resolve remaining golangci-lint findings on azure/m0-blob-storage
jh125486 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "log/slog" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| "github.com/stretchr/testify/require" | ||
|
|
||
| "github.com/blackbirdworks/gopherstack/pkgs/portalloc" | ||
| azureblobbackend "github.com/blackbirdworks/gopherstack/services/azureblob" | ||
| ) | ||
|
|
||
| // TestReserveFixedServicePorts is a regression test: services/azureblob binds | ||
| // its dedicated listener directly via net.Listen, not through PortAlloc, but | ||
| // its default port (10000) sits inside PortRangeStart/PortRangeEnd's own | ||
| // default range (10000-10100). Without reserving it, PortAlloc could still | ||
| // hand that same port number to an unrelated caller (e.g. ElastiCache), | ||
| // which would only surface later as a confusing address-in-use failure. See | ||
| // AZURE.md section 4 and pkgs/portalloc.Allocator.Reserve's doc comment. | ||
| func TestReserveFixedServicePorts(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| tests := []struct { | ||
| name string | ||
| azurePort int | ||
| rangeStart int | ||
| rangeEnd int | ||
| wantBlockedFromPool bool | ||
| }{ | ||
| { | ||
| name: "default azure port collides with default pool range", | ||
| azurePort: azureblobbackend.DefaultPort, rangeStart: 10000, rangeEnd: 10100, | ||
| wantBlockedFromPool: true, | ||
| }, | ||
| { | ||
| name: "custom azure port outside a custom pool range", | ||
| azurePort: 9999, rangeStart: 10000, rangeEnd: 10100, | ||
| wantBlockedFromPool: false, | ||
| }, | ||
| } | ||
|
|
||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| alloc, err := portalloc.New(tt.rangeStart, tt.rangeEnd) | ||
| require.NoError(t, err) | ||
|
|
||
| cli := CLI{AzureBlob: azureblobbackend.Settings{Port: tt.azurePort}} | ||
| reserveFixedServicePorts(t.Context(), slog.Default(), alloc, cli) | ||
|
|
||
| assert.Equal(t, tt.wantBlockedFromPool, alloc.IsAllocated(tt.azurePort), tt.name) | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| // TestReserveFixedServicePorts_NilAllocatorIsNoop covers the disabled-pool | ||
| // path (setupPortAllocator returns nil for an invalid range): nothing to | ||
| // reserve against, must not panic. | ||
| func TestReserveFixedServicePorts_NilAllocatorIsNoop(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| cli := CLI{AzureBlob: azureblobbackend.Settings{Port: azureblobbackend.DefaultPort}} | ||
|
|
||
| assert.NotPanics(t, func() { | ||
| reserveFixedServicePorts(t.Context(), slog.Default(), nil, cli) | ||
| }) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Use the required table-driven test structure.
Merge the single-case tests into tables. Use named
args,want, andwantErrfields.cli_azureblob_port_reservation_test.go#L24-L30: nest Azure port and allocator range inputs inargs; renamewantBlockedFromPooltowant.cli_azureblob_port_reservation_test.go#L61-L68: add the nil-allocator path as a table case.pkgs/portalloc/portalloc_test.go#L170-L190: add this reservation scenario to a table withargsandwant.pkgs/portalloc/portalloc_test.go#L192-L201: add the out-of-range scenario to the same table structure.pkgs/portalloc/portalloc_test.go#L206-L210: addargsandwantfields alongsidewantErr.As per coding guidelines, “Tests must be table-driven” and table tests require named
args,want, andwantErrfields.📍 Affects 2 files
cli_azureblob_port_reservation_test.go#L24-L30(this comment)cli_azureblob_port_reservation_test.go#L61-L68pkgs/portalloc/portalloc_test.go#L170-L190pkgs/portalloc/portalloc_test.go#L192-L201pkgs/portalloc/portalloc_test.go#L206-L210🤖 Prompt for AI Agents
Source: Coding guidelines