feat(logging): add LogBucket - #175
Open
naxty wants to merge 1 commit into
Open
Conversation
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds
GCP::Logging::LogBucket— the last Cloud Logging type with a create and adelete that the plugin did not have.
Branched off
main, independent of the other batches.logging-log-bucketlogging-log-view(pre-existing)Verified through
debug-conformance.yml; the local key is 403 on this project'sLogging 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_REQUESTEDandstays for seven days so it can be undeleted, and a
getanswers 200 with thatstate rather than 404 — so the generic
Readwould report a deleted bucket aspresent for a week, an out-of-band delete would never leave inventory, and
discovery would keep offering buckets on their way out.
Readreports such abucket 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
lifecycleStatefield and handled before the first run rather than after a failed one.
logging-log-viewis in the CI run above because views are bucket-scoped andshare the path builder; it passes unchanged.
lockedis modelled but deliberately unset in the fixture. A locked bucketcan 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
_Defaultand_Requiredbuckets created by GCP, sodiscovery 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 withanalytics enabled plus a BigQuery dataset, and link creation is asynchronous
and slow. It is the one remaining Logging type.
cmekSettings,indexConfigsandrestrictedFieldsare not modelled; eachneeds its own verification pass.
Correction (2026-08-28): this body reported CRUD as
8/8. That was wrong. TheReplace step reports
[~]— skipped, not passed: the harness only runs it when atestdata/<case>-replace.pklfixture exists, and no case in this repo has one (0 of118). Read every
8/8above as 7 passed, Replace not exercised. The same appliesto every GCP resource already on
main— the Replace path has never been coveredhere. Nothing in this PR regressed.