Skip to content

when qisrc moves a repo, it omits to update it #103

@sbarthelemy

Description

@sbarthelemy

I have a buildfarm that does reset the worktree to some branch then builds and runs the tests.

The reset part is done with:

test -d ${worktree_path}/.qi || qisrc init --worktree=${worktree_path} git@gitlab.aldebaran.lan:qi/manifest.git -b ${branch}
qisrc checkout --force --worktree=${worktree_path} ${branch} && qisrc sync --all --reset --worktree=${worktree_path}

I'm doing both qisrc checkout and qisrc sync because the manifest branch may change from one build to another.

When switching manifest branch, qisrc checkout may need to move a repo around.
I noticed that in such a case, it omits to update it. As a consequence, the repo stays on the wrong branch (typically another release branch), and my build fails.

The problem lies in the compute_repo_diff() function, which only adda a repo to the to_update list if it does not move.

This bug is quite bad since qibuild will never recover: running qisrc checkout && qisrc sync again won't help.

If you go and git checkout the repo to the proper branch yourself, then qisrc checkout && qisrc sync will checkout the wrong branch again.

It appears the wrong branch name persists in ${worktree_path}/.qi/git.xml
The moving rep is basicawareness. It should be on master.

$ grep basicawareness .qi/git.xml
  <project name="naoqi/basicawareness.git" review="true" src="life/basicawareness">
    <remote default="true" default_branch="master" name="origin" review="false" url="ssh://git@gitlab.aldebaran.lan/naoqi/basicawareness.git" />
    <remote default="false" default_branch="master" name="gerrit" review="true" url="ssh://sbarthelemy@gerrit.aldebaran.lan:29418/naoqi/basicawareness.git" />
  <project name="naoqi/basicawareness.git" review="true" src="expressivity/interactionengines/basicawareness">
    <remote default="true" default_branch="master" name="origin" review="false" url="ssh://git@gitlab.aldebaran.lan/naoqi/basicawareness.git" />
    <remote default="false" default_branch="master" name="gerrit" review="true" url="ssh://sbarthelemy@gerrit.aldebaran.lan:29418/naoqi/basicawareness.git" />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions