As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

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
  • idrozdov/gitlab-shell
  • mmj/gitlab-shell
2 results
Show changes
Commits on Source (1)
Loading
@@ -252,11 +252,16 @@ class GitlabProjects
Loading
@@ -252,11 +252,16 @@ class GitlabProjects
@source = ARGV.shift @source = ARGV.shift
masked_source = mask_password_in_url(@source) masked_source = mask_password_in_url(@source)
# clone with --single-branch ?
single_branch = ARGV.delete('--single-branch') if ARGV.include?('--single-branch')
# timeout for clone # timeout for clone
timeout = (ARGV.shift || 120).to_i timeout = (ARGV.shift || 120).to_i
$logger.info "Importing project #{@project_name} from <#{masked_source}> to <#{full_path}>."
cmd = %W(git clone --bare -- #{@source} #{full_path})
$logger.info "Importing project #{@project_name} from <#{masked_source}> to <#{full_path}>."
cmd = %W(git clone --bare)
cmd << single_branch if single_branch
cmd += %W(-- #{@source} #{full_path})
pid = Process.spawn(*cmd) pid = Process.spawn(*cmd)
begin begin
Loading
Loading
Loading
@@ -450,16 +450,19 @@ describe GitlabProjects do
Loading
@@ -450,16 +450,19 @@ describe GitlabProjects do
context 'success import' do context 'success import' do
let(:gl_projects) { build_gitlab_projects('import-project', tmp_repos_path, repo_name, 'https://github.com/randx/six.git') } let(:gl_projects) { build_gitlab_projects('import-project', tmp_repos_path, repo_name, 'https://github.com/randx/six.git') }
it { gl_projects.exec.should be_true } it { expect(gl_projects.exec).to be true }
it "should import a repo" do it "imports a repo" do
gl_projects.exec gl_projects.exec
File.exists?(File.join(tmp_repo_path, 'HEAD')).should be_true
expect(File.exists?(File.join(tmp_repo_path, 'HEAD'))).to be true
end end
it "should log an import-project event" do it "logs an import-project event" do
message = "Importing project #{repo_name} from <https://github.com/randx/six.git> to <#{tmp_repo_path}>." message = "Importing project #{repo_name} from <https://github.com/randx/six.git> to <#{tmp_repo_path}>."
$logger.should_receive(:info).with(message)
expect($logger).to receive(:info).with(message)
gl_projects.exec gl_projects.exec
end end
end end
Loading
@@ -467,28 +470,39 @@ describe GitlabProjects do
Loading
@@ -467,28 +470,39 @@ describe GitlabProjects do
context 'already exists' do context 'already exists' do
let(:gl_projects) { build_gitlab_projects('import-project', tmp_repos_path, repo_name, 'https://github.com/randx/six.git') } let(:gl_projects) { build_gitlab_projects('import-project', tmp_repos_path, repo_name, 'https://github.com/randx/six.git') }
it 'should import only once' do it 'imports only once' do
gl_projects.exec.should be_true expect(gl_projects.exec).to be true
gl_projects.exec.should be_false expect(gl_projects.exec).to be false
end end
end end
context 'timeout' do context 'timeout' do
let(:gl_projects) { build_gitlab_projects('import-project', tmp_repos_path, repo_name, 'https://github.com/gitlabhq/gitlabhq.git', '1') } let(:gl_projects) { build_gitlab_projects('import-project', tmp_repos_path, repo_name, 'https://github.com/gitlabhq/gitlabhq.git', '1') }
it { gl_projects.exec.should be_false } it { expect(gl_projects.exec).to be false }
it "should not import a repo" do it "does not import a repo" do
gl_projects.exec gl_projects.exec
File.exists?(File.join(tmp_repo_path, 'HEAD')).should be_false
expect(File.exists?(File.join(tmp_repo_path, 'HEAD'))).to be false
end end
it "should log an import-project event" do it "logs an import-project event" do
message = "Importing project #{repo_name} from <https://github.com/gitlabhq/gitlabhq.git> failed due to timeout." message = "Importing project #{repo_name} from <https://github.com/gitlabhq/gitlabhq.git> failed due to timeout."
$logger.should_receive(:error).with(message)
expect($logger).to receive(:error).with(message)
gl_projects.exec gl_projects.exec
end end
end end
context 'single-branch' do
let(:gl_projects) { build_gitlab_projects('import-project', tmp_repos_path, repo_name, 'https://github.com/randx/six.git', '--single-branch') }
it "imports repo" do
expect(gl_projects.exec).to be true
end
end
end end
describe :fork_project do describe :fork_project do
Loading
Loading