Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git.py: added directory tracking to the Moulin git builder #92

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

Mishytca
Copy link

@Mishytca Mishytca commented Nov 20, 2023

Change the behavior of the git fetcher so that it doesn't consider two
or more occurrences of the same git repository in the moulin *.yaml
configuration file as an error if the duplicated repository is cloned
into different sub-folders within the build directory.
For example:

  domd:
     sources:
      - type: git
        url: "https://github.com/xen-troops/meta-example.git"
        rev: ABCDEF
        dir: "dir1"
  domu:    
    sources:
      - type: git
        url: "https://github.com/xen-troops/meta-example.git"
        rev: branch_A
        dir: "dir2"

Above, identical repositories have different branches. But, also, they
have different 'dir' parameters. So that would not be considered as an
error.

But if they would have identical directories - the error still will be
triggered.

@Mishytca Mishytca force-pushed the dev/mykhailo-androsiuk branch from 3717183 to 89c742e Compare November 20, 2023 20:43
moulin/fetchers/git.py Outdated Show resolved Hide resolved
moulin/fetchers/git.py Outdated Show resolved Hide resolved
moulin/fetchers/git.py Outdated Show resolved Hide resolved
@Mishytca Mishytca force-pushed the dev/mykhailo-androsiuk branch 3 times, most recently from a9aa902 to 244eae4 Compare November 21, 2023 15:46
Copy link
Collaborator

@lorc lorc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With that last comment addressed:

Reviewed-by: Volodymyr Babchuk <[email protected]>

moulin/fetchers/git.py Outdated Show resolved Hide resolved
@Mishytca Mishytca force-pushed the dev/mykhailo-androsiuk branch from 244eae4 to 374a4ce Compare November 21, 2023 17:52
Mykhailo Androsiuk added 2 commits November 21, 2023 20:32
Change the behavior of the git fetcher so that it doesn't consider two
or more occurrences of the same git repository in the moulin *.yaml
configuration file as an error if the duplicated repository is cloned
into different sub-folders within the build directory.
For example:

  domd:
     sources:
      - type: git
        url: "https://github.com/xen-troops/meta-example.git"
        rev: ABCDEF
        dir: "dir1"
  domu:
    sources:
      - type: git
        url: "https://github.com/xen-troops/meta-example.git"
        rev: branch_A
        dir: "dir2"
Above, identical repositories have different branches. But, also, they
have different 'dir' parameters. So that would not be considered as an
error.

But if they would have identical directories - the error still will be
triggered.

This fix adds the value, that is specified by the user as a 'dir'
parameter of the moulin's 'git' fetcher to the build.ninja file
markers, created during the execution of 'git clone' and 'git checkout'
operations. After this change, if repositories with the same name have
different directories, unique clone_stamp and checkout_stamp file
markers will be created for each repository. In this case, revision
checking of such repositories will not be performed, which is the
desired behavior.

Signed-off-by: Mykhailo Androsiuk <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
Fixes: 19d2ec0 ("git.py: Fail on different branches for same repo")
YAMLProcessingError now includes additional information about the
directory where a mismatch in repository branches was found.

Signed-off-by: Mykhailo Androsiuk <[email protected]>
Reviewed-by: Volodymyr Babchuk <[email protected]>
@Mishytca Mishytca force-pushed the dev/mykhailo-androsiuk branch from 374a4ce to d6a0559 Compare November 21, 2023 18:41
@lorc lorc merged commit 5146553 into xen-troops:main Nov 21, 2023
@lorc
Copy link
Collaborator

lorc commented Nov 21, 2023

Fixed #91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants