Repository navigation
fix(cold-store-reaper): validate JSON shape in load_state/load_credentials - #7552
Merged
Merged
Conversation
developing-today
Bot
requested review from
a team and
dezren39
as code owners
November 8, 2026 07:23
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
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.
Closes #6845
What
load_credentialsandload_stateinpkgs/cold-store-reaper/cold_store.pyparsed JSON syntax but not shape: valid-but-wrong-shape files raised rawAttributeError/TypeError/ValueErrorfar from the cause, and a non-string folder id was silently used as a Drive folder id.load_credentials: non-object top level now raisesColdStoreErrornamingcredentials.json, the unexpected shape, and the existing repair guidance. Values present forclient_id/client_secret/refresh_tokenmust be strings; a non-string value raises the same named error instead of passing the truthiness check.load_state: non-object top level raisesColdStoreErrornamingstate.jsonand the shape. A presentfoldersfield must be an object mapping names to string folder ids; any other shape raises the named error instead of a downstream raw error or a silently mistyped id._json_shape()helper names the parsed shape in both loaders' messages.Tests
New
TestWrongShapePrivateJsoninpkgs/cold-store-reaper/tests/test_cold_store.pycovers: non-object top level for both files, non-string credential value (all three known keys), non-objectfolders, non-string folder id, plus happy-path controls.TestWrongShapePrivateJson+TestAtomicPrivateJson— 10 tests, OK (laptop).python3 -m unittest discover -s pkgs/cold-store-reaper/tests— 152 tests, OK (skipped=1) on the laptop.Filed by lane code-a in fleet queue fallback mode (queue backend down; claim on issue #6845).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.