← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~jugmac00/launchpad-buildd:fix-branch-scalability-issues into launchpad-buildd:master

 


Diff comments:

> diff --git a/debian/changelog b/debian/changelog
> index cc5ceb1..136911c 100644
> --- a/debian/changelog
> +++ b/debian/changelog
> @@ -1,3 +1,10 @@
> +launchpad-buildd (240) UNRELEASED; urgency=medium

AFAIK we only do this when we actually do a release, see e.g. https://git.launchpad.net/launchpad-buildd/commit/?id=955119cb2ce86b93e1b73d877463a6a44e2941e5

> +
> +  * Prefer `--single-branch` over `--no-single-branch` when cloning
> +    repositories to avoid branch scalability issues. Fixes LP:#2067047
> +
> + -- Jürgen Gmach <juergen.gmach@xxxxxxxxxxxxx>  Wed, 24 Jul 2024 08:22:42 +0200
> +
>  launchpad-buildd (239) focal; urgency=medium
>  
>    * Restart snapd after certificate installation and proxy initialization.
> diff --git a/lpbuildd/target/vcs.py b/lpbuildd/target/vcs.py
> index 6df9a1a..b5bc949 100644
> --- a/lpbuildd/target/vcs.py
> +++ b/lpbuildd/target/vcs.py
> @@ -78,17 +86,17 @@ class VCSOperationMixin(StatusOperationMixin):
>              cmd = ["git", "clone", "-n"]
>              if quiet:
>                  cmd.append("-q")
> -            if git_shallow_clone:
> -                cmd.extend(["--depth", "1", "--no-single-branch"])
> +            git_path = self.args.git_path
> +            if self.args.git_path is None:
> +                git_path = "HEAD"
> +            if git_shallow_clone_with_single_branch:
> +                cmd.extend(["--depth", "1", "-b", git_path, "--single-branch"])

It is also possible to have shallow clones where the tips of all the other branches are cloned, too. That is what we had before and that caused the issue. That's why I'd prefer to be more explicit.

>              cmd.extend([self.args.git_repository, name])
>              if not self.ssl_verify:
>                  env["GIT_SSL_NO_VERIFY"] = "1"
>          self.backend.run(cmd, cwd=cwd, env=full_env)
>          if self.args.git_repository is not None:
>              repository = os.path.join(cwd, name)
> -            git_path = self.args.git_path

`self.args.branch` only refers to bzr, not to git - the whole implementation is pretty much sphagetti code, that is why I added the XXX comment about refactoring it, but that would be outside of the scope of this MP.

> -            if self.args.git_path is None:
> -                git_path = "HEAD"
>              self.backend.run(
>                  ["git", "checkout", "-q", git_path],
>                  cwd=repository,


-- 
https://code.launchpad.net/~jugmac00/launchpad-buildd/+git/launchpad-buildd/+merge/469997
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/launchpad-buildd:fix-branch-scalability-issues into launchpad-buildd:master.



References