[Notes] [Git][BuildStream/buildstream][master] 5 commits: _gitsourcebase.py: Fetch with explicit refspecs



Title: GitLab

Valentin David pushed to branch master at BuildStream / buildstream

Commits:

5 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -31,6 +31,7 @@ variables:
    31 31
       - df -h
    
    32 32
     
    
    33 33
       script:
    
    34
    +  - mkdir -p "${INTEGRATION_CACHE}"
    
    34 35
       - useradd -Um buildstream
    
    35 36
       - chown -R buildstream:buildstream .
    
    36 37
     
    
    ... ... @@ -70,6 +71,10 @@ tests-python-3.7-stretch:
    70 71
         # some of our base dependencies declare it as their runtime dependency.
    
    71 72
         TOXENV: py37
    
    72 73
     
    
    74
    +tests-centos-7.6:
    
    75
    +  <<: *tests
    
    76
    +  image: buildstream/testsuite-centos:7.6-5da27168-32c47d1c
    
    77
    +
    
    73 78
     overnight-fedora-28-aarch64:
    
    74 79
       image: buildstream/testsuite-fedora:aarch64-28-5da27168-32c47d1c
    
    75 80
       tags:
    

  • buildstream/_gitsourcebase.py
    ... ... @@ -112,7 +112,8 @@ class GitMirror(SourceFetcher):
    112 112
             else:
    
    113 113
                 remote_name = "origin"
    
    114 114
     
    
    115
    -        self.source.call([self.source.host_git, 'fetch', remote_name, '--prune', '--force', '--tags'],
    
    115
    +        self.source.call([self.source.host_git, 'fetch', remote_name, '--prune',
    
    116
    +                          '+refs/heads/*:refs/heads/*', '+refs/tags/*:refs/tags/*'],
    
    116 117
                              fail="Failed to fetch from remote git repository: {}".format(url),
    
    117 118
                              fail_temporarily=True,
    
    118 119
                              cwd=self.mirror)
    

  • tests/frontend/workspace.py
    ... ... @@ -204,6 +204,7 @@ def test_open_multi(cli, tmpdir, datafiles):
    204 204
                 assert not ('.bzr' in workspace_lsdir)
    
    205 205
     
    
    206 206
     
    
    207
    +@pytest.mark.skipif(os.geteuid() == 0, reason="root may have CAP_DAC_OVERRIDE and ignore permissions")
    
    207 208
     @pytest.mark.datafiles(DATA_DIR)
    
    208 209
     def test_open_multi_unwritable(cli, tmpdir, datafiles):
    
    209 210
         workspace_object = WorkspaceCreater(cli, tmpdir, datafiles)
    

  • tests/sources/git.py
    ... ... @@ -30,7 +30,7 @@ from buildstream import _yaml
    30 30
     from buildstream.plugin import CoreWarnings
    
    31 31
     
    
    32 32
     from tests.testutils import cli, create_repo
    
    33
    -from tests.testutils.site import HAVE_GIT
    
    33
    +from tests.testutils.site import HAVE_GIT, HAVE_OLD_GIT
    
    34 34
     
    
    35 35
     DATA_DIR = os.path.join(
    
    36 36
         os.path.dirname(os.path.realpath(__file__)),
    
    ... ... @@ -664,6 +664,7 @@ def test_invalid_submodule(cli, tmpdir, datafiles, fail):
    664 664
     
    
    665 665
     
    
    666 666
     @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available")
    
    667
    +@pytest.mark.skipif(HAVE_OLD_GIT, reason="old git rm does not update .gitmodules")
    
    667 668
     @pytest.mark.datafiles(os.path.join(DATA_DIR, 'template'))
    
    668 669
     @pytest.mark.parametrize("fail", ['warn', 'error'])
    
    669 670
     def test_track_invalid_submodule(cli, tmpdir, datafiles, fail):
    
    ... ... @@ -772,6 +773,7 @@ def test_track_fetch(cli, tmpdir, datafiles, ref_format, tag, extra_commit):
    772 773
     
    
    773 774
     
    
    774 775
     @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available")
    
    776
    +@pytest.mark.skipif(HAVE_OLD_GIT, reason="old git describe lacks --first-parent")
    
    775 777
     @pytest.mark.datafiles(os.path.join(DATA_DIR, 'template'))
    
    776 778
     @pytest.mark.parametrize("ref_storage", [('inline'), ('project.refs')])
    
    777 779
     @pytest.mark.parametrize("tag_type", [('annotated'), ('lightweight')])
    

  • tests/testutils/site.py
    ... ... @@ -2,6 +2,7 @@
    2 2
     # so we dont have to repeat this everywhere
    
    3 3
     #
    
    4 4
     import os
    
    5
    +import subprocess
    
    5 6
     import sys
    
    6 7
     
    
    7 8
     from buildstream import _site, utils, ProgramNotFoundError
    
    ... ... @@ -16,8 +17,12 @@ except ProgramNotFoundError:
    16 17
     try:
    
    17 18
         utils.get_host_tool('git')
    
    18 19
         HAVE_GIT = True
    
    20
    +    out = str(subprocess.check_output(['git', '--version']), "utf-8")
    
    21
    +    version = tuple(int(x) for x in out.split(' ', 2)[2].split('.'))
    
    22
    +    HAVE_OLD_GIT = version < (1, 8, 5)
    
    19 23
     except ProgramNotFoundError:
    
    20 24
         HAVE_GIT = False
    
    25
    +    HAVE_OLD_GIT = False
    
    21 26
     
    
    22 27
     try:
    
    23 28
         utils.get_host_tool('ostree')
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]