Repository navigation
chore(typing): auto-tighten the basedpyright budget nightly #34983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+181
−24
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| name: Nightly Basedpyright Budget Tighten | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "47 7 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| tighten: | ||
| if: github.repository == 'BerriAI/litellm' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | ||
| with: | ||
| ref: litellm_internal_staging | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Set up uv | ||
| uses: ./.github/actions/setup-uv-with-retries | ||
| with: | ||
| version: "0.10.9" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| uv sync --frozen --group proxy-dev --group e2e-dev | ||
|
|
||
| - name: Generate Prisma client | ||
| env: | ||
| PRISMA_BINARY_CACHE_DIR: ${{ runner.temp }}/prisma-cache | ||
| run: | | ||
| uv run --no-sync prisma generate --schema litellm/proxy/schema.prisma | ||
|
|
||
| - name: Tighten basedpyright budget | ||
| env: | ||
| NODE_OPTIONS: --max-old-space-size=12288 | ||
| run: | | ||
| (uv run --no-sync basedpyright --outputjson || true) | uv run --no-sync python scripts/type_check_gate.py --tighten | ||
|
|
||
| - name: Create pull request | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| if git diff --quiet basedpyright-code-budget.json; then | ||
| echo "No stale headroom to remove; skipping PR." | ||
| exit 0 | ||
| fi | ||
| BRANCH_NAME="litellm_tighten_basedpyright_budget_$(date +'%m_%d_%Y')" | ||
| if git ls-remote --exit-code --heads origin "$BRANCH_NAME" > /dev/null; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| echo "Branch $BRANCH_NAME already exists; skipping PR." | ||
| exit 0 | ||
| fi | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git checkout -b "$BRANCH_NAME" | ||
| git add basedpyright-code-budget.json | ||
| git commit -m "chore(typing): tighten basedpyright budget to staging head counts" | ||
| git push "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" "HEAD:refs/heads/$BRANCH_NAME" | ||
| gh pr create --base litellm_internal_staging --head "$BRANCH_NAME" \ | ||
| --title "chore(typing): tighten basedpyright budget to staging head counts" \ | ||
| --body "Automated nightly run of scripts/type_check_gate.py --tighten. Every limit in basedpyright-code-budget.json falls to the current staging head count for its rule plus 50 slack; limits that are already at or below that stay put, so limits only ever fall. The delta-vs-base gate still spares any PR that does not grow a rule past its base, so this only stops new errors from hiding under stale headroom" | ||
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When basedpyright terminates after emitting valid but incomplete nonempty JSON,
|| truediscards the failure status and--tightentreats the partial diagnostics as a complete measurement. Missing rules are then counted as zero and lowered toward the slack floor, producing an invalid budget PR that can make subsequent type-check jobs fail.