Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/github_repo_auditor/portfolio_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,9 @@ def catalog_entry_for_repo(
basename_matches = [
entry
for key, entry in repos.items()
if "/" in key and key.rsplit("/", 1)[-1] == normalized_repo_name
if not normalized_project_path
and "/" in key
and key.rsplit("/", 1)[-1] == normalized_repo_name
]
if normalized_repo_name and len(basename_matches) == 1:
return {
Expand Down
27 changes: 27 additions & 0 deletions tests/test_portfolio_catalog_truth_hunt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from __future__ import annotations

from github_repo_auditor.portfolio_catalog import catalog_entry_for_repo


def test_catalog_does_not_apply_another_checkout_path_lifecycle_by_basename() -> None:
catalog = {
"repos": {
"retired/legacy-app": {
"lifecycle_state": "archived",
"catalog_key": "retired/legacy-app",
"has_explicit_entry": True,
}
}
}

entry = catalog_entry_for_repo(
{
"name": "legacy-app",
"full_name": "current-owner/legacy-app",
"path": "apps/legacy-app",
},
catalog,
)

assert entry["has_explicit_entry"] is False
assert entry["lifecycle_state"] == ""
Loading