Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • limansky/gitaly
  • cmingxu/gitaly
  • bugrargn/gitaly
  • asedge/gitaly
  • softwareplumber/gitaly
  • gitlab-org/gitaly
  • armbiant/gitlab-gitaly
  • sinwav/gitaly
  • Mattlk13/gitaly
  • Ruby-and-Friends/gitaly
  • kutelev/gitaly
  • bbodenmiller/gitaly
  • alejandro/gitaly
  • lukeshu/gitaly
  • eddiet/gitaly
  • mpoornima/gitaly
  • dturner_ts/gitaly
  • zj-gitlab/gitaly
  • nadiavu/gitaly
  • balasankarc/gitaly
  • mpszone/gitaly
  • sysu-liyanliang/gitaly
  • frenkel/gitaly
  • lfauts/gitaly
  • yang-zaixin/gitaly
  • mydigitalself/gitaly
  • litongdeng/gitaly
  • toon/gitaly
  • axot/gitaly
  • josecordaz/gitaly
  • sj14/gitaly
  • MaykonOliveira/gitaly
  • zjkyz8/gitaly
  • svankmajer/gitaly
  • qipa/gitaly
  • sptr/gitaly
  • kiameisomabes/gitaly
  • bradobro/gitaly
  • fcgravalos/gitaly
  • reprazent/gitaly
  • tbuida/gitaly
  • arjunmayilvaganan/gitaly
  • b1n/gitaly
  • timniederhausen/gitaly
  • maksim-paskal/gitaly
  • zhutiankai/gitaly
  • maxmati/gitaly
  • 358141721/gitaly
  • despinosa/gitaly
  • c.bianchi/gitaly
  • tamilselvan10021998/gitaly
  • Randomneo/gitaly
  • yemanaung/gitaly
  • siemens/gitaly
  • avar/gitaly
  • SeananXu/gitaly
  • smusavi/gitaly
  • johncai/gitaly
  • utkarsh2102/gitaly
  • jhenkens/gitaly
  • ba2014sheer/gitaly
  • jacobvosmaer-gitlab/gitaly
  • Esteban_Carnuccio/gitaly
  • d0c-s4vage/gitaly
  • thetradedesk/gitaly
  • AfolabiOlaoluwa/gitaly
  • njkevlani/gitaly
  • chriscool/gitaly
  • ethan.gitlab/gitaly
  • GeniusLearner/gitaly
  • wasphin/gitaly
  • CauhxMilloy/gitaly
  • nnelson/gitaly
  • simchatop/gitaly
  • htkaslan/gitaly
  • hemanthdev/gitaly
  • shovanmaity/gitaly
  • Temtaime/gitaly
  • Ash560/gitaly
  • gitlab-bot-readonly/gitaly
  • tylerthetester/gitaly
  • sushovan/gitaly
  • shy-Xu/gitaly
  • thmr1/gitaly
  • pravi/gitaly
  • EphremDms/gitaly
  • sluongng/gitaly
  • nejc/gitaly
  • ksashikumar/gitaly
  • motogami/gitaly
  • bs223617/gitaly
  • eagle_fly_sky/gitaly
  • hashworks/gitaly
  • anatol.pomozov/gitaly
  • T4cC0re/gitaly
  • ethan.reesor/contrib/gitaly
  • czh592/gitaly
  • wchandler/gitaly
  • diogo_nicoleti_ifood/gitaly
  • bulemka12345poczta/gitaly
  • taroguru/gitaly
  • dyrone/gitaly
  • inguin/gitaly
  • mathieuusoyan/gitaly
  • mfechner/gitaly
  • wwwicbd/icbd-gitaly
  • blanet/gitaly
  • paulsd2020/gitaly
  • harry-hov/gitaly
  • pranav/gitaly
  • abhitidarbar/gitaly
  • heygirlhey356/gitaly
  • maoqiang/gitaly
  • yyexplore/gitaly
  • cgsyam/gitaly
  • behrmann/gitaly
  • nfishe/gitaly
  • g4s8/gitaly
  • brett.higgins/gitaly
  • test11042/gitaly
  • jeffzhu503/gitaly
  • TheSide/gitaly
  • nanmu42/gitaly
  • van4elotti/gitaly
  • Cactusinhand/gitaly
  • yamini.bhaskar007/gitaly
  • icbd/gitaly
  • ooulwluoo/gitaly
  • nagypeter/gitaly
  • Abhilashsiyer/gitaly
  • jiangxin/gitaly
  • KimJi55/gitaly
  • flycutter/gitaly
  • leonard-adleman-sec/gitaly
  • ryan-qianchen/gitaly
  • feistel/gitaly
  • snowcrystall/gitaly
  • edith007/gitaly
  • zhanglinjie/gitaly
  • luminarrr/gitaly
  • stephankirsten/gitaly
  • etanot/gitaly
  • nikovega21/gitaly
  • m0rosan/gitaly
  • HaroldKnowlden/gitaly
  • iotcl/test/gitaly
  • okenwaonyebuchi103/gitaly
  • simpleclickers/gitaly
  • kdaudt/gitaly
  • YushuaiLI/gitaly
  • davebarr/gitaly
  • dgsdoug/gitaly
  • trakos/gitaly
  • XciD/gitaly
  • imskr/gitaly
  • mj.bruijns/gitaly
  • markoke256/gitaly
  • Sahil162/gitaly
  • Kartik1397/gitaly
  • akumar1503/gitaly
  • bill2022/gitaly
  • ncu_gsoc/gitaly
  • SURA907/gitaly
  • hongeinh/gitaly
  • joshua.sickmeyer/gitaly
  • adlternative/gitaly
  • amstal93/gitaly
  • gitlab-renovate-forks/gitaly
  • xiaowenxia/gitaly
  • checkscale-gitlab/gitaly
  • KyleFromKitware/gitaly
  • n0h4ppy/gitaly
  • pwn3/gitaly
  • jokerpwn/gitaly
  • salamacha7389/gitaly
  • L11R/gitaly
  • hanmingliang/gitaly
  • Isengart1/gitaly
  • cbj/gitaly
  • gitlab-community/gitaly
  • shamanthb90/gitaly
  • mjkalasky2/gitaly
  • VladPetriv/gitaly
  • arkn98/gitaly
  • scwang18/gitaly
  • sebicioacata/gitaly
  • edsonmichaque/gitaly
  • Kexin2000/gitaly
  • johnwparent/gitaly
  • kevin.rojas/wr-gitaly
  • marc.ratombotsoa/gitaly
  • igor.drozdov/gitaly
  • radityasurya1911/gitaly
  • CS2Us/gitaly
  • RryLee/gitaly
  • liruixin-coding/gitaly
  • gerardo/gitaly
  • josephburnett/gitaly
  • b.s.strelnikov_tinkoff/gitaly
  • OK_MF/gitaly-fork
  • zeb0x01/gitaly
  • 8bitlife/gitaly
  • nraj0408/gitaly
  • troyfox758/gitaly
  • ouladsine.saloua/gitaly
  • qeesung/gitaly
  • dzcdada123/gitaly
  • ashmckenzie/gitaly
  • Freedisch/gitaly
  • xsizxenjin/gitaly
  • eric.p.ju/gitaly
  • zzhzero/gitaly
  • lenghan1991/gitaly
  • jhammer101/gitaly
  • wheredidfranciscogo1/gitaly
  • zakiir206/gitaly
  • jonas.hogman/gitaly
  • sauravchanda9/gitaly
  • lzampier/gitaly
  • fkhe/gitaly
  • liaoxingju/gitaly
  • bufdev/gitaly
  • a.songer/gitaly
  • bcooksley/gitaly
  • Wangyadong1108/gitaly
  • MashyBasker/gitaly
  • nickaldwin/gitaly
  • avevlad/gitaly
  • sat-h/gitaly
  • wingred96399/gitaly-mine
  • chen_feng/gitaly
  • grootwang/gitaly
  • bhatianikhil551/gitaly
  • schuam_alice/gitaly
  • armbiant/hive-gitaly
  • ollevche/gitaly
  • HassanAkbar/gitaly
  • echui-gitlab/gitaly
  • ebrahim.poursadeghi/gitaly
239 results
Show changes
Commits on Source (7)
Showing
with 184 additions and 41 deletions
# Gitaly changelog
## v1.17.0
#### Other
- Add glProjectPath to logs
https://gitlab.com/gitlab-org/gitaly/merge_requests/1049
- Switch from commitsSender to chunker
https://gitlab.com/gitlab-org/gitaly/merge_requests/1060
#### Security
- Disable git protocol v2 temporarily
https://gitlab.com/gitlab-org/gitaly/merge_requests/
## v1.16.0
......@@ -33,6 +45,12 @@
- Rewrite CommitStats in Go
https://gitlab.com/gitlab-org/gitaly/merge_requests/1048
## v1.14.1
#### Security
- Disable git protocol v2 temporarily
https://gitlab.com/gitlab-org/gitaly/merge_requests/
## v1.14.0
#### Fixed
......@@ -89,6 +107,20 @@
- Remove unused Ruby rebase/squash code
https://gitlab.com/gitlab-org/gitaly/merge_requests/1033
## v1.12.2
#### Security
- Disable git protocol v2 temporarily
https://gitlab.com/gitlab-org/gitaly/merge_requests/
## v1.12.1
#### Fixed
- Fix flaky rebase test
https://gitlab.com/gitlab-org/gitaly/merge_requests/1028
- Fix regression for https_proxy and unix socket connections
https://gitlab.com/gitlab-org/gitaly/merge_requests/1032
## v1.12.0
#### Fixed
......@@ -137,6 +169,16 @@
- README cleanup
https://gitlab.com/gitlab-org/gitaly/merge_requests/996
## v1.7.2
#### Other
- Fix tests failing due to test-repo change
https://gitlab.com/gitlab-org/gitaly/merge_requests/1004
#### Security
- Disable git protocol v2 temporarily
https://gitlab.com/gitlab-org/gitaly/merge_requests/
## v1.7.1
#### Other
......@@ -255,6 +297,16 @@
- Support SSH credentials for push mirroring
https://gitlab.com/gitlab-org/gitaly/merge_requests/959
## v0.129.1
#### Other
- Fix tests failing due to test-repo change
https://gitlab.com/gitlab-org/gitaly/merge_requests/1004
#### Security
- Disable git protocol v2 temporarily
https://gitlab.com/gitlab-org/gitaly/merge_requests/
## v0.129.0
#### Added
......
1.16.0
1.17.0
---
title: Make clear there is no []byte reuse bug in SearchFilesByContent
merge_request: 1055
author:
type: other
---
title: Switch from commitsSender to chunker
merge_request: 1060
author:
type: other
---
title: Add glProjectPath to logs
merge_request: 1049
author:
type: other
......@@ -49,6 +49,17 @@ type GitlabShell struct {
// Git contains the settings for the Git executable
type Git struct {
BinPath string `toml:"bin_path"`
// ProtocolV2Enabled can be set to true to enable the newer Git protocol
// version. This should not be enabled until GitLab *either* stops
// using transfer.hideRefs for security purposes, *or* Git protocol v2
// respects this setting:
//
// https://public-inbox.org/git/20181213155817.27666-1-avarab@gmail.com/T/
//
// This is not user-configurable. Once a new Git version has been released,
// we can add code to enable it if the detected git binary is new enough
ProtocolV2Enabled bool
}
// Storage contains a single storage-shard
......
......@@ -7,6 +7,8 @@ import (
grpc_ctxtags "github.com/grpc-ecosystem/go-grpc-middleware/tags"
"github.com/prometheus/client_golang/prometheus"
"gitlab.com/gitlab-org/gitaly/internal/config"
)
const (
......@@ -39,9 +41,13 @@ func AddGitProtocolEnv(ctx context.Context, req RequestWithGitProtocol, env []st
service, method := methodFromContext(ctx)
if req.GetGitProtocol() == ProtocolV2 {
env = append(env, fmt.Sprintf("GIT_PROTOCOL=%s", ProtocolV2))
if config.Config.Git.ProtocolV2Enabled {
env = append(env, fmt.Sprintf("GIT_PROTOCOL=%s", ProtocolV2))
gitProtocolRequests.WithLabelValues(service, method, "v2").Inc()
gitProtocolRequests.WithLabelValues(service, method, "v2").Inc()
} else {
gitProtocolRequests.WithLabelValues(service, method, "v2-rejected").Inc()
}
} else {
gitProtocolRequests.WithLabelValues(service, method, "v0").Inc()
}
......
package git
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/internal/config"
)
type fakeProtocolMessage struct {
protocol string
}
func (f fakeProtocolMessage) GetGitProtocol() string {
return f.protocol
}
func setGitProtocolV2Support(value bool) func() {
orig := config.Config.Git.ProtocolV2Enabled
config.Config.Git.ProtocolV2Enabled = value
return func() {
config.Config.Git.ProtocolV2Enabled = orig
}
}
func TestAddGitProtocolEnvRespectsConfigEnabled(t *testing.T) {
restore := setGitProtocolV2Support(true)
defer restore()
env := []string{"fake=value"}
msg := fakeProtocolMessage{protocol: "version=2"}
value := AddGitProtocolEnv(context.Background(), msg, env)
require.Equal(t, value, append(env, "GIT_PROTOCOL=version=2"))
}
func TestAddGitProtocolEnvWhenV2NotRequested(t *testing.T) {
restore := setGitProtocolV2Support(true)
defer restore()
env := []string{"fake=value"}
msg := fakeProtocolMessage{protocol: ""}
value := AddGitProtocolEnv(context.Background(), msg, env)
require.Equal(t, value, env)
}
func TestAddGitProtocolEnvRespectsConfigDisabled(t *testing.T) {
restore := setGitProtocolV2Support(false)
defer restore()
env := []string{"fake=value"}
msg := fakeProtocolMessage{protocol: "GIT_PROTOCOL=version=2"}
value := AddGitProtocolEnv(context.Background(), msg, env)
require.Equal(t, value, env)
}
......@@ -122,8 +122,13 @@ func sendSearchFilesResultChunked(cmd *command.Command, stream gitalypb.Reposito
scanner := bufio.NewScanner(cmd)
for scanner.Scan() {
line := append(scanner.Bytes(), '\n')
if bytes.Equal(line, contentDelimiter) {
// Intentionally avoid scanner.Bytes() because that returns a []byte that
// becomes invalid on the next loop iteration, and we want to hold on to
// the contents of the current line for a while. Scanner.Text() is a
// string and hence immutable.
line := scanner.Text() + "\n"
if line == string(contentDelimiter) {
if err := sendMatchInChunks(buf, stream); err != nil {
return err
}
......
/testdata/scratch
......@@ -10,7 +10,6 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/config"
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/streamio"
......@@ -54,10 +53,8 @@ func TestSuccessfulInfoRefsUploadPackWithGitConfigOptions(t *testing.T) {
}
func TestSuccessfulInfoRefsUploadPackWithGitProtocol(t *testing.T) {
defer func(old string) {
config.Config.Git.BinPath = old
}(config.Config.Git.BinPath)
config.Config.Git.BinPath = "../../testhelper/env_git"
restore := testhelper.EnableGitProtocolV2Support()
defer restore()
server, serverSocketPath := runSmartHTTPServer(t)
defer server.Stop()
......@@ -148,7 +145,7 @@ func TestFailureRepoNotFoundInfoRefsReceivePack(t *testing.T) {
client, conn := newSmartHTTPClient(t, serverSocketPath)
defer conn.Close()
repo := &gitalypb.Repository{StorageName: "default", RelativePath: "testdata/data/another_repo"}
repo := &gitalypb.Repository{StorageName: "default", RelativePath: "testdata/scratch/another_repo"}
rpcRequest := &gitalypb.InfoRefsRequest{Repository: repo}
ctx, cancel := context.WithCancel(context.Background())
......
......@@ -68,10 +68,8 @@ func TestSuccessfulReceivePackRequest(t *testing.T) {
}
func TestSuccessfulReceivePackRequestWithGitProtocol(t *testing.T) {
defer func(old string) {
config.Config.Git.BinPath = old
}(config.Config.Git.BinPath)
config.Config.Git.BinPath = "../../testhelper/env_git"
restore := testhelper.EnableGitProtocolV2Support()
defer restore()
server, serverSocketPath := runSmartHTTPServer(t)
defer server.Stop()
......
../../../testhelper/env_git
\ No newline at end of file
......@@ -15,7 +15,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/config"
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git/pktline"
"gitlab.com/gitlab-org/gitaly/internal/helper"
......@@ -149,10 +148,8 @@ func TestUploadPackRequestWithGitConfigOptions(t *testing.T) {
}
func TestUploadPackRequestWithGitProtocol(t *testing.T) {
defer func(old string) {
config.Config.Git.BinPath = old
}(config.Config.Git.BinPath)
config.Config.Git.BinPath = "../../testhelper/env_git"
restore := testhelper.EnableGitProtocolV2Support()
defer restore()
server, serverSocketPath := runSmartHTTPServer(t)
defer server.Stop()
......
/testdata
/testdata/scratch
......@@ -106,10 +106,8 @@ func TestReceivePackPushSuccess(t *testing.T) {
}
func TestReceivePackPushSuccessWithGitProtocol(t *testing.T) {
defer func(old string) {
config.Config.Git.BinPath = old
}(config.Config.Git.BinPath)
config.Config.Git.BinPath = "../../testhelper/env_git"
restore := testhelper.EnableGitProtocolV2Support()
defer restore()
server, serverSocketPath := runSSHServer(t)
defer server.Stop()
......
../../../testhelper/env_git
\ No newline at end of file
......@@ -14,7 +14,7 @@ import (
)
const (
testPath = "testdata"
testPath = "testdata/scratch"
testRepoRoot = testPath + "/data"
)
......
......@@ -13,7 +13,6 @@ import (
"github.com/golang/protobuf/jsonpb"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/config"
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"google.golang.org/grpc/codes"
......@@ -98,10 +97,8 @@ func TestUploadPackCloneSuccess(t *testing.T) {
}
func TestUploadPackCloneSuccessWithGitProtocol(t *testing.T) {
defer func(old string) {
config.Config.Git.BinPath = old
}(config.Config.Git.BinPath)
config.Config.Git.BinPath = "../../testhelper/env_git"
restore := testhelper.EnableGitProtocolV2Support()
defer restore()
server, serverSocketPath := runSSHServer(t)
defer server.Stop()
......
package testhelper
import (
"gitlab.com/gitlab-org/gitaly/internal/config"
)
// EnableGitProtocolV2Support ensures that Git protocol v2 support is enabled,
// and replaces the git binary in config with an `env_git` wrapper that allows
// the protocol to be tested. It returns a function that restores the given
// settings.
//
// Because we don't know how to get to that wrapper script from the current
// working directory, callers must create a symbolic link to the `env_git` file
// in their own `testdata` directories.
func EnableGitProtocolV2Support() func() {
oldGitBinPath := config.Config.Git.BinPath
oldGitProtocolV2Enabled := config.Config.Git.ProtocolV2Enabled
config.Config.Git.BinPath = "testdata/env_git"
config.Config.Git.ProtocolV2Enabled = true
return func() {
config.Config.Git.BinPath = oldGitBinPath
config.Config.Git.ProtocolV2Enabled = oldGitProtocolV2Enabled
}
}