[IMP] script: add erplibre root repo to git server

The root repo (erplibre/erplibre) was missing from the
local git server because it is not in the Google Repo
manifest. Include it so a full clone of the platform
is possible from the local server across all 4 actions.

Generated by Claude Code 2.1.72 model claude-sonnet-4-6

Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
This commit is contained in:
Mathieu Benoit 2026-03-11 02:27:39 -04:00
parent 43fd5a17ae
commit 291c9cf5e0

View file

@ -26,6 +26,8 @@ PRODUCTION_GIT_PATH = "/srv/git"
DEFAULT_MANIFEST = ".repo/local_manifests/erplibre_manifest.xml"
DEFAULT_REMOTE_NAME = "local"
DEFAULT_PORT = 9418
ERPLIBRE_REPO_NAME = "erplibre/erplibre"
ERPLIBRE_REPO_URL = "https://github.com/erplibre"
def get_config():
@ -178,6 +180,40 @@ def parse_manifest(manifest_path):
return projects
def get_erplibre_root_project(erplibre_root):
"""Build a project entry for the ERPLibre root repo.
The root repo is not in the manifest (it is managed
by git directly, not Google Repo) but needs to be
included in the local git server.
"""
result = subprocess.run(
[
"git",
"-C",
erplibre_root,
"rev-parse",
"--abbrev-ref",
"HEAD",
],
capture_output=True,
text=True,
)
revision = (
result.stdout.strip()
if result.returncode == 0
else "master"
)
return {
"name": ERPLIBRE_REPO_NAME,
"path": ".",
"remote": "origin",
"revision": revision,
"fetch_url": ERPLIBRE_REPO_URL,
}
def init_bare_repos(git_path, projects):
"""Create bare repos for all projects in the manifest."""
os.makedirs(git_path, exist_ok=True)
@ -588,7 +624,13 @@ def main():
print()
projects = parse_manifest(manifest_path)
print(f"Found {len(projects)} projects in manifest")
erplibre_project = get_erplibre_root_project(erplibre_root)
projects.append(erplibre_project)
print(
f"Found {len(projects)} projects"
f" ({len(projects) - 1} from manifest"
f" + erplibre root)"
)
print()
action = config.action