Commit 40991fc3 authored by Marcia Ramos's avatar Marcia Ramos

fix conflict

parents 85cfde83 069c54a7
......@@ -349,8 +349,6 @@ migration paths:
script:
- git fetch origin v8.14.10
- git checkout -f FETCH_HEAD
- cp config/resque.yml.example config/resque.yml
- sed -i 's/localhost/redis/g' config/resque.yml
- bundle install --without postgres production --jobs $(nproc) $FLAGS --retry=3
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
- git checkout $CI_COMMIT_SHA
......
......@@ -85,6 +85,7 @@ $(() => {
if (list.type === 'closed') {
list.position = Infinity;
list.label = { description: 'Shows all closed issues. Moving an issue to this list closes it' };
}
});
......
......@@ -523,7 +523,6 @@
}
.content-block {
border-top: 1px solid $border-color;
padding: $gl-padding-top $gl-padding;
}
......
......@@ -345,7 +345,11 @@ class ProjectsController < Projects::ApplicationController
end
def project_view_files?
current_user && current_user.project_view == 'files'
if current_user
current_user.project_view == 'files'
else
project_view_files_allowed?
end
end
# Override extract_ref from ExtractsPath, which returns the branch and file path
......@@ -359,4 +363,8 @@ class ProjectsController < Projects::ApplicationController
def get_id
project.repository.root_ref
end
def project_view_files_allowed?
!project.empty_repo? && can?(current_user, :download_code, project)
end
end
......@@ -63,6 +63,10 @@ module PreferencesHelper
end
def anonymous_project_view
@project.empty_repo? || !can?(current_user, :download_code, @project) ? 'activity' : 'readme'
if !@project.empty_repo? && can?(current_user, :download_code, @project)
'files'
else
'activity'
end
end
end
......@@ -7,7 +7,7 @@ module Ci
belongs_to :project
belongs_to :owner, class_name: "User"
has_many :trigger_requests, dependent: :destroy
has_many :trigger_requests
has_one :trigger_schedule, dependent: :destroy
validates :token, presence: true, uniqueness: true
......
......@@ -23,6 +23,10 @@ class ContainerRepository < ActiveRecord::Base
@path ||= [project.full_path, name].select(&:present?).join('/')
end
def location
File.join(registry.path, path)
end
def tag(tag)
ContainerRegistry::Tag.new(self, tag)
end
......
......@@ -26,8 +26,6 @@ class Issue < ActiveRecord::Base
validates :project, presence: true
scope :cared, ->(user) { where(assignee_id: user) }
scope :open_for, ->(user) { opened.assigned_to(user) }
scope :in_projects, ->(project_ids) { where(project_id: project_ids) }
scope :without_due_date, -> { where(due_date: nil) }
......
......@@ -104,7 +104,6 @@ class MergeRequest < ActiveRecord::Base
scope :by_source_or_target_branch, ->(branch_name) do
where("source_branch = :branch OR target_branch = :branch", branch: branch_name)
end
scope :cared, ->(user) { where('assignee_id = :user OR author_id = :user', user: user.id) }
scope :by_milestone, ->(milestone) { where(milestone_id: milestone) }
scope :of_projects, ->(ids) { where(target_project_id: ids) }
scope :from_project, ->(project) { where(source_project_id: project.id) }
......
......@@ -407,8 +407,6 @@ class Repository
# Runs code after a repository has been forked/imported.
def after_import
expire_content_cache
expire_tags_cache
expire_branches_cache
end
# Runs code after a new commit has been pushed.
......
......@@ -587,10 +587,6 @@ class User < ActiveRecord::Base
name.split.first unless name.blank?
end
def cared_merge_requests
MergeRequest.cared(self)
end
def projects_limit_left
projects_limit - personal_projects.count
end
......
%ul
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do
= link_to explore_root_path, title: 'Projects' do
= link_to explore_root_path, title: 'Projects', class: 'dashboard-shortcuts-projects' do
.shortcut-mappings
.key
= icon('arrow-up', 'aria-label' => 'hidden')
P
%span
Projects
= nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do
= link_to explore_groups_path, title: 'Groups' do
= link_to explore_groups_path, title: 'Groups', class: 'dashboard-shortcuts-groups' do
.shortcut-mappings
.key
= icon('arrow-up', 'aria-label' => 'hidden')
G
%span
Groups
= nav_link(controller: :snippets) do
= link_to explore_snippets_path, title: 'Snippets' do
= link_to explore_snippets_path, title: 'Snippets', class: 'dashboard-shortcuts-snippets' do
.shortcut-mappings
.key
= icon('arrow-up', 'aria-label' => 'hidden')
S
%span
Snippets
%li.divider
= nav_link(controller: :help) do
= link_to help_path, title: 'Help' do
%span
......
......@@ -18,7 +18,7 @@
Select merge moment
%ul.js-merge-dropdown.dropdown-menu.dropdown-menu-right{ role: 'menu' }
%li
= link_to "#", class: "merge_when_pipeline_succeeds" do
= link_to "#", class: "merge-when-pipeline-succeeds" do
= icon('check fw')
Merge when pipeline succeeds
%li
......
......@@ -4,7 +4,7 @@
= icon('chevron-down', 'aria-hidden': 'true')
= escape_once(image.path)
= clipboard_button(clipboard_text: "docker pull #{image.path}")
= clipboard_button(clipboard_text: "docker pull #{image.location}")
.controls.hidden-xs.pull-right
= link_to namespace_project_container_registry_path(@project.namespace, @project, image),
......
%tr.tag
%td
= escape_once(tag.name)
= clipboard_button(text: "docker pull #{tag.path}")
= clipboard_button(text: "docker pull #{tag.location}")
%td
- if tag.revision
%span.has-tooltip{ title: "#{tag.revision}" }
......
---
title: Keep webpack-dev-server process functional across branch changes
merge_request: 10581
author:
---
title: Add tooltip to header of Done board
merge_request: 10574
author: Andy Brown
---
title: Change project view default for existing users and anonymous visitors to files+readme
merge_request: 10498
author:
---
title: Fix redundant cache expiration in Repository
merge_request: 10575
author: blackst0ne
---
title: Fix MR widget bug that merged a MR when Merge when pipeline succeeds was clicked
via the dropdown
merge_request: 10611
author:
---
title: Add foreign key for ci_trigger_requests on ci_triggers
merge_request: 10537
author:
......@@ -374,3 +374,27 @@
:why: https://github.com/fb55/entities/blob/master/LICENSE
:versions: []
:when: 2017-04-07 16:19:23.900571000 Z
- - :approve
- ansi-html
- :who: Mike Greiling
:why: https://github.com/Tjatse/ansi-html/blob/master/LICENSE
:versions: []
:when: 2017-04-10 05:42:12.898178000 Z
- - :approve
- map-stream
- :who: Mike Greiling
:why: https://github.com/dominictarr/map-stream/blob/master/LICENCE
:versions: []
:when: 2017-04-10 06:27:52.269085000 Z
- - :approve
- pause-stream
- :who: Mike Greiling
:why: https://github.com/dominictarr/pause-stream/blob/master/LICENSE
:versions: []
:when: 2017-04-10 06:28:39.825894000 Z
- - :approve
- undefsafe
- :who: Mike Greiling
:why: https://github.com/remy/undefsafe/blob/master/LICENSE
:versions: []
:when: 2017-04-10 06:30:00.002555000 Z
......@@ -6,6 +6,7 @@ var webpack = require('webpack');
var StatsPlugin = require('stats-webpack-plugin');
var CompressionPlugin = require('compression-webpack-plugin');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
var ROOT_PATH = path.resolve(__dirname, '..');
var IS_PRODUCTION = process.env.NODE_ENV === 'production';
......@@ -187,6 +188,10 @@ if (IS_DEV_SERVER) {
inline: DEV_SERVER_LIVERELOAD
};
config.output.publicPath = '//localhost:' + DEV_SERVER_PORT + config.output.publicPath;
config.plugins.push(
// watch node_modules for changes if we encounter a missing module compile error
new WatchMissingNodeModulesPlugin(path.join(ROOT_PATH, 'node_modules'))
);
}
if (WEBPACK_REPORT) {
......
......@@ -223,7 +223,9 @@ class Gitlab::Seeder::CycleAnalytics
end
Gitlab::Seeder.quiet do
if ENV['SEED_CYCLE_ANALYTICS']
flag = 'SEED_CYCLE_ANALYTICS'
if ENV[flag]
Project.all.each do |project|
seeder = Gitlab::Seeder::CycleAnalytics.new(project)
seeder.seed!
......@@ -235,6 +237,6 @@ Gitlab::Seeder.quiet do
seeder = Gitlab::Seeder::CycleAnalytics.new(Project.order(:id).first, perf: true)
seeder.seed_metrics!
else
puts "Not running the cycle analytics seed file. Use the `SEED_CYCLE_ANALYTICS` environment variable to enable it."
puts "Skipped. Use the `#{flag}` environment variable to enable."
end
end
......@@ -27,6 +27,9 @@ end
Sidekiq::Testing.inline! do
Gitlab::Seeder.quiet do
flag = 'SEED_NESTED_GROUPS'
if ENV[flag]
project_urls = [
'https://android.googlesource.com/platform/hardware/broadcom/libbt.git',
'https://android.googlesource.com/platform/hardware/broadcom/wlan.git',
......@@ -65,5 +68,8 @@ Sidekiq::Testing.inline! do
print 'F'
end
end
else
puts "Skipped. Use the `#{flag}` environment variable to enable."
end
end
end
class AddForeighKeyTriggerRequestsTrigger < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_foreign_key(:ci_trigger_requests, :ci_triggers, column: :trigger_id)
end
def down
remove_foreign_key(:ci_trigger_requests, column: :trigger_id)
end
end
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class MigrateUserProjectView < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
def up
update_column_in_batches(:users, :project_view, 2) do |table, query|
query.where(table[:project_view].eq(0))
end
end
def down
# Nothing can be done to restore old values
end
end
......@@ -12,6 +12,7 @@
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170408033905) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
enable_extension "pg_trgm"
......@@ -1356,6 +1357,7 @@ ActiveRecord::Schema.define(version: 20170408033905) do
add_foreign_key "chat_teams", "namespaces", on_delete: :cascade
add_foreign_key "ci_builds", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_a2141b1522", on_delete: :nullify
add_foreign_key "ci_pipelines", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_262d4c2d19", on_delete: :nullify
add_foreign_key "ci_trigger_requests", "ci_triggers", column: "trigger_id", name: "fk_b8ec8b7245", on_delete: :cascade
add_foreign_key "ci_trigger_schedules", "ci_triggers", column: "trigger_id", name: "fk_90a406cc94", on_delete: :cascade
add_foreign_key "ci_triggers", "users", column: "owner_id", name: "fk_e8e10d1964", on_delete: :cascade
add_foreign_key "container_repositories", "projects"
......
......@@ -110,9 +110,8 @@ Here is an collection of tutorials and guides on setting up your CI pipeline.
- [Run PHP Composer & NPM scripts then deploy them to a staging server](examples/deployment/composer-npm-deploy.md)
- **Blog posts**
- [Automated Debian packaging](https://about.gitlab.com/2016/10/12/automated-debian-package-build-with-gitlab-ci/)
- [Spring boot application with GitLab CI and Kubernetes](https://about.gitlab.com/2016/11/30/setting-up-gitlab-ci-for-android-projects/)
- [Setting up CI for iOS projects](https://about.gitlab.com/2016/12/14/continuous-delivery-of-a-spring-boot-application-with-gitlab-ci-and-kubernetes/)
- [Using GitLab CI for iOS projects](https://about.gitlab.com/2016/03/10/setting-up-gitlab-ci-for-ios-projects/)
- [Spring boot application with GitLab CI and Kubernetes](https://about.gitlab.com/2016/12/14/continuous-delivery-of-a-spring-boot-application-with-gitlab-ci-and-kubernetes/)
- [Setting up GitLab CI for iOS projects](https://about.gitlab.com/2016/03/10/setting-up-gitlab-ci-for-ios-projects/)
- [Setting up GitLab CI for Android projects](https://about.gitlab.com/2016/11/30/setting-up-gitlab-ci-for-android-projects/)
- [Building a new GitLab Docs site with Nanoc, GitLab CI, and GitLab Pages](https://about.gitlab.com/2016/12/07/building-a-new-gitlab-docs-site-with-nanoc-gitlab-ci-and-gitlab-pages/)
- [CI/CD with GitLab in action](https://about.gitlab.com/2017/03/13/ci-cd-demo/)
......
# Git documentation
Git is a [free and open source](https://git-scm.com/about/free-and-open-source)
distributed version control system designed to handle everything from small to
very large projects with speed and efficiency.
[GitLab](https://about.gitlab.com) is a Git-based fully integrated platform for
software development. Besides Git's functionalities, GitLab has a lot of
powerful [features](https://about.gitlab.com/features/) to enhance your
[workflow](https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/).
We've gathered some resources to help you to get the best from Git with GitLab.
## Getting started
- [Git concepts](../../university/training/user_training.md#git-concepts)
- [Start using Git on the command line](../../gitlab-basics/start-using-git.md)
- [Command Line basic commands](../../gitlab-basics/command-line-commands.md)
- [GitLab Git Cheat Sheet (download)](https://gitlab.com/gitlab-com/marketing/raw/master/design/print/git-cheatsheet/print-pdf/git-cheatsheet.pdf)
- **Articles:**
- [Git Tips & Tricks](https://about.gitlab.com/2016/12/08/git-tips-and-tricks/)
- [Eight Tips to help you work better with Git](https://about.gitlab.com/2015/02/19/8-tips-to-help-you-work-better-with-git/)
- **Presentations:**
- [GLU Course: About Version Control](https://docs.google.com/presentation/d/16sX7hUrCZyOFbpvnrAFrg6tVO5_yT98IgdAqOmXwBho/edit?usp=sharing)
- **Third-party resources:**
- What is [Git](https://git-scm.com)
- [Version control](https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control)
- [Getting Started - Git Basics](https://git-scm.com/book/en/v2/Getting-Started-Git-Basics)
- [Getting Started - Installing Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [Git on the Server - GitLab](https://git-scm.com/book/en/v2/Git-on-the-Server-GitLab)
## Branching strategies
- **Articles:**
- [GitLab Flow](https://about.gitlab.com/2014/09/29/gitlab-flow/)
- **Third-party resources:**
- [Git Branching - Branches in a Nutshell](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell)
- [Git Branching - Branching Workflows](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows)
## Advanced use
- [Custom Git Hooks](../../administration/custom_hooks.md)
- [Git Attributes](../../user/project/git_attributes.md)
- Git Submodules: [Using Git submodules with GitLab CI](../../ci/git_submodules.md#using-git-submodules-with-gitlab-ci)
## API
- [Gitignore templates](../../api/templates/gitignores.md)
## Git LFS
- [Git LFS](../../workflow/lfs/manage_large_binaries_with_git_lfs.md)
- [Git-Annex to Git-LFS migration guide](https://docs.gitlab.com/ee/workflow/lfs/migrate_from_git_annex_to_git_lfs.html)
- **Articles:**
- [Getting Started with Git LFS](https://about.gitlab.com/2017/01/30/getting-started-with-git-lfs-tutorial/)
- [Towards a production quality open source Git LFS server](https://about.gitlab.com/2015/08/13/towards-a-production-quality-open-source-git-lfs-server/)
## General information
- **Articles:**
- [The future of SaaS hosted Git repository pricing](https://about.gitlab.com/2016/05/11/git-repository-pricing/)
......@@ -7,10 +7,9 @@ you through better understanding GitLab's concepts
through our regular docs, and, when available, through articles (guides,
tutorials, technical overviews, blog posts) and videos.
- [Authentication](authentication/index.md)
- [Continuous Integration (GitLab CI)](../ci/README.md)
- [Git](git/index.md)
- [GitLab Installation](../install/README.md)
- [GitLab Pages](../user/project/pages/index.md)
>**Note:**
More topics will be available soon.
>**Note:** More topics will be available soon.
\ No newline at end of file
......@@ -57,7 +57,7 @@ sudo -u git -H bundle clean
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
# Clean up assets and cache
sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile cache:clear RAILS_ENV=production
sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile cache:clear RAILS_ENV=production NODE_ENV=production
```
### 4. Update gitlab-workhorse to the corresponding version
......
......@@ -29,6 +29,10 @@ module ContainerRegistry
"#{repository.path}:#{name}"
end
def location
"#{repository.location}:#{name}"
end
def [](key)
return unless manifest
......
{
"private": true,
"scripts": {
"dev-server": "webpack-dev-server --config config/webpack.config.js",
"dev-server": "nodemon --watch config/webpack.config.js -- ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js",
"eslint": "eslint --max-warnings 0 --ext .js,.vue .",
"eslint-fix": "eslint --max-warnings 0 --ext .js,.vue --fix .",
"eslint-report": "eslint --max-warnings 0 --ext .js,.vue --format html --output-file ./eslint-report.html .",
......@@ -36,6 +36,7 @@
"pikaday": "^1.5.1",
"raphael": "^2.2.7",
"raw-loader": "^0.5.1",
"react-dev-utils": "^0.5.2",
"select2": "3.5.2-browserify",
"stats-webpack-plugin": "^0.4.3",
"three": "^0.84.0",
......@@ -69,6 +70,7 @@
"karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.2",
"nodemon": "^1.11.0",
"webpack-dev-server": "^2.4.2"
}
}
......@@ -15,21 +15,12 @@ retry() {
return 1
}
if [ -f /.dockerenv ] || [ -f ./dockerinit ]; then
cp config/database.yml.mysql config/database.yml
sed -i 's/username:.*/username: root/g' config/database.yml
sed -i 's/password:.*/password:/g' config/database.yml
sed -i 's/# socket:.*/host: mysql/g' config/database.yml
cp config/database.yml.mysql config/database.yml
sed -i 's/username:.*/username: root/g' config/database.yml
sed -i 's/password:.*/password:/g' config/database.yml
sed -i 's/# socket:.*/host: mysql/g' config/database.yml
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
export FLAGS="--path vendor --retry 3 --quiet"
else
rnd=$(awk 'BEGIN { srand() ; printf("%d\n",rand()*5) }')
export PATH="$HOME/bin:/usr/local/bin:/usr/bin:/bin"
cp config/database.yml.mysql config/database.yml
sed "s/username\:.*$/username\: runner/" -i config/database.yml
sed "s/password\:.*$/password\: 'password'/" -i config/database.yml
sed "s/gitlabhq_test/gitlabhq_test_$rnd/" -i config/database.yml
fi
export FLAGS="--path vendor --retry 3 --quiet"
require 'spec_helper'
feature 'Dashboard shortcuts', feature: true, js: true do
context 'logged in' do
before do
login_as :user
visit root_dashboard_path
......@@ -23,6 +24,27 @@ feature 'Dashboard shortcuts', feature: true, js: true do
check_page_title('Todos')
end
end
context 'logged out' do
before do
visit explore_root_path
end
scenario 'Navigate to tabs' do
find('body').native.send_keys([:shift, 'P'])
expect(page).to have_content('No projects found')
find('body').native.send_keys([:shift, 'G'])
expect(page).to have_content('No public groups')
find('body').native.send_keys([:shift, 'S'])
expect(page).to have_selector('.snippets-list-holder')
end
end
def check_page_title(title)
expect(find('.header-content .title')).to have_content(title)
......
......@@ -89,6 +89,19 @@ feature 'Merge When Pipeline Succeeds', :feature, :js do
it_behaves_like 'Merge when pipeline succeeds activator'
end
end
describe 'enabling Merge when pipeline succeeds via dropdown' do
it 'activates the Merge when pipeline succeeds feature' do
click_button 'Select merge moment'
within('.js-merge-dropdown') do
click_link 'Merge when pipeline succeeds'
end
expect(page).to have_content "Set by #{user.name} to be merged automatically when the pipeline succeeds."
expect(page).to have_content "The source branch will not be removed."
expect(page).to have_link "Cancel automatic merge"
end
end
end
context 'when merge when pipeline succeeds is enabled' do
......
......@@ -86,10 +86,10 @@ describe PreferencesHelper do
context 'when repository is not empty' do
let(:project) { create(:project, :public, :repository) }
it 'returns readme if user has repository access' do
it 'returns files and readme if user has repository access' do
allow(helper).to receive(:can?).with(nil, :download_code, project).and_return(true)
expect(helper.default_project_view).to eq('readme')
expect(helper.default_project_view).to eq('files')
end
it 'returns activity if user does not have repository access' do
......
......@@ -50,6 +50,13 @@ describe ContainerRegistry::Tag do
end
end
describe '#location' do
it 'returns a full location of the tag' do
expect(tag.location)
.to eq 'registry.gitlab/group/test:tag'
end
end
context 'manifest processing' do
context 'schema v1' do
before do
......
# encoding: utf-8
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20170406142253_migrate_user_project_view.rb')
describe MigrateUserProjectView do
let(:migration) { described_class.new }
let!(:user) { create(:user, project_view: 'readme') }
describe '#up' do
it 'updates project view setting with new value' do
migration.up
expect(user.reload.project_view).to eq('files')
end
end
end
......@@ -4,7 +4,7 @@ describe ContainerRepository do
let(:group) { create(:group, name: 'group') }
let(:project) { create(:project, path: 'test', group: group) }
let(:container_repository) do
let(:repository) do
create(:container_repository, name: 'my_image', project: project)
end
......@@ -23,48 +23,48 @@ describe ContainerRepository do
describe 'associations' do
it 'belongs to the project' do
expect(container_repository).to belong_to(:project)
expect(repository).to belong_to(:project)
end
end
describe '#tag' do
it 'has a test tag' do
expect(container_repository.tag('test')).not_to be_nil
expect(repository.tag('test')).not_to be_nil
end
end
describe '#path' do
it 'returns a full path to the repository' do
expect(container_repository.path).to eq('group/test/my_image')
expect(repository.path).to eq('group/test/my_image')
end
end
describe '#manifest' do
subject { container_repository.manifest }
it { is_expected.not_to be_nil }
it 'returns non-empty manifest' do
expect(repository.manifest).not_to be_nil
end
end
describe '#valid?' do
subject { container_repository.valid? }
it { is_expected.to be_truthy }
it 'is a valid repository' do
expect(repository).to be_valid
end
end
describe '#tags' do
subject { container_repository.tags }
it { is_expected.not_to be_empty }
it 'returns non-empty tags list' do
expect(repository.tags).not_to be_empty
end
end
describe '#has_tags?' do
it 'has tags' do
expect(container_repository).to have_tags
expect(repository).to have_tags
end
end
describe '#delete_tags!' do
let(:container_repository) do
let(:repository) do
create(:container_repository, name: 'my_image',
tags: %w[latest rc1],
project: project)
......@@ -72,21 +72,36 @@ describe ContainerRepository do
context 'when action succeeds' do
it 'returns status that indicates success' do
expect(container_repository.client)
expect(repository.client)
.to receive(:delete_repository_tag)
.and_return(true)
expect(container_repository.delete_tags!).to be_truthy
expect(repository.delete_tags!).to be_truthy
end
end
context 'when action fails' do
it 'returns status that indicates failure' do
expect(container_repository.client)
expect(repository.client)
.to receive(:delete_repository_tag)
.and_return(false)
expect(container_repository.delete_tags!).to be_falsey
expect(repository.delete_tags!).to be_falsey
end
end
end
describe '#location' do
context 'when registry is running on a custom port' do
before do
stub_container_registry_config(enabled: true,
api_url: 'http://registry.gitlab:5000',
host_port: 'registry.gitlab:5000')
end
it 'returns a full location of the repository' do
expect(repository.location)
.to eq 'registry.gitlab:5000/group/test/my_image'
end
end
end
......@@ -102,7 +117,7 @@ describe ContainerRepository do
context 'when repository is not a root repository' do
it 'returns false' do
expect(container_repository).not_to be_root_repository
expect(repository).not_to be_root_repository
end
end
end
......
......@@ -134,15 +134,6 @@ describe Issue, models: true do
end
end
describe '#is_being_reassigned?' do
it 'returns issues assigned to user' do
user = create(:user)
create_list(:issue, 2, assignee: user)
expect(Issue.open_for(user).count).to eq 2
end
end
describe '#closed_by_merge_requests' do
let(:project) { create(:project, :repository) }
let(:issue) { create(:issue, project: project)}
......
......@@ -1283,8 +1283,6 @@ describe Repository, models: true do
describe '#after_import' do
it 'flushes and builds the cache' do
expect(repository).to receive(:expire_content_cache)
expect(repository).to receive(:expire_tags_cache)
expect(repository).to receive(:expire_branches_cache)
repository.after_import
end
......
require 'spec_helper'
describe 'projects/registry/repositories/index', :view do
let(:group) { create(:group, path: 'group') }
let(:project) { create(:empty_project, group: group, path: 'test') }
let(:repository) do
create(:container_repository, project: project, name: 'image')
end
before do
stub_container_registry_config(enabled: true,
host_port: 'registry.gitlab',
api_url: 'http://registry.gitlab')
stub_container_registry_tags(repository: :any, tags: [:latest])
assign(:project, project)
assign(:images, [repository])
allow(view).to receive(:can?).and_return(true)
end
it 'contains container repository path' do
render
expect(rendered).to have_content 'group/test/image'
end
it 'contains attribute for copying tag location into clipboard' do
render
expect(rendered).to have_css 'button[data-clipboard-text="docker pull ' \
'registry.gitlab/group/test/image:latest"]'
end
end
......@@ -45,6 +45,7 @@
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
......
# See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub
# SDK 1.20 and later (no longer creates packages directories)
.packages
.pub/
build/
# Older SDK versions
# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20)
.project
.buildlog
**/packages/
# Files created by dart2js
# (Most Dart developers will use pub build to compile Dart, use/modify these
# rules if you intend to use dart2js directly
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
# differentiate from explicit Javascript files)
*.dart.js
*.part.js
*.js.deps
*.js.map
*.info.json
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
# Don't commit pubspec lock file
# (Library packages only! Remove pattern if developing an application package)
pubspec.lock
......@@ -11,9 +11,6 @@ local.properties
.loadpath
.recommenders
# Eclipse Core
.project
# External tool builders
.externalToolBuilders/
......@@ -26,9 +23,6 @@ local.properties
# CDT-specific (C/C++ Development Tooling)
.cproject
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Java annotation processor (APT)
.factorypath
......
......@@ -36,6 +36,9 @@
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
......
......@@ -5,7 +5,6 @@
# Icon must end with two \r
Icon
# Thumbnails
._*
......
......@@ -92,3 +92,6 @@ ENV/
# Rope project settings
.ropeproject
# mkdocs documentation
/site
......@@ -8,7 +8,7 @@ capybara-*.html
/public/system
/coverage/
/spec/tmp
**.orig
*.orig
rerun.txt
pickle-email-*.html
......
......@@ -148,6 +148,9 @@ _minted*
# pax
*.pax
# pdfpcnotes
*.pdfpc
# sagetex
*.sagetex.sage
*.sagetex.py
......
......@@ -23,7 +23,6 @@ ExportedObj/
*.svd
*.pdb
# Unity3D generated meta files
*.pidb.meta
......
......@@ -219,6 +219,7 @@ UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
......
......@@ -26,9 +26,24 @@ before_script:
# - apt-get update -q && apt-get install nodejs -yqq
- pip install -r requirements.txt
# To get Django tests to work you may need to create a settings file using
# the following DATABASES:
#
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'ci',
# 'USER': 'postgres',
# 'PASSWORD': 'postgres',
# 'HOST': 'postgres',
# 'PORT': '5432',
# },
# }
#
# and then adding `--settings app.settings.ci` (or similar) to the test command
test:
variables:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
script:
- python manage.py migrate
- python manage.py test
# Full project: https://gitlab.com/pages/hexo
image: node:4.2.2
image: node:6.10.0
pages:
cache:
paths:
- node_modules/
script:
- npm install hexo-cli -g
- npm install
- hexo deploy
- ./node_modules/hexo/bin/hexo generate
artifacts:
paths:
- public
cache:
paths:
- node_modules
key: project
only:
- master
# Template project: https://gitlab.com/pages/jekyll
# Docs: https://docs.gitlab.com/ce/pages/
# Jekyll version: 3.4.0
image: ruby:2.3
variables:
JEKYLL_ENV: production
before_script:
- bundle install
......
......@@ -9,7 +9,7 @@ before_script:
- apt-get install apt-transport-https -yqq
# Add keyserver for SBT
- echo "deb http://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
# Install SBT
- apt-get update -yqq
- apt-get install sbt -yqq
......
This diff is collapsed.
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