MCPcopy Create free account
hub / github.com/DevCloudNinjas/DevOps-Projects / projects_for_changed_files

Function projects_for_changed_files

tools/project_inventory.py:146–159  ·  view source on GitHub ↗

Return projects that contain at least one changed path.

(
    projects: Iterable[Project], paths: Iterable[str]
)

Source from the content-addressed store, hash-verified

144
145
146def projects_for_changed_files(
147 projects: Iterable[Project], paths: Iterable[str]
148) -> list[Project]:
149 """Return projects that contain at least one changed path."""
150
151 by_path = {project.path: project for project in projects}
152 selected: dict[str, Project] = {}
153 for changed_path in paths:
154 for project_path, project in by_path.items():
155 if changed_path == project_path or changed_path.startswith(
156 f"{project_path}/"
157 ):
158 selected[project_path] = project
159 return sorted(selected.values(), key=lambda project: project.path)
160
161
162def validate_project(repo_root: Path, project: str) -> int:

Callers 2

list_mainFunction · 0.85

Calls

no outgoing calls