Repository navigation
Conversation
The cleanup in cmd_update compared the last 4 path parts with (server, owner, repo, branch). A branch like release/1.0 is cloned two levels deep, so its clone never matched and was deleted right after the update. Track the full repo path and keep it and its parents. Fixes bentoml#1251 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pre-commit.ci runs mypy --strict without pytest installed, so @pytest.fixture and @pytest.mark.parametrize count as untyped decorators. Use a plain helper and one test per branch instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #1251
openllm repo updatedeletes the clone of a repo added with a slash branch such asrelease/1.0. The cleanup loop incmd_updatecompares the last 4 path parts with(server, owner, repo, branch). A slash branch is cloned two levels deep, so the 4th level is only the first part of the branch (release) and never matches. The fresh clone is removed right after it is made, and the repo lists no models.The fix is 3 changed lines in
src/openllm/repo.py:repos_in_usenow holdsrepo.pathinstead of a 4-part tuple.Test: this adds
tests/test_repo_update.py. The repo had notests/directory before, and CI has no pytest step, so delete the file if you do not want it. The test runs the realupdatecommand through the Typer app with a fake_clone_repo. It has 4 cases. On main,release/1.0anda/b/cfail and the other 2 pass. With the fix, all 4 pass. One case checks that a stale unused cache is still removed. bentoml analytics is stubbed in the test, so bentoml is not needed to run it.I also ran the real CLI end to end with the real
bentoml/openllm-modelsrepo, a realgit cloneand a real slash branch. On main the clone is deleted and 0 models are listed. With the fix 66 models are listed. In 1500 random scenarios, in-use clones deleted: 1979 on main, 0 with the fix.Known limit: a stale clone that sits next to an in-use slash branch under the same first segment is kept. For example, stale
release/1.0stays whilerelease/2.0is configured. The cleanup only walks 4 levels. This is leftover disk use only. No in-use clone is deleted. It happened in 12 of the 1500 scenarios.ruff check, ruff format,
mypy --strictand editorconfig-checker pass on the changed files.Validated with Claude Opus 5.5.
🤖 Generated with Claude Code