Commit 2577e05b authored by Aleksei Lipniagov's avatar Aleksei Lipniagov

Merge branch 'jv-gitlab-shell-sidechannel' into 'master'

Add gitlab_shell_upload_pack_sidechannel feature flag

See merge request gitlab-org/gitlab!78668
parents ac5eb557 38098d0d
---
name: gitlab_shell_upload_pack_sidechannel
introduced_by_url:
rollout_issue_url:
milestone: '14.8'
type: development
group: group::scalability
default_enabled: false
......@@ -124,7 +124,8 @@ module API
repository: repository.gitaly_repository.to_h,
address: Gitlab::GitalyClient.address(repository.shard),
token: Gitlab::GitalyClient.token(repository.shard),
features: Feature::Gitaly.server_feature_flags(repository.project)
features: Feature::Gitaly.server_feature_flags(repository.project),
use_sidechannel: Feature.enabled?(:gitlab_shell_upload_pack_sidechannel, repository.project, default_enabled: :yaml)
}
end
end
......
......@@ -612,6 +612,30 @@ RSpec.describe API::Internal::Base do
expect(json_response["gitaly"]["features"]).to eq('gitaly-feature-mep-mep' => 'false')
end
end
context "with a sidechannels enabled for a project" do
before do
stub_feature_flags(gitlab_shell_upload_pack_sidechannel: project)
end
it "has the use_sidechannel field set to true for that project" do
pull(key, project)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response["gl_repository"]).to eq("project-#{project.id}")
expect(json_response["gitaly"]["use_sidechannel"]).to eq(true)
end
it "has the use_sidechannel field set to false for other projects" do
other_project = create(:project, :public, :repository)
pull(key, other_project)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response["gl_repository"]).to eq("project-#{other_project.id}")
expect(json_response["gitaly"]["use_sidechannel"]).to eq(false)
end
end
end
context "git push" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment