Skip to content

Commit ac32931

Browse files
committed
Wire OIDC + iceberg env vars on k8s-integration-tests job
Three additions to the k8s-integration-tests job, all of which start working the moment cloud-infra PR #8124 applies: 1. permissions: id-token: write — lets the job mint an OIDC token against GitHub's IdP. Falls back to the existing top-level contents: read since per-job permissions override. 2. New "Configure AWS credentials via OIDC" step. Trades the OIDC token for STS credentials via aws-actions/configure-aws-credentials, assuming the new github-duckgres-iceberg-test-role in mw-dev (role trust policy: repo:PostHog/duckgres:*, scoped IAM policy on the two test buckets only). Action pinned to the same commit SHA cloud-infra workflows use. 3. Three iceberg env vars hardcoded in the job's env block — the bucket ARN, region, and data bucket name. AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN are populated by configure-aws-credentials, picked up by iceberg_test.go via os.Getenv. Hardcoding the bucket coordinates matches the cloud-infra workflow convention; the buckets are persistent fixtures with stable names. Until cloud-infra #8124 applies the role and buckets don't exist yet, so this job will fail on every PR until then. That's the fail-openly behavior we just landed for iceberg_test.go — when the role appears, the next run goes green automatically.
1 parent dc2690e commit ac32931

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,26 @@ jobs:
251251
needs: unit-tests
252252
runs-on: ubuntu-24.04-arm
253253
timeout-minutes: 30
254+
# id-token: write lets this job request a GitHub OIDC token, which
255+
# aws-actions/configure-aws-credentials trades for STS-vended AWS
256+
# credentials by assuming github-duckgres-iceberg-test-role in mw-dev.
257+
# The role's trust policy is scoped to repo:PostHog/duckgres:*; its
258+
# IAM policy is scoped to the iceberg test buckets only. Provisioned
259+
# by PostHog/posthog-cloud-infra#8124.
260+
permissions:
261+
id-token: write
262+
contents: read
254263
env:
255264
DUCKGRES_KIND_CLUSTER_NAME: duckgres
256265
DUCKGRES_KIND_NODE_IMAGE: kindest/node:v1.31.0@sha256:53df588e04085fd41ae12de0c3fe4c72f7013bba32a20e7325357a1ac94ba865
266+
# Iceberg integration test (tests/k8s/iceberg_test.go) fails openly
267+
# when any of these is unset — see its godoc for the rationale. The
268+
# AWS_* credentials are populated by configure-aws-credentials below
269+
# via OIDC; the three iceberg-specific values are bucket coordinates
270+
# provisioned in mw-dev.
271+
DUCKGRES_K8S_ICEBERG_TABLE_BUCKET_ARN: arn:aws:s3tables:us-east-1:373313242555:bucket/posthog-duckgres-iceberg-test-mw-dev
272+
DUCKGRES_K8S_ICEBERG_REGION: us-east-1
273+
DUCKGRES_K8S_ICEBERG_DATA_BUCKET: posthog-duckgres-iceberg-test-data-mw-dev
257274

258275
services:
259276
postgres:
@@ -301,5 +318,16 @@ jobs:
301318
sleep $((attempt * 5))
302319
done
303320
exit 1
321+
- name: Configure AWS credentials via OIDC
322+
# Trades the GitHub-issued OIDC token for STS credentials by
323+
# assuming github-duckgres-iceberg-test-role in mw-dev. Exposes
324+
# AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN
325+
# in the job env, which iceberg_test.go reads via os.Getenv.
326+
# Pinned to the same commit cloud-infra workflows use.
327+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v4.0.2
328+
with:
329+
aws-region: us-east-1
330+
role-to-assume: arn:aws:iam::373313242555:role/github-duckgres-iceberg-test-role
331+
role-duration-seconds: 3600
304332
- name: Run Kubernetes integration tests
305333
run: just test-k8s-integration

0 commit comments

Comments
 (0)