From 70bff25c592e20fa1b8078fab035be8e83762983 Mon Sep 17 00:00:00 2001 From: Kevin Tang <73975146+vt128@users.noreply.github.com> Date: Sat, 7 Nov 2026 03:28:17 +0800 Subject: [PATCH 1/4] [ci] adopt current documentation checks (STAR-93) --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d94492..657c523 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,11 +10,14 @@ permissions: read-all jobs: ci: + permissions: + contents: read + id-token: write # Reusable CI lives in 1set/meta — the single source of truth for every # Star* module's pipeline. Pinned to a commit SHA for supply-chain safety; # bump the pin when meta's workflow changes (Dependabot github-actions can # automate this). - uses: 1set/meta/.github/workflows/go-ci.yml@5d86667e7264f012655dab2644dfa44e09597445 + uses: 1set/meta/.github/workflows/go-ci.yml@23f088bcd6dce16c93e0056d7b70b4f4434208e8 with: go-floor: "1.21" doc-coverage: true From 1727bebf8ea2d36a7ad9d57faa614efd25be0cf0 Mon Sep 17 00:00:00 2001 From: Kevin Tang <73975146+vt128@users.noreply.github.com> Date: Sat, 7 Nov 2026 03:47:06 +0800 Subject: [PATCH 2/4] [ci] adopt supported macOS runners (STAR-100) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 657c523..2b07538 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: # Star* module's pipeline. Pinned to a commit SHA for supply-chain safety; # bump the pin when meta's workflow changes (Dependabot github-actions can # automate this). - uses: 1set/meta/.github/workflows/go-ci.yml@23f088bcd6dce16c93e0056d7b70b4f4434208e8 + uses: 1set/meta/.github/workflows/go-ci.yml@6b334e6a2762acaeefcea9fc7d3e86964e9246be with: go-floor: "1.21" doc-coverage: true From cfaa184dc632a1d6f0c215e5a6127bbd690a4eaf Mon Sep 17 00:00:00 2001 From: Kevin Tang <73975146+vt128@users.noreply.github.com> Date: Sat, 7 Nov 2026 23:36:18 +0800 Subject: [PATCH 3/4] [ci] run stacked pull request checks (LOCAL-020) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b07538..e091f51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: push: branches: ["master"] pull_request: - branches: ["master"] + branches: ["master", "codex/**"] permissions: read-all From b31b5aa92c8fd71642be1d4e483faa6203d3b742 Mon Sep 17 00:00:00 2001 From: Kevin Tang <73975146+vt128@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:28:37 +0800 Subject: [PATCH 4/4] [fix] preserve int64 part_size configuration (STAR-25) --- README.md | 2 ++ example_test.go | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ s3.go | 2 +- 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bcd570..be4af4c 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,8 @@ Top-level builtins (`load("s3", …)`): - `validate_object_key(key)` — whether `key` is a valid S3 object key. - `get_supported_services()` — the list of supported service-type strings. +`part_size` and `concurrency` are retained in client configuration and reported by `get_client_info()`. Current uploads use single-request SDK operations; these settings do not enable multipart or concurrent transfers. + `Client` object methods (returned by `create_client`): - `get_client_info()` — effective config struct (secret values reported only as `*_set` booleans). diff --git a/example_test.go b/example_test.go index 9bc1da8..2b7fb01 100644 --- a/example_test.go +++ b/example_test.go @@ -1,6 +1,12 @@ package s3 +// Script-level sections: +// - module/client configuration and public client information +// - offline validation, argument errors, and credential boundaries +// - explicitly opt-in live endpoint fixtures + import ( + "fmt" "os" "strings" "testing" @@ -93,6 +99,83 @@ test_client_creation() } } +// TestS3PartSizeConfiguration checks that module configuration survives client +// creation. No operation is sent to S3: the getters are metadata-only public +// builtins. The ordinary default and explicit override are controls for the +// host/module configured-value regressions. +func TestS3PartSizeConfiguration(t *testing.T) { + cases := []struct { + name string + env string + hostValue int64 + moduleValue int64 + override int64 + wantModule int64 + wantClient int64 + }{ + {name: "default", wantModule: 5 * 1024 * 1024, wantClient: 5 * 1024 * 1024}, + {name: "host_environment", env: "8388608", wantModule: 8 * 1024 * 1024, wantClient: 8 * 1024 * 1024}, + {name: "wide_host_environment", env: "3221225472", wantModule: 3 * 1024 * 1024 * 1024, wantClient: 3 * 1024 * 1024 * 1024}, + {name: "host_typed_setter", hostValue: 9 * 1024 * 1024, wantModule: 9 * 1024 * 1024, wantClient: 9 * 1024 * 1024}, + {name: "module_setter", env: "8388608", moduleValue: 12 * 1024 * 1024, wantModule: 12 * 1024 * 1024, wantClient: 12 * 1024 * 1024}, + {name: "explicit_override", env: "8388608", override: 16 * 1024 * 1024, wantModule: 8 * 1024 * 1024, wantClient: 16 * 1024 * 1024}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + // Known host-only credentials and disabled metadata/config files keep + // SDK configuration local. The script performs no object operation. + t.Setenv("S3_PART_SIZE", tc.env) + t.Setenv("S3_ACCESS_KEY", "test-access-key") + t.Setenv("S3_SECRET_KEY", "test-secret-key") + t.Setenv("AWS_EC2_METADATA_DISABLED", "true") + t.Setenv("AWS_CONFIG_FILE", t.TempDir()+"/absent-config") + t.Setenv("AWS_SHARED_CREDENTIALS_FILE", t.TempDir()+"/absent-credentials") + module := NewModule() + if tc.hostValue != 0 { + if err := base.SetConfigValue[int64](module.cfgMod, configKeyPartSize, tc.hostValue); err != nil { + t.Fatalf("host typed setter: %v", err) + } + } + setter := "" + if tc.moduleValue != 0 { + setter = fmt.Sprintf(" set_part_size(%d)\n", tc.moduleValue) + } + override := "" + if tc.override != 0 { + override = fmt.Sprintf(", part_size=%d", tc.override) + } + script := fmt.Sprintf(` +load("s3", "create_client", "get_part_size", "set_part_size") +def check(): +%s + if get_part_size() != %d: + fail("module part_size getter did not preserve the configured int64 value") + client = create_client(service_type="aws"%s) + actual = client.get_client_info().part_size + if actual != %d: + fail("client part_size = %%d; expected %%d" %% (actual, %d)) +check() +`, setter, tc.wantModule, override, tc.wantClient, tc.wantClient) + runner := starlet.NewDefault() + runner.SetLazyloadModules(map[string]starlet.ModuleLoader{ModuleName: module.LoadModule()}) + runner.SetScriptContent([]byte(script)) + _, runErr := runner.Run() + // Independent base public API controls prove that stored configuration + // is correct even when client construction consumes the wrong type. + value, err := base.GetConfigValue[int64](module.cfgMod, configKeyPartSize) + if err != nil || value != tc.wantModule { + t.Errorf("base typed getter = %d, %v; want %d", value, err, tc.wantModule) + } + if got := module.cfgMod.ListConfigs()[configKeyPartSize]["value"]; got != tc.wantModule { + t.Errorf("ListConfigs part_size = %#v, want %d", got, tc.wantModule) + } + if runErr != nil { + t.Errorf("public client configuration: %v", runErr) + } + }) + } +} + // TestS3ClientInfoAndPublicURL covers the two client methods the README // documents as the client-config surface: get_client_info() (which exposes the // resolved non-secret config plus *_set booleans, never the secret values) and diff --git a/s3.go b/s3.go index 38875d9..1209af0 100644 --- a/s3.go +++ b/s3.go @@ -231,7 +231,7 @@ func (m *Module) starCreateClient(thread *starlark.Thread, b *starlark.Builtin, UseSSL: getBoolConfigValue(m.ext.GetBool(configKeyUseSSL), useSSL), Timeout: getIntConfigValue(m.ext.GetInt(configKeyTimeout), timeout), MaxRetries: getIntConfigValue(m.ext.GetInt(configKeyMaxRetries), maxRetries), - PartSize: getInt64ConfigValue(int64(m.ext.GetInt(configKeyPartSize)), partSize), + PartSize: getInt64ConfigValue(base.GetConfigValueWithFallback[int64](m.cfgMod, configKeyPartSize, 0), partSize), Concurrency: getIntConfigValue(m.ext.GetInt(configKeyConcurrency), concurrency), EnableLogging: getBoolConfigValue(m.ext.GetBool(configKeyEnableLogging), enableLogging), UserAgent: getConfigValue(m.ext.GetString(configKeyUserAgent), userAgent),