Install lsql offline in CI to avoid GitHub API rate-limit 403s#4865
Merged
Conversation
The databricks CLI's 'labs install' fetches the release list and source zipball from api.github.com anonymously (it never reads GITHUB_TOKEN), so it routinely hits GitHub's 60 req/hr unauthenticated rate limit on shared runner IPs and fails with '403 Forbidden'. PR #4857's GITHUB_TOKEN env was a no-op because the CLI ignores that variable. Pre-fetch the release list and source archive with authenticated 'gh' (5000 req/hr), seed the CLI's local cache and lib dir, then install with --offline so no GitHub API calls are made. Co-authored-by: Isaac
|
✅ 2/2 passed, 20s total Running from acceptance #9036 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4865 +/- ##
=======================================
Coverage 87.79% 87.79%
=======================================
Files 123 123
Lines 17595 17595
Branches 3717 3717
=======================================
Hits 15448 15448
Misses 1458 1458
Partials 689 689 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pritishpai
approved these changes
Jun 8, 2026
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.
Summary
The
Install LSQLstep inpush.ymlintermittently fails with:databricks labs installfetches both the release list and the source zipball fromapi.github.comanonymously — the CLI'scmd/labs/githubclient useshttp.DefaultClientwith noAuthorizationheader and reads noGITHUB_TOKEN/GH_TOKENon any version (verified againstv0.292.0andmain). So it hits GitHub's 60 req/hr unauthenticated rate limit, which is shared across GitHub Actions runner IPs.PR #4857 added
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}to the step, but that variable is silently ignored by the CLI — it was a no-op, and the run only went green because it happened to land in a window with rate-limit budget.Fix
Pre-fetch the release list and source archive with authenticated
gh(5,000 req/hr), seed the CLI's local cache (~/.databricks/labs/lsql/cache) and lib dir (~/.databricks/labs/lsql/lib), then rundatabricks labs install lsql --offlineso the CLI makes no GitHub API calls at all.Test plan
install --offlineproduces a workinglsqlplugin (databricks labs installedlistslsql v0.17.0) anddatabricks labs lsql fmtruns with no diff.build/fmtjob passes theInstall LSQLstep.This pull request and its description were written by Isaac.