Commit 8f72d6de authored by Robert Speicher's avatar Robert Speicher

Merge branch '1648-remove-support-for-git-annex' into 'master'

Remove support for Git Annex

See merge request !1302
parents d5a41e47 a13c91a4
......@@ -10,11 +10,6 @@ class Profiles::KeysController < Profiles::ApplicationController
@key = current_user.keys.find(params[:id])
end
# Back-compat: We need to support this URL since git-annex webapp points to it
def new
redirect_to profile_keys_path
end
def create
@key = current_user.keys.new(key_params)
......
......@@ -7,4 +7,4 @@
%li
The update action will time out after 10 minutes. For big repositories, use a clone/push combination.
%li
The Git LFS/Annex objects will <strong>not</strong> be synced.
The Git LFS objects will <strong>not</strong> be synced.
......@@ -15,7 +15,7 @@
%li
To migrate an SVN repository, check out #{link_to "this document", help_page_path('workflow/importing/migrating_from_svn')}.
%li
The Git LFS/Annex objects will <strong>not</strong> be imported.
The Git LFS objects will <strong>not</strong> be imported.
.form-group
.col-sm-offset-2.col-sm-10
......@@ -26,6 +26,6 @@
Mirror repository
.help-block
Automatically update this project's branches and tags from the upstream
repository every hour. The Git LFS/Annex objects will not be synced.
repository every hour. The Git LFS objects will not be synced.
= f.hidden_field :mirror_user_id, value: current_user.id
---
title: Remove support for Git Annex
merge_request:
author:
......@@ -577,11 +577,6 @@ production: &base
# If you use non-standard ssh port you need to specify it
# ssh_port: 22
# git-annex support (EE only)
# If this setting is set to true, the same setting in config.yml of
# gitlab-shell needs to be set to true
# git_annex_enabled: false
## Git settings
# CAUTION!
# Use the default values unless you really know what you are doing
......
......@@ -428,7 +428,6 @@ Settings.gitlab_shell['ssh_port'] ||= 22
Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user
Settings.gitlab_shell['owner_group'] ||= Settings.gitlab.user
Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.send(:build_gitlab_shell_ssh_path_prefix)
Settings.gitlab_shell['git_annex_enabled'] ||= false
#
# Repositories
......
......@@ -21,7 +21,7 @@ resource :profile, only: [:show, :update] do
end
end
resource :preferences, only: [:show, :update]
resources :keys, only: [:index, :show, :new, :create, :destroy]
resources :keys, only: [:index, :show, :create, :destroy]
resources :emails, only: [:index, :create, :destroy]
resources :chat_names, only: [:index, :new, :create, :destroy] do
collection do
......
......@@ -63,7 +63,6 @@
- [Reply by email](administration/reply_by_email.md) Allow users to comment on issues and merge requests by replying to notification emails.
- [Migrate GitLab CI to CE/EE](migrate_ci_to_ce/README.md) Follow this guide to migrate your existing GitLab CI data to GitLab CE/EE.
- [Downgrade back to CE](downgrade_ee_to_ce/README.md) Follow this guide if you need to downgrade from EE to CE.
- [git-annex configuration](workflow/git_annex.md#configuration)
- [Git LFS configuration](workflow/lfs/lfs_administration.md)
- [Housekeeping](administration/housekeeping.md) Keep your Git repository tidy and fast.
- [GitLab Pages configuration](administration/pages/index.md) Configure GitLab Pages.
......
......@@ -308,8 +308,8 @@ Running on runner-8a2f473d-project-1796893-concurrent-0 via runner-8a2f473d-mach
++ CI_RUNNER_ID=1337
++ export CI_RUNNER_DESCRIPTION=shared-runners-manager-1.example.com
++ CI_RUNNER_DESCRIPTION=shared-runners-manager-1.example.com
++ export 'CI_RUNNER_TAGS=shared, docker, linux, ruby, mysql, postgres, mongo, git-annex'
++ CI_RUNNER_TAGS='shared, docker, linux, ruby, mysql, postgres, mongo, git-annex'
++ export 'CI_RUNNER_TAGS=shared, docker, linux, ruby, mysql, postgres, mongo'
++ CI_RUNNER_TAGS='shared, docker, linux, ruby, mysql, postgres, mongo'
++ export CI_REGISTRY=registry.example.com
++ CI_REGISTRY=registry.example.com
++ export CI_DEBUG_TRACE=true
......
......@@ -15,13 +15,6 @@ Kerberos and Atlassian Crowd are only available on the Enterprise Edition, so
you should disable these mechanisms before downgrading and you should provide
alternative authentication methods to your users.
### Git Annex
Git Annex is also only available on the Enterprise Edition. This means that if
you have repositories that use Git Annex to store large files, these files will
no longer be easily available via Git. You should consider migrating these
repositories to use Git LFS before downgrading to the Community Edition.
### Remove Jenkins CI Service entries from the database
The `JenkinsService` class is only available on the Enterprise Edition codebase,
......
......@@ -79,7 +79,6 @@ See more details in the [Configure GitLab](configuration.md) step.
- You cannot push code to secondary nodes
- Git LFS is not supported yet
- Git Annex is not supported yet
- Primary node has to be online for OAuth login to happen (existing sessions and git are not affected)
## Frequently Asked Questions
......@@ -100,7 +99,7 @@ We currently replicate project repositories and the whole database. This
means user accounts, issues, merge requests, groups, project data, etc.,
will be available for query.
We currently don't replicate user generated attachments / avatars or any
other file in `public/upload`. We also don't replicate LFS / Annex or
other file in `public/upload`. We also don't replicate LFS or
artifacts data (`shared/folder`).
### Can I git push to a secondary node?
......
......@@ -130,7 +130,6 @@ The curriculum is composed of GitLab videos, screencasts, presentations, project
1. [GitLab Flow Overview](https://about.gitlab.com/2014/09/29/gitlab-flow/)
1. [Always Start with an Issue](https://about.gitlab.com/2016/03/03/start-with-an-issue/)
1. [GitLab Flow Documentation](https://docs.gitlab.com/ee/workflow/gitlab_flow.html)
1. [Git-Annex to Git-LFS Migration Guide](https://docs.gitlab.com/ee/workflow/lfs/migrate_from_git-annex_to_git-lfs.html)
#### 2.5. GitLab Comparisons
......@@ -166,7 +165,7 @@ The curriculum is composed of GitLab videos, screencasts, presentations, project
#### 3.4. Large Files
1. [Big files in Git (Git LFS, Annex) - Video](https://www.youtube.com/watch?v=DawznUxYDe4)
1. [Big files in Git (Git LFS) - Video](https://www.youtube.com/watch?v=DawznUxYDe4)
#### 3.5. LDAP and Active Directory
......
......@@ -167,7 +167,6 @@ Some tickets need specific knowledge or a deep understanding of a particular com
Move on to understanding some of GitLab's more advanced features. You can make use of GitLab.com to understand the features from an end-user perspective and then use your own instance to understand setup and configuration of the feature from an Administrative perspective
- Set up and try [Git Annex](https://docs.gitlab.com/ee/workflow/git_annex.html)
- Set up and try [Git LFS](https://docs.gitlab.com/ee/workflow/lfs/manage_large_binaries_with_git_lfs.html)
- Get to know the [GitLab API](https://docs.gitlab.com/ee/api/README.html), its capabilities and shortcomings
- Learn how to [migrate from SVN to Git](https://docs.gitlab.com/ee/workflow/importing/migrating_from_svn.html)
......
......@@ -17,8 +17,6 @@
- (EE) [File lock](../user/project/file_lock.md)
- [Labels](../user/project/labels.md)
- (EE) [Issue weight](issue_weight.md)
- (EE) [Manage large binaries with git annex](git_annex.md)
- [Git-Annex to Git-LFS Migration Guide](lfs/migrate_from_git_annex_to_git_lfs.html)
- [Notification emails](notifications.md)
- [Project Features](project_features.md)
- [Project forking workflow](forking_workflow.md)
......
# Git annex
> **Warning:** GitLab is deprecating git-annex support
from GitLab 8.17 (2017/02/22) on. It will be [completely
> **Warning:** GitLab has [completely
removed][deprecate-annex-issue] in GitLab 9.0 (2017/03/22).
Read through the [migration guide from git-annex to git-lfs][guide].
......
......@@ -3,12 +3,6 @@
Managing large files such as audio, video and graphics files has always been one of the shortcomings of Git.
The general recommendation is to not have Git repositories larger than 1GB to preserve performance.
GitLab already supports [managing large files with git annex](http://doc.gitlab.com/ee/workflow/git_annex.html) (EE only), however in certain
environments it is not always convenient to use different commands to differentiate between the large files and regular ones.
Git LFS makes this simpler for the end user by removing the requirement to learn new commands.
<!-- more -->
## How it works
Git LFS client talks with the GitLab server over HTTPS. It uses HTTP Basic Authentication to authorize client requests.
......
......@@ -4,13 +4,6 @@ Managing large files such as audio, video and graphics files has always been one
of the shortcomings of Git. The general recommendation is to not have Git repositories
larger than 1GB to preserve performance.
GitLab already supports [managing large files with git annex](http://docs.gitlab.com/ee/workflow/git_annex.html)
(EE only), however in certain environments it is not always convenient to use
different commands to differentiate between the large files and regular ones.
Git LFS makes this simpler for the end user by removing the requirement to
learn new commands.
## How it works
Git LFS client talks with the GitLab server over HTTPS. It uses HTTP Basic Authentication
......
# Migration guide from Git Annex to Git LFS
>**Note:**
Git Annex support [will be dropped][issue-remove-annex] with GitLab Enterprise
Edition 9.0 which is to be released on March 22nd 2017.
Git Annex support [has been removed][issue-remove-annex] in GitLab Enterprise
Edition 9.0 (2017/03/22).
Both [Git Annex][] and [Git LFS][] are tools to manage large files in Git.
......
......@@ -22,7 +22,7 @@ A few things/limitations to consider:
password, e.g., you want to mirror to GitHub and have 2FA enabled.
- The import will time out after 15 minutes. For repositories that take longer
use a clone/push combination.
- The Git LFS/Annex objects will not be synced. You'll need to push/pull them
- The Git LFS objects will not be synced. You'll need to push/pull them
manually.
## Pulling from a remote repository
......
......@@ -54,8 +54,7 @@ module API
end
def log_user_activity(actor)
commands = Gitlab::GitAccess::DOWNLOAD_COMMANDS +
Gitlab::GitAccess::GIT_ANNEX_COMMANDS
commands = Gitlab::GitAccess::DOWNLOAD_COMMANDS
::Users::ActivityService.new(actor, 'Git SSH').execute if commands.include?(params[:action])
end
......
......@@ -180,9 +180,8 @@ module Backup
return unless Dir.exist?(path)
dir_entries = Dir.entries(path)
%w[annex custom_hooks].each do |entry|
yield(entry) if dir_entries.include?(entry)
end
yield('custom_hooks') if dir_entries.include?('custom_hooks')
end
def prepare
......
......@@ -102,8 +102,6 @@ module Gitlab
return if Gitlab::Git.blank_ref?(@newrev) || !(commit_validation || validate_path_locks?)
commits.each do |commit|
next if commit_from_annex_sync?(commit.safe_message)
if commit_validation
error = check_commit(commit, push_rule)
return error if error
......@@ -226,13 +224,6 @@ module Gitlab
def commits
project.repository.new_commits(@newrev)
end
def commit_from_annex_sync?(commit_message)
return false unless Gitlab.config.gitlab_shell.git_annex_enabled
# Commit message starting with <git-annex in > so avoid push rules on this
commit_message.start_with?('git-annex in')
end
end
end
end
......@@ -16,8 +16,7 @@ module Gitlab
DOWNLOAD_COMMANDS = %w{ git-upload-pack git-upload-archive }.freeze
PUSH_COMMANDS = %w{ git-receive-pack }.freeze
GIT_ANNEX_COMMANDS = %w{ git-annex-shell }.freeze
ALL_COMMANDS = DOWNLOAD_COMMANDS + PUSH_COMMANDS + GIT_ANNEX_COMMANDS
ALL_COMMANDS = DOWNLOAD_COMMANDS + PUSH_COMMANDS
attr_reader :actor, :project, :protocol, :user_access, :authentication_abilities
......@@ -44,8 +43,6 @@ module Gitlab
check_download_access!
when *PUSH_COMMANDS
check_push_access!(changes)
when *GIT_ANNEX_COMMANDS
git_annex_access_check(project, changes)
end
build_status_object(true)
......@@ -131,8 +128,6 @@ module Gitlab
raise UnauthorizedError, "You can't push code on a secondary GitLab Geo node."
end
return if git_annex_branch_sync?(changes)
if deploy_key
check_deploy_key_push_access!
elsif user
......@@ -247,39 +242,5 @@ module Gitlab
def build_status_object(status, message = '')
Gitlab::GitAccessStatus.new(status, message)
end
def git_annex_access_check(project, changes)
raise UnauthorizedError, "git-annex is disabled" unless Gitlab.config.gitlab_shell.git_annex_enabled
unless user && user_access.allowed?
raise UnauthorizedError, "You don't have access"
end
if Gitlab::Geo.enabled? && Gitlab::Geo.secondary?
raise UnauthorizedError, "You can't use git-annex with a secondary GitLab Geo node."
end
unless user.can?(:push_code, project)
raise UnauthorizedError, "You don't have permission"
end
end
def git_annex_branch_sync?(changes)
return false unless Gitlab.config.gitlab_shell.git_annex_enabled
return false if changes.blank?
changes = changes.lines if changes.is_a?(String)
# Iterate over all changes to find if user allowed all of them to be applied
# 0000000000000000000000000000000000000000 3073696294ddd52e9e6b6fc3f429109cac24626f refs/heads/synced/git-annex
# 0000000000000000000000000000000000000000 65be9df0e995d36977e6d76fc5801b7145ce19c9 refs/heads/synced/master
changes.map(&:strip).reject(&:blank?).each do |change|
unless change.end_with?("refs/heads/synced/git-annex") || change.include?("refs/heads/synced/")
return false
end
end
true
end
end
end
......@@ -3,16 +3,6 @@ require 'spec_helper'
describe Profiles::KeysController do
let(:user) { create(:user) }
describe '#new' do
before { sign_in(user) }
it 'redirects to #index' do
get :new
expect(response).to redirect_to(profile_keys_path)
end
end
describe "#get_keys" do
describe "non existant user" do
it "does not generally work" do
......
......@@ -5,11 +5,7 @@ describe Gitlab::GitAccess, lib: true do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
let(:actor) { user }
let(:git_annex_changes) do
["6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/synced/git-annex",
"6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/synced/named-branch"]
end
let(:git_annex_master_changes) { "6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/master" }
let(:authentication_abilities) do
[
:read_project,
......@@ -527,96 +523,6 @@ describe Gitlab::GitAccess, lib: true do
run_permission_checks(permissions_matrix)
end
context "when using git annex" do
before do
project.team << [user, :master]
allow_any_instance_of(Repository).to receive(:new_commits).and_return(
project.repository.commits_between('6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9', '570e7b2abdd848b95f2f578043fc23bd6f6fd24d')
)
end
describe 'and gitlab geo is enabled in a secondary node' do
before do
allow(Gitlab.config.gitlab_shell).to receive(:git_annex_enabled).and_return(true)
allow(Gitlab::Geo).to receive(:enabled?) { true }
allow(Gitlab::Geo).to receive(:secondary?) { true }
end
it { expect { access.send(:check_push_access!, git_annex_changes) }.to raise_error(described_class::UnauthorizedError) }
end
describe 'and git hooks unset' do
describe 'git annex enabled' do
before { allow(Gitlab.config.gitlab_shell).to receive(:git_annex_enabled).and_return(true) }
it { expect { access.send(:check_push_access!, git_annex_changes) }.not_to raise_error }
end
describe 'git annex disabled' do
before { allow(Gitlab.config.gitlab_shell).to receive(:git_annex_enabled).and_return(false) }
it { expect { access.send(:check_push_access!, git_annex_changes) }.not_to raise_error }
end
end
describe 'and push rules set' do
before { project.create_push_rule }
describe 'check commit author email' do
before do
project.push_rule.update(author_email_regex: "@only.com")
end
describe 'git annex enabled' do
before { allow(Gitlab.config.gitlab_shell).to receive(:git_annex_enabled).and_return(true) }
it { expect { access.send(:check_push_access!, git_annex_changes) }.not_to raise_error }
end
describe 'git annex enabled, push to master branch' do
before do
allow(Gitlab.config.gitlab_shell).to receive(:git_annex_enabled).and_return(true)
allow_any_instance_of(Commit).to receive(:safe_message) { 'git-annex in me@host:~/repo' }
end
it { expect { access.send(:check_push_access!, git_annex_master_changes) }.not_to raise_error }
end
describe 'git annex disabled' do
before do
allow(Gitlab.config.gitlab_shell).to receive(:git_annex_enabled).and_return(false)
end
it { expect { access.send(:check_push_access!, git_annex_changes) }.to raise_error(described_class::UnauthorizedError) }
end
end
describe 'check max file size' do
before do
allow_any_instance_of(Gitlab::Git::Blob).to receive(:size).and_return(5.megabytes.to_i)
project.push_rule.update(max_file_size: 2)
end
describe 'git annex enabled' do
before { allow(Gitlab.config.gitlab_shell).to receive(:git_annex_enabled).and_return(true) }
it { expect(access.check('git-annex-shell', git_annex_changes).allowed?).to be_truthy }
it { expect { access.send(:check_push_access!, git_annex_changes) }.not_to raise_error }
end
describe 'git annex disabled' do
before do
allow(Gitlab.config.gitlab_shell).to receive(:git_annex_enabled).and_return(false)
end
it { expect(access.check('git-annex-shell', git_annex_changes).allowed?).to be_falsey }
it { expect { access.send(:check_push_access!, git_annex_changes) }.to raise_error(described_class::UnauthorizedError) }
end
end
end
end
describe "push_rule_check" do
before do
project.team << [user, :developer]
......
......@@ -108,7 +108,7 @@ describe 'gitlab:app namespace rake task' do
$stdout = orig_stdout
end
describe 'backup creation and deletion using annex and custom_hooks' do
describe 'backup creation and deletion using custom_hooks' do
let(:project) { create(:project) }
let(:user_backup_path) { "repositories/#{project.path_with_namespace}" }
......@@ -132,25 +132,6 @@ describe 'gitlab:app namespace rake task' do
Dir.chdir(@origin_cd)
end
context 'project uses git-annex and successfully creates backup' do
let(:filename) { "annex" }
it 'creates annex.tar and project bundle' do
tar_contents, exit_status = Gitlab::Popen.popen(%W{tar -tvf #{@backup_tar}})
expect(exit_status).to eq(0)
expect(tar_contents).to match(user_backup_path)
expect(tar_contents).to match("#{user_backup_path}/annex.tar")
expect(tar_contents).to match("#{user_backup_path}.bundle")
end
it 'restores files correctly' do
restore_backup
expect(Dir.entries(File.join(project.repository.path, "annex"))).to include("dummy.txt")
end
end
context 'project uses custom_hooks and successfully creates backup' do
let(:filename) { "custom_hooks" }
......
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