Repository navigation
ci(unit): shallow checkout for db-and-spend shard - #49959
Closed
mateo-berri wants to merge 2 commits into
Closed
mateo-berri wants to merge 2 commits into
mateo-berri wants to merge 2 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
3 of 5 tasks
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
Closing in favor of #50120, which is merged and gives db-and-spend the same one-commit checkout plus a merge base fetch and a workflow test |
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.
Handwritten 1-3 sentence description
<make-me-human-readable>The database and spend unit tests kept failing before running anything, because their checkout tried to download every branch and tag of the repo and hit the 10 minute limit. This makes that checkout a single commit like every other shard, then fetches only the default branch's commit history right before the schema check that needs it
</make-me-human-readable>Details
TLDR
Problem this solves:
db-and-spendtimes out inactions/checkouton PRs and mainfetch-depth: 0pulls about 4.3k branches and 1.6k tagsHow it solves it:
db-and-spendwithfetch-depth: 1and a 3 minute limitgit showlazily downloads the oneschema.prismablob it needsUser Flow
Before: an engineer opens a PR and
unit passedgoes red with no test rundb-and-spendsits in "Fetching the repository" for 10 minutes and times outunit passedfails, so the PR can't merge until someone reruns itAfter: the same PR gets a real
db-and-spendresultdb-and-spendchecks out one commit in seconds, then fetches main's history for the schema checkunit passedreflects the real resultPre-Submission checklist
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
E2E exception at e58398a. The diff only changes the checkout and adds one git fetch inside the existing schema-check step in
.github/workflows/test-unit.yml, so a fresh-repo simulation of the exact git commands plus this PR's own CI run ofdb-and-spendis the proofRecent failures this fixes, both stuck in "Fetching the repository" until the 10 minute timeout: PR job https://github.com/BerriAI/litellm/actions/runs/41715207126/job/126231091432 and main job https://github.com/BerriAI/litellm/actions/runs/41704173852/job/126156530705
Simulation in a fresh
git initagainst public https://github.com/BerriAI/litellmgit fetch --no-tags --depth=1 origin refs/pull/49919/mergefinished in 13.51sgit fetch --no-tags --filter=tree:0 --unshallow origin '+refs/heads/main:refs/remotes/origin/main' "$(git rev-parse HEAD)"finished in 9.15spython scripts/check_schema_compatibility.py --base-ref origin/mainprintedSchema compatibility passed against merge base e1c03c54233ba92412ea481e06d619604b9eeb5din 1.24sOn this PR's CI,
db-and-spendcheckout took 11s, the fetch took 3.24s, the schema check passed and the shard ran36 passed, 12 skipped(https://github.com/BerriAI/litellm/actions/runs/41732726507/job/126255027064)Every test that reads
test-unit.ymlpassed at this sha, the startup safety check held, and thezizmorcheck passed (https://github.com/BerriAI/litellm/actions/runs/41732726855/job/126253959951)Workflow test commands and output
Type
🚄 Infrastructure
Final Attestation
Link to Devin session: https://app.devin.ai/sessions/01c77b8f7f444a4f8092ba1b865424cf
Open in Devin Desktop: https://app.devin.ai/desktop/session/01c77b8f7f444a4f8092ba1b865424cf?variant=devin
Requested by: @mateo-berri