Skip to content

Clean up commented out gcloud install step.#9253

Merged
SortaCookie merged 1 commit intoyoutube:mainfrom
SortaCookie:fix/sccache-cleanup
Feb 25, 2026
Merged

Clean up commented out gcloud install step.#9253
SortaCookie merged 1 commit intoyoutube:mainfrom
SortaCookie:fix/sccache-cleanup

Conversation

@SortaCookie
Copy link
Contributor

This was accidentally left in from #9225.

Bug: 432823450

@SortaCookie SortaCookie requested a review from oxve February 25, 2026 19:19
@github-actions
Copy link
Contributor

🤖 Gemini Suggested Commit Message


ci: Simplify SCCACHE GCS key condition

The SCCACHE GitHub Action configuration is updated to allow for
read-only sccache operation when no GCS key is provided. This
removes the need for a gcloud installation step when only
reading from the cache is required.

The main workflow's enable_sccache condition is simplified as
SCCACHE can now function without a GCS key. This change cleans
up lingering requirements from previous workflow adjustments.

Bug: 432823450

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

This was accidentally left in from
youtube#9225.

Bug: 432823450
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the sccache GitHub Action to conditionally configure cache access. It now supports read-write access when a GCS key is provided, and falls back to read-only access otherwise. The logic is sound, but I've suggested a small refactoring to improve maintainability by removing a duplicated bucket name.

I am having trouble creating individual review comments. Click here to see my feedback.

.github/actions/sccache/action.yaml (18-30)

medium

To improve maintainability and avoid duplicating the bucket name string, consider defining it in a variable at the beginning of the script and reusing it in both the if and else blocks. This will make future updates to the bucket name easier and less error-prone.

      BUCKET_NAME="cobalt-sccache-tvos-bucket"
      if [[ -n "$SCCACHE_GCS_KEY" ]]; then
        # If we have a GCS key we use READ_WRITE
        printf "%s" "$SCCACHE_GCS_KEY" > "${HOME}/gcloud.json"
        echo "SCCACHE_GCS_KEY_PATH=${HOME}/gcloud.json" >> $GITHUB_ENV
        echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV
        echo "SCCACHE_GCS_BUCKET=${BUCKET_NAME}" >> $GITHUB_ENV
      else
        # Read only
        echo "SCCACHE_BUCKET=${BUCKET_NAME}" >> $GITHUB_ENV
        echo "SCCACHE_ENDPOINT=https://storage.googleapis.com" >> $GITHUB_ENV
        echo "SCCACHE_S3_NO_CREDENTIALS=true" >> $GITHUB_ENV
        echo "SCCACHE_REGION=auto" >> $GITHUB_ENV
      fi

@SortaCookie SortaCookie merged commit ecd396d into youtube:main Feb 25, 2026
467 checks passed
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.

2 participants