Skip to content

feat(logging): add LogBucket - #175

Open
naxty wants to merge 1 commit into
mainfrom
naxty/gcpLoggingBatch
Open

feat(logging): add LogBucket#175
naxty wants to merge 1 commit into
mainfrom
naxty/gcpLoggingBatch

Conversation

@naxty

@naxty naxty commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Adds GCP::Logging::LogBucket — the last Cloud Logging type with a create and a
delete that the plugin did not have.

Branched off main, independent of the other batches.

Case Result
logging-log-bucket crud 8/8, discovery 4/4
logging-log-view (pre-existing) passes — regression check, see below

Verified through debug-conformance.yml; the local key is 403 on this project's
Logging writes.

Why it matters

Metrics, sinks, exclusions, views, saved queries and log scopes were all
modelled — but not the buckets that views are windows onto and sinks route into.
A bucket is what decides how long logs live and where.

Notes for review

A deleted log bucket does not go away. It enters DELETE_REQUESTED and
stays for seven days so it can be undeleted, and a get answers 200 with that
state rather than 404 — so the generic Read would report a deleted bucket as
present for a week, an out-of-band delete would never leave inventory, and
discovery would keep offering buckets on their way out. Read reports such a
bucket as gone.

That is the same shape as the Cloud SQL backup tombstone fixed earlier in this
series. This time it was visible in the discovery document's lifecycleState
field and handled before the first run rather than after a failed one.

logging-log-view is in the CI run above because views are bucket-scoped and
share the path builder; it passes unchanged.

locked is modelled but deliberately unset in the fixture. A locked bucket
can never be deleted and locking cannot be undone — setting it in a conformance
fixture would strand a resource in the shared project permanently. The schema
says so where someone declaring one will read it.

What I could not verify

  • Every project has _Default and _Required buckets created by GCP, so
    discovery reports two per project that nobody declared. That is the API's
    shape rather than something to filter, but it does mean unmanaged log buckets
    will appear after this lands.
  • Link (Log Analytics → BigQuery) is not included: it needs a bucket with
    analytics enabled plus a BigQuery dataset, and link creation is asynchronous
    and slow. It is the one remaining Logging type.
  • cmekSettings, indexConfigs and restrictedFields are not modelled; each
    needs its own verification pass.

Correction (2026-08-28): this body reported CRUD as 8/8. That was wrong. The
Replace step reports [~]skipped, not passed: the harness only runs it when a
testdata/<case>-replace.pkl fixture exists, and no case in this repo has one (0 of
118). Read every 8/8 above as 7 passed, Replace not exercised. The same applies
to every GCP resource already on main — the Replace path has never been covered
here. Nothing in this PR regressed.

The last Cloud Logging type with a create and a delete that the plugin did not
have - metrics, sinks, exclusions, views, saved queries and log scopes were all
there, but not the buckets the views and sinks point at.

Deleting a log bucket does not remove it. It enters DELETE_REQUESTED and stays
for seven days so it can be undeleted, and a get answers 200 with that state
rather than 404 - so the generic Read would report a deleted bucket as present
for a week. Read reports it as gone instead. That trap was visible in the
discovery document's lifecycleState field and is handled up front rather than
after a failed run, unlike the Cloud SQL backup tombstone that cost a cycle
earlier in this work.

locked is modelled so an existing locked bucket reads correctly, and the schema
says plainly that locking cannot be undone and a locked bucket can never be
deleted - the fixture leaves it unset for that reason.
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