Pin Cloudflare account for R2 publishing and fix publish-raw failures - #148
Open
MaxGhenis wants to merge 1 commit into
Open
Pin Cloudflare account for R2 publishing and fix publish-raw failures#148MaxGhenis wants to merge 1 commit into
MaxGhenis wants to merge 1 commit into
Conversation
- Add wrangler.toml pinning the PolicyEngine account so non-interactive wrangler r2 calls work for contributors whose Cloudflare user belongs to multiple accounts. - Pass manifest file-entry years through to build_r2_key unchanged: label entries such as the SSA source_capture capture crashed int(year). - Drop --force from wrangler r2 object put: current wrangler removed the flag and put overwrites by default. - Document the wrangler login flow in the README. - census/population_projections_2023: record the artifact's actual R2 key (its manifest source_id never matched the historical key convention). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
wrangler.tomlso everywrangler r2call made bychronicle publish-raw/publish-derived/fetch-artifact --upload-r2targets the PolicyEngine account without any environment setup. Non-interactive wrangler cannot select an account when the logged-in user belongs to more than one, andsubprocess-driven uploads are always non-interactive — this is exactly the failure multi-account contributors hit, and it reads like a permissions error. Verified empirically thatwrangler r2honorswrangler.tomlaccount_id(a deliberately wrong ID makes it target that wrong account).publish-rawhandle label-keyed manifest file entries.db/data/ssa/ssi_monthly_statistics_2024_12/manifest.yamlhas asource_captureentry (HTML capture alongside the CSV);_publish_raw_manifest_entrycrashed onint("source_capture").build_r2_keyonly ever stringifies the year segment — its existing stored key already uses the literalsource_capturesegment — so pass the value through and widen the annotation toint | str. Test added reproducing the SSA shape.--forcefromwrangler r2 object put. Current wrangler removed the flag ("Unknown argument: force"), so every upload fails for anyone resolving a fresh wrangler — and put overwrites by default anyway (verified on 4.59.2: repeated puts of the same key succeed without the flag).wrangler loginis the only auth step, and swap thenpxexample forbunx.Context
R2 storage for
ledger-raw/ledger-derivedmoved to the PolicyEngine Cloudflare account (20d90f557651969925eece96e58e24dc) on 2026-08-07 — the original buckets were bootstrapped on a legacy cosilico-era account in May. All committed raw artifacts (~58 MB) were re-published to the new account; keys are content-addressed, so every manifest is byte-identical and no data files change in this PR.🤖 Generated with Claude Code