Skip to content

Commit 2873e54

Browse files
authored
Fall back to lockfiles when merge base not found (DataDog#22357)
* Fall back to lockfiles when merge base not found * Add changelog
1 parent 58fcec0 commit 2873e54

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

ddev/changelog.d/22357.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Handle missing merge base commits in `ddev size status` by falling back to local lockfiles.

ddev/src/ddev/cli/size/utils/common_funcs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,11 @@ def get_last_dependency_sizes_artifact(
10041004
dep_sizes_json = get_dep_sizes_json(app, commit, platform, py_version)
10051005
if not dep_sizes_json:
10061006
app.display_debug("No dependency sizes in current commit, searching ancestors")
1007-
base_commit = app.repo.git.merge_base(commit, "origin/master")
1007+
try:
1008+
base_commit = app.repo.git.merge_base(commit, "origin/master")
1009+
except Exception as e:
1010+
app.display_error(f"Failed to find merge base for {commit}: {e}")
1011+
return None
10081012
if base_commit != commit:
10091013
app.display_debug(f"Found base commit: {base_commit}")
10101014
previous_commit = base_commit

0 commit comments

Comments
 (0)