Skip to content

fix(ingestion): grant bucket read, and name the pipeline after the bucket - #845

Merged
jirhiker merged 1 commit into
stagingfrom
fix/raw-zone-bucket-read
Aug 19, 2026
Merged

fix(ingestion): grant bucket read, and name the pipeline after the bucket#845
jirhiker merged 1 commit into
stagingfrom
fix/raw-zone-bucket-read

Conversation

@jirhiker

Copy link
Copy Markdown
Member

raw_san_acacia_locations failed with Bucket does not exist: ocotillo-ingestion-production against a bucket that plainly exists. Two
separate bugs in one traceback.

objectAdmin does not include storage.buckets.get

It covers objects and says nothing about the bucket itself. gcsfs checks a
bucket exists before writing to it, that check was denied, and GCS reports a
denial as absence — the same 404-for-403 shape as the Secret Manager failure
earlier in this work.

legacyBucketReader adds buckets.get and objects.list and nothing else. It
is the narrowest standard role that makes the check succeed; storage.admin
would also permit deleting the bucket.

The pipeline name and the bucket could disagree

The same traceback shows a pipeline named san_acacia_staging writing to
the production bucket. The name came from context.run.tags.get("environment", "staging") — a tag that was absent, so it defaulted — while the bucket came
from INGESTION_GCS_BUCKET. Two sources of truth for one fact.

The name is now derived from the bucket, so they cannot drift. A test asserts
it.

That mismatch was harmless here only because the load failed. Had the grant been
right, this run would have written production data under a pipeline named
staging, and the dlt state for the two environments would have been kept in the
same place.

Applying

The Terraform half needs an apply:

cd automated_ingestion/iac
terraform apply -var project_id=waterdatainitiative-271000 -var cloud_sql_instance=dataservices

Expect 2 to add, nothing destroyed. The code half needs the merge to deploy.

Note on the failed run

dlt left a pending load package. On Serverless the pipeline working directory is
ephemeral, so it is discarded rather than retried — the message about
abort-packages does not apply here.

49 tests pass.

🤖 Generated with Claude Code

…cket

raw_san_acacia_locations failed with "Bucket does not exist:
ocotillo-ingestion-production" against a bucket that exists. objectAdmin covers
objects and says nothing about the bucket, so it omits storage.buckets.get.
gcsfs checks a bucket exists before writing, that check was denied, and GCS
reports denial as absence -- the same 404-for-403 shape as the Secret Manager
failure earlier. legacyBucketReader adds buckets.get and objects.list and
nothing else; storage.admin would also permit deleting the bucket.

The same traceback showed a pipeline named san_acacia_staging writing to the
production bucket. The name came from a run tag that was absent, defaulting to
staging, while the bucket came from the environment: two sources of truth for
one fact, free to disagree. The name is now derived from the bucket, so they
cannot.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Coverage

79.30% total — gate is 75%.

Coverage for the Python files changed in this PR
Name Stmts Miss Cover Missing
automated_ingestion/sources/san_acacia/dlt_pipeline.py 41 0 100%
automated_ingestion/sources/san_acacia/ingest.py 34 24 29% 34-36, 45-57, 74-100, 113-120
TOTAL 75 24 68%

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Your pull request is automatically being deployed to Dagster Cloud.

Location Status Link Updated
ocotillo-automated-ingestion View in Cloud Aug 19, 2026 at 04:29 AM (UTC)

@jirhiker
jirhiker merged commit b127f52 into staging Aug 19, 2026
10 checks passed
@jirhiker
jirhiker deleted the fix/raw-zone-bucket-read branch August 19, 2026 04:27
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