Repository navigation
fix(build-dependency-cache): save with the region the restore ran with (SC-88184) - #22
Merged
samidalouche merged 1 commit intoNov 24, 2026
Conversation
…h (SC-88184) cache-sbt and cache-uv save from their post step, and post steps run in the reverse order of their steps, so in a job that configures AWS credentials after the cache step, the save runs after configure-aws-credentials' post step. That step sets AWS_REGION and AWS_DEFAULT_REGION to "", since GitHub Actions can't unset a variable, and the aws CLI takes "" as the region. Every save in such a job failed, after narrative-snowflake-data-plane#395 moved to these actions: sbt dependency cache: couldn't save, so other runs restore an older one: couldn't check s3://…/aws-to-snowflake-monitoring/8b3ed52c….tar.zst: Invalid endpoint: https://s3..amazonaws.com The restore didn't, as it ran before configure-aws-credentials. It's the case in narrative-snowflake-data-plane's aws-to-snowflake-monitoring-test and data-plane-snowflake-test, and narrative-connectors' global-dependency-graph. - s3-cache.js: the restore keeps AWS_REGION and AWS_DEFAULT_REGION in the step's state, which the runner hands to the post step as STATE_<name>, and the save sets each back when it's empty. A region still set is left alone. Failing to keep it only warns, since a save in a job without configure-aws-credentials doesn't need it. - The credentials that post step blanks are left as they are: the CLI skips empty ones and falls back to the runner's instance role, the one the restore used. With an empty region, `aws s3api head-object` fails with the error above; with the region set, it goes on to look for credentials. - tests/s3-cache.test.js: the restore keeps the region, keeps nothing without one and warns when it can't; the save gets a blanked region back and keeps one still set. - README.md says why the save needs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
samidalouche
deleted the
fix/sc-88184/build-dependency-cache-save-with-the-restores-region
branch
November 24, 2026 21:15
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.
Story
SC-88184: CI, keep sbt's, mise's and uv's caches in S3. A fix to #20.
What and why
cache-sbtandcache-uvsave from their post step. Post steps run in the reverse order of their steps, so in a job that configures AWS credentials after the cache step, the save runs afterconfigure-aws-credentials' cleanup. That cleanup setsAWS_REGIONandAWS_DEFAULT_REGIONto""(GitHub Actions can't unset a variable), and the aws CLI takes""as the region:That's every save in narrative-snowflake-data-plane's
aws-to-snowflake-monitoring-testanddata-plane-snowflake-test, and narrative-connectors'global-dependency-graph. The jobs still pass, since a failed save only warns, but they'd never save a new archive.$GITHUB_STATE), which the runner hands to the post step asSTATE_AWS_REGIONandSTATE_AWS_DEFAULT_REGION.configure-aws-credentialsran.Testing
tests/s3-cache.test.js: the restore keeps the region, keeps nothing without one, and warns when it can't write the state; the save gets a blanked region back and keeps one still set.aws s3api head-objectfails withInvalid endpoint: https://s3..amazonaws.comwhen the region is empty, and goes on to look for credentials once it's set.mainshould logsbt dependency cache: saved …(or… is already saved) in those three jobs.🤖 Generated with Claude Code