Skip to content
Snippets Groups Projects
Select Git revision
  • feat/repo-assignment-migration
  • master default protected
  • kn-fix-migration-context
  • sh-limit-praefect-connection-age
  • ec/raft-snapshotting-streaming
  • qmnguyen0711/backfill-missing-fsync-when-writing-manifest
  • qmnguyen0711/integrate-etcd-raft-with-transactions-v2
  • eju/gitaly/6506/6640/prepare-offloading
  • activate-bundle-uri-generation
  • jc/my-branch
  • mbayar/bump-minimum-go-version
  • 6270-restore-partition
  • 6628-persistent-routing-table
  • jliu/bump-module-version-to-v17
  • mb-fix-crypto-vuln
  • 17-7-stable protected
  • 17-8-stable protected
  • 17-9-stable protected
  • gitaly-renovate-tools/golangci-lint/golang.org-x-tools-0.x
  • 6626-dry-run-reftable-migration-on-staging
  • v17.7.6 protected
  • v17.8.4 protected
  • v17.9.1 protected
  • v17.8.3 protected
  • v17.7.5 protected
  • v17.9.0 protected
  • v17.9.0-rc42 protected
  • v17.6.5 protected
  • v17.7.4 protected
  • v17.8.2 protected
  • v17.6.4 protected
  • v17.7.3 protected
  • v17.8.1 protected
  • v17.8.0 protected
  • v17.7.2 protected
  • v17.8.0-rc42 protected
  • v17.5.5 protected
  • v17.6.3 protected
  • v17.7.1 protected
  • v17.7.0 protected
40 results

Makefile

  • Patrick Steinhardt's avatar
    ea6e25fe
    Makefile: fix default ref format propagating into build prereqs · ea6e25fe
    Patrick Steinhardt authored
    The `test-with-reftable` CI job executes the "test-go" target, where the
    only difference to our normal test target is that it also exports the
    "GIT_DEFAULT_REF_FORMAT" environment variable. This environment variable
    gets exported into all dependencies, which causes us to initialize repos
    other than the test repositories created by our actual unit tests with
    the "reftable" format. This includes for example the bundled Git repos.
    
    This causes an issue with CI caches: it can happen that a job gets a CI
    cache that uses the "files" format for the bundled Git repos, but the
    default ref format is "reftable". This causes the following error when
    reinitializing the directoy:
    
        fatal: could not open '/builds/gitlab-org/gitaly/_build/deps/git-v2.48/.git/refs/heads' for writing: Is a directory
    
    The issue here is that git-init(1) tries to reinitialize the repository
    with the wrong ref format. When doing so it wants to write "refs/heads"
    as a file containing garbage to keep other Git clients which aren't yet
    aware of the "reftable" format from reading the repository. But because
    the repo uses the "files" format the path is a directory, and thus
    writing the file fails.
    
    The issue can be trivially reproduced with an up-to-date Git version:
    
        $ git init --ref-format=files repo
        Initialized empty Git repository in /tmp/repo/.git/
        $ GIT_DEFAULT_REF_FORMAT=reftable git init repo
        fatal: could not open '/tmp/repo/.git/refs/heads' for writing: Is a directory
    
    Even though this is an upstream bug, it still doesn't make sense for us
    to propagate the `GIT_DEFAULT_REF_FORMAT` environment variable into all
    build prerequisites. Fix this by using a Gitaly-specific environment
    variable instead and setting it up when configuring our tests.
    ea6e25fe
    History
    Makefile: fix default ref format propagating into build prereqs
    Patrick Steinhardt authored
    The `test-with-reftable` CI job executes the "test-go" target, where the
    only difference to our normal test target is that it also exports the
    "GIT_DEFAULT_REF_FORMAT" environment variable. This environment variable
    gets exported into all dependencies, which causes us to initialize repos
    other than the test repositories created by our actual unit tests with
    the "reftable" format. This includes for example the bundled Git repos.
    
    This causes an issue with CI caches: it can happen that a job gets a CI
    cache that uses the "files" format for the bundled Git repos, but the
    default ref format is "reftable". This causes the following error when
    reinitializing the directoy:
    
        fatal: could not open '/builds/gitlab-org/gitaly/_build/deps/git-v2.48/.git/refs/heads' for writing: Is a directory
    
    The issue here is that git-init(1) tries to reinitialize the repository
    with the wrong ref format. When doing so it wants to write "refs/heads"
    as a file containing garbage to keep other Git clients which aren't yet
    aware of the "reftable" format from reading the repository. But because
    the repo uses the "files" format the path is a directory, and thus
    writing the file fails.
    
    The issue can be trivially reproduced with an up-to-date Git version:
    
        $ git init --ref-format=files repo
        Initialized empty Git repository in /tmp/repo/.git/
        $ GIT_DEFAULT_REF_FORMAT=reftable git init repo
        fatal: could not open '/tmp/repo/.git/refs/heads' for writing: Is a directory
    
    Even though this is an upstream bug, it still doesn't make sense for us
    to propagate the `GIT_DEFAULT_REF_FORMAT` environment variable into all
    build prerequisites. Fix this by using a Gitaly-specific environment
    variable instead and setting it up when configuring our tests.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.