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

fix conflict

parents 85cfde83 069c54a7
...@@ -349,8 +349,6 @@ migration paths: ...@@ -349,8 +349,6 @@ migration paths:
script: script:
- git fetch origin v8.14.10 - git fetch origin v8.14.10
- git checkout -f FETCH_HEAD - 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 install --without postgres production --jobs $(nproc) $FLAGS --retry=3
- bundle exec rake db:drop db:create db:schema:load db:seed_fu - bundle exec rake db:drop db:create db:schema:load db:seed_fu
- git checkout $CI_COMMIT_SHA - git checkout $CI_COMMIT_SHA
......
...@@ -85,6 +85,7 @@ $(() => { ...@@ -85,6 +85,7 @@ $(() => {
if (list.type === 'closed') { if (list.type === 'closed') {
list.position = Infinity; list.position = Infinity;
list.label = { description: 'Shows all closed issues. Moving an issue to this list closes it' };
} }
}); });
......
...@@ -523,7 +523,6 @@ ...@@ -523,7 +523,6 @@
} }
.content-block { .content-block {
border-top: 1px solid $border-color;
padding: $gl-padding-top $gl-padding; padding: $gl-padding-top $gl-padding;
} }
......
...@@ -345,7 +345,11 @@ class ProjectsController < Projects::ApplicationController ...@@ -345,7 +345,11 @@ class ProjectsController < Projects::ApplicationController
end end
def project_view_files? 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 end
# Override extract_ref from ExtractsPath, which returns the branch and file path # Override extract_ref from ExtractsPath, which returns the branch and file path
...@@ -359,4 +363,8 @@ class ProjectsController < Projects::ApplicationController ...@@ -359,4 +363,8 @@ class ProjectsController < Projects::ApplicationController
def get_id def get_id
project.repository.root_ref project.repository.root_ref
end end
def project_view_files_allowed?
!project.empty_repo? && can?(current_user, :download_code, project)
end
end end
...@@ -63,6 +63,10 @@ module PreferencesHelper ...@@ -63,6 +63,10 @@ module PreferencesHelper
end end
def anonymous_project_view 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
end end
...@@ -7,7 +7,7 @@ module Ci ...@@ -7,7 +7,7 @@ module Ci
belongs_to :project belongs_to :project
belongs_to :owner, class_name: "User" belongs_to :owner, class_name: "User"
has_many :trigger_requests, dependent: :destroy has_many :trigger_requests
has_one :trigger_schedule, dependent: :destroy has_one :trigger_schedule, dependent: :destroy
validates :token, presence: true, uniqueness: true validates :token, presence: true, uniqueness: true
......
...@@ -23,6 +23,10 @@ class ContainerRepository < ActiveRecord::Base ...@@ -23,6 +23,10 @@ class ContainerRepository < ActiveRecord::Base
@path ||= [project.full_path, name].select(&:present?).join('/') @path ||= [project.full_path, name].select(&:present?).join('/')
end end
def location
File.join(registry.path, path)
end
def tag(tag) def tag(tag)
ContainerRegistry::Tag.new(self, tag) ContainerRegistry::Tag.new(self, tag)
end end
......
...@@ -26,8 +26,6 @@ class Issue < ActiveRecord::Base ...@@ -26,8 +26,6 @@ class Issue < ActiveRecord::Base
validates :project, presence: true 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 :in_projects, ->(project_ids) { where(project_id: project_ids) }
scope :without_due_date, -> { where(due_date: nil) } scope :without_due_date, -> { where(due_date: nil) }
......
...@@ -104,7 +104,6 @@ class MergeRequest < ActiveRecord::Base ...@@ -104,7 +104,6 @@ class MergeRequest < ActiveRecord::Base
scope :by_source_or_target_branch, ->(branch_name) do scope :by_source_or_target_branch, ->(branch_name) do
where("source_branch = :branch OR target_branch = :branch", branch: branch_name) where("source_branch = :branch OR target_branch = :branch", branch: branch_name)
end end
scope :cared, ->(user) { where('assignee_id = :user OR author_id = :user', user: user.id) }
scope :by_milestone, ->(milestone) { where(milestone_id: milestone) } scope :by_milestone, ->(milestone) { where(milestone_id: milestone) }
scope :of_projects, ->(ids) { where(target_project_id: ids) } scope :of_projects, ->(ids) { where(target_project_id: ids) }
scope :from_project, ->(project) { where(source_project_id: project.id) } scope :from_project, ->(project) { where(source_project_id: project.id) }
......
...@@ -407,8 +407,6 @@ class Repository ...@@ -407,8 +407,6 @@ class Repository
# Runs code after a repository has been forked/imported. # Runs code after a repository has been forked/imported.
def after_import def after_import
expire_content_cache expire_content_cache
expire_tags_cache
expire_branches_cache
end end
# Runs code after a new commit has been pushed. # Runs code after a new commit has been pushed.
......
...@@ -587,10 +587,6 @@ class User < ActiveRecord::Base ...@@ -587,10 +587,6 @@ class User < ActiveRecord::Base
name.split.first unless name.blank? name.split.first unless name.blank?
end end
def cared_merge_requests
MergeRequest.cared(self)
end
def projects_limit_left def projects_limit_left
projects_limit - personal_projects.count projects_limit - personal_projects.count
end end
......
%ul %ul
= nav_link(path: ['dashboard#show', 'root#show', 'projects#trending', 'projects#starred', 'projects#index'], html_options: {class: 'home'}) do = 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 %span
Projects Projects
= nav_link(controller: [:groups, 'groups/milestones', 'groups/group_members']) do = 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 %span
Groups Groups
= nav_link(controller: :snippets) do = 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 %span
Snippets Snippets
%li.divider
= nav_link(controller: :help) do = nav_link(controller: :help) do
= link_to help_path, title: 'Help' do = link_to help_path, title: 'Help' do
%span %span
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
Select merge moment Select merge moment
%ul.js-merge-dropdown.dropdown-menu.dropdown-menu-right{ role: 'menu' } %ul.js-merge-dropdown.dropdown-menu.dropdown-menu-right{ role: 'menu' }
%li %li
= link_to "#", class: "merge_when_pipeline_succeeds" do = link_to "#", class: "merge-when-pipeline-succeeds" do
= icon('check fw') = icon('check fw')
Merge when pipeline succeeds Merge when pipeline succeeds
%li %li
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
= icon('chevron-down', 'aria-hidden': 'true') = icon('chevron-down', 'aria-hidden': 'true')
= escape_once(image.path) = 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 .controls.hidden-xs.pull-right
= link_to namespace_project_container_registry_path(@project.namespace, @project, image), = link_to namespace_project_container_registry_path(@project.namespace, @project, image),
......
%tr.tag %tr.tag
%td %td
= escape_once(tag.name) = escape_once(tag.name)
= clipboard_button(text: "docker pull #{tag.path}") = clipboard_button(text: "docker pull #{tag.location}")
%td %td
- if tag.revision - if tag.revision
%span.has-tooltip{ title: "#{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 @@ ...@@ -374,3 +374,27 @@
:why: https://github.com/fb55/entities/blob/master/LICENSE :why: https://github.com/fb55/entities/blob/master/LICENSE
:versions: [] :versions: []
:when: 2017-04-07 16:19:23.900571000 Z :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'); ...@@ -6,6 +6,7 @@ var webpack = require('webpack');
var StatsPlugin = require('stats-webpack-plugin'); var StatsPlugin = require('stats-webpack-plugin');
var CompressionPlugin = require('compression-webpack-plugin'); var CompressionPlugin = require('compression-webpack-plugin');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
var ROOT_PATH = path.resolve(__dirname, '..'); var ROOT_PATH = path.resolve(__dirname, '..');
var IS_PRODUCTION = process.env.NODE_ENV === 'production'; var IS_PRODUCTION = process.env.NODE_ENV === 'production';
...@@ -187,6 +188,10 @@ if (IS_DEV_SERVER) { ...@@ -187,6 +188,10 @@ if (IS_DEV_SERVER) {
inline: DEV_SERVER_LIVERELOAD inline: DEV_SERVER_LIVERELOAD
}; };
config.output.publicPath = '//localhost:' + DEV_SERVER_PORT + config.output.publicPath; 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) { if (WEBPACK_REPORT) {
......
...@@ -223,7 +223,9 @@ class Gitlab::Seeder::CycleAnalytics ...@@ -223,7 +223,9 @@ class Gitlab::Seeder::CycleAnalytics
end end
Gitlab::Seeder.quiet do Gitlab::Seeder.quiet do
if ENV['SEED_CYCLE_ANALYTICS'] flag = 'SEED_CYCLE_ANALYTICS'
if ENV[flag]
Project.all.each do |project| Project.all.each do |project|
seeder = Gitlab::Seeder::CycleAnalytics.new(project) seeder = Gitlab::Seeder::CycleAnalytics.new(project)
seeder.seed! seeder.seed!
...@@ -235,6 +237,6 @@ Gitlab::Seeder.quiet do ...@@ -235,6 +237,6 @@ Gitlab::Seeder.quiet do
seeder = Gitlab::Seeder::CycleAnalytics.new(Project.order(:id).first, perf: true) seeder = Gitlab::Seeder::CycleAnalytics.new(Project.order(:id).first, perf: true)
seeder.seed_metrics! seeder.seed_metrics!
else 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
end end
...@@ -27,43 +27,49 @@ end ...@@ -27,43 +27,49 @@ end
Sidekiq::Testing.inline! do Sidekiq::Testing.inline! do
Gitlab::Seeder.quiet do Gitlab::Seeder.quiet do
project_urls = [ flag = 'SEED_NESTED_GROUPS'
'https://android.googlesource.com/platform/hardware/broadcom/libbt.git',
'https://android.googlesource.com/platform/hardware/broadcom/wlan.git',
'https://android.googlesource.com/platform/hardware/bsp/bootloader/intel/edison-u-boot.git',
'https://android.googlesource.com/platform/hardware/bsp/broadcom.git',
'https://android.googlesource.com/platform/hardware/bsp/freescale.git',
'https://android.googlesource.com/platform/hardware/bsp/imagination.git',
'https://android.googlesource.com/platform/hardware/bsp/intel.git',
'https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.1.git',
'https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.4.git'
]
user = User.admins.first if ENV[flag]
project_urls = [
'https://android.googlesource.com/platform/hardware/broadcom/libbt.git',
'https://android.googlesource.com/platform/hardware/broadcom/wlan.git',
'https://android.googlesource.com/platform/hardware/bsp/bootloader/intel/edison-u-boot.git',
'https://android.googlesource.com/platform/hardware/bsp/broadcom.git',
'https://android.googlesource.com/platform/hardware/bsp/freescale.git',
'https://android.googlesource.com/platform/hardware/bsp/imagination.git',
'https://android.googlesource.com/platform/hardware/bsp/intel.git',
'https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.1.git',
'https://android.googlesource.com/platform/hardware/bsp/kernel/common/v4.4.git'
]
project_urls.each_with_index do |url, i| user = User.admins.first
full_path = url.sub('https://android.googlesource.com/', '')
full_path = full_path.sub(/\.git\z/, '')
full_path, _, project_path = full_path.rpartition('/')
group = Group.find_by_full_path(full_path) || create_group_with_parents(user, full_path)
params = { project_urls.each_with_index do |url, i|
import_url: url, full_path = url.sub('https://android.googlesource.com/', '')
namespace_id: group.id, full_path = full_path.sub(/\.git\z/, '')
path: project_path, full_path, _, project_path = full_path.rpartition('/')
name: project_path, group = Group.find_by_full_path(full_path) || create_group_with_parents(user, full_path)
description: FFaker::Lorem.sentence,
visibility_level: Gitlab::VisibilityLevel.values.sample
}
project = Projects::CreateService.new(user, params).execute params = {
project.send(:_run_after_commit_queue) import_url: url,
namespace_id: group.id,
path: project_path,
name: project_path,
description: FFaker::Lorem.sentence,
visibility_level: Gitlab::VisibilityLevel.values.sample
}
if project.valid? project = Projects::CreateService.new(user, params).execute
print '.' project.send(:_run_after_commit_queue)
else
print 'F' if project.valid?
print '.'
else
print 'F'
end
end end
else
puts "Skipped. Use the `#{flag}` environment variable to enable."
end end
end 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 @@ ...@@ -12,6 +12,7 @@
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170408033905) do ActiveRecord::Schema.define(version: 20170408033905) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
enable_extension "pg_trgm" enable_extension "pg_trgm"
...@@ -1356,6 +1357,7 @@ ActiveRecord::Schema.define(version: 20170408033905) do ...@@ -1356,6 +1357,7 @@ ActiveRecord::Schema.define(version: 20170408033905) do
add_foreign_key "chat_teams", "namespaces", on_delete: :cascade 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_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_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_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 "ci_triggers", "users", column: "owner_id", name: "fk_e8e10d1964", on_delete: :cascade
add_foreign_key "container_repositories", "projects" add_foreign_key "container_repositories", "projects"
......
...@@ -110,9 +110,8 @@ Here is an collection of tutorials and guides on setting up your CI pipeline. ...@@ -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) - [Run PHP Composer & NPM scripts then deploy them to a staging server](examples/deployment/composer-npm-deploy.md)
- **Blog posts** - **Blog posts**
- [Automated Debian packaging](https://about.gitlab.com/2016/10/12/automated-debian-package-build-with-gitlab-ci/) - [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/) - [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 CI for iOS projects](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/)
- [Using 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/) - [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/) - [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/) - [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 ...@@ -7,10 +7,9 @@ you through better understanding GitLab's concepts
through our regular docs, and, when available, through articles (guides, through our regular docs, and, when available, through articles (guides,
tutorials, technical overviews, blog posts) and videos. tutorials, technical overviews, blog posts) and videos.
- [Authentication](authentication/index.md)
- [Continuous Integration (GitLab CI)](../ci/README.md) - [Continuous Integration (GitLab CI)](../ci/README.md)
- [Git](git/index.md)
- [GitLab Installation](../install/README.md) - [GitLab Installation](../install/README.md)
- [GitLab Pages](../user/project/pages/index.md) - [GitLab Pages](../user/project/pages/index.md)
>**Note:** >**Note:** More topics will be available soon.
More topics will be available soon. \ No newline at end of file
...@@ -57,7 +57,7 @@ sudo -u git -H bundle clean ...@@ -57,7 +57,7 @@ sudo -u git -H bundle clean
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
# Clean up assets and cache # 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 ### 4. Update gitlab-workhorse to the corresponding version
......
...@@ -29,6 +29,10 @@ module ContainerRegistry ...@@ -29,6 +29,10 @@ module ContainerRegistry
"#{repository.path}:#{name}" "#{repository.path}:#{name}"
end end
def location
"#{repository.location}:#{name}"
end
def [](key) def [](key)
return unless manifest return unless manifest
......
{ {
"private": true, "private": true,
"scripts": { "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": "eslint --max-warnings 0 --ext .js,.vue .",
"eslint-fix": "eslint --max-warnings 0 --ext .js,.vue --fix .", "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 .", "eslint-report": "eslint --max-warnings 0 --ext .js,.vue --format html --output-file ./eslint-report.html .",
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
"pikaday": "^1.5.1", "pikaday": "^1.5.1",
"raphael": "^2.2.7", "raphael": "^2.2.7",
"raw-loader": "^0.5.1", "raw-loader": "^0.5.1",
"react-dev-utils": "^0.5.2",
"select2": "3.5.2-browserify", "select2": "3.5.2-browserify",
"stats-webpack-plugin": "^0.4.3", "stats-webpack-plugin": "^0.4.3",
"three": "^0.84.0", "three": "^0.84.0",
...@@ -69,6 +70,7 @@ ...@@ -69,6 +70,7 @@
"karma-phantomjs-launcher": "^1.0.2", "karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.7", "karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.2", "karma-webpack": "^2.0.2",
"nodemon": "^1.11.0",
"webpack-dev-server": "^2.4.2" "webpack-dev-server": "^2.4.2"
} }
} }
...@@ -15,21 +15,12 @@ retry() { ...@@ -15,21 +15,12 @@ retry() {
return 1 return 1
} }
if [ -f /.dockerenv ] || [ -f ./dockerinit ]; then cp config/database.yml.mysql config/database.yml
cp config/database.yml.mysql config/database.yml sed -i 's/username:.*/username: root/g' 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/password:.*/password:/g' config/database.yml sed -i 's/# socket:.*/host: mysql/g' config/database.yml
sed -i 's/# socket:.*/host: mysql/g' config/database.yml
cp config/resque.yml.example config/resque.yml cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml sed -i 's/localhost/redis/g' config/resque.yml
export FLAGS="--path vendor --retry 3 --quiet" 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
require 'spec_helper' require 'spec_helper'
feature 'Dashboard shortcuts', feature: true, js: true do feature 'Dashboard shortcuts', feature: true, js: true do
before do context 'logged in' do
login_as :user before do
visit root_dashboard_path login_as :user
end visit root_dashboard_path
end
scenario 'Navigate to tabs' do
find('body').native.send_keys([:shift, 'P'])
check_page_title('Projects')
find('body').native.send_key([:shift, 'I'])
check_page_title('Issues')
scenario 'Navigate to tabs' do find('body').native.send_key([:shift, 'M'])
find('body').native.send_keys([:shift, 'P'])
check_page_title('Merge Requests')
find('body').native.send_keys([:shift, 'T'])
check_page_title('Todos')
end
end
check_page_title('Projects') context 'logged out' do
before do
visit explore_root_path
end
find('body').native.send_key([:shift, 'I']) scenario 'Navigate to tabs' do
find('body').native.send_keys([:shift, 'P'])
check_page_title('Issues') expect(page).to have_content('No projects found')
find('body').native.send_key([:shift, 'M']) find('body').native.send_keys([:shift, 'G'])
check_page_title('Merge Requests') expect(page).to have_content('No public groups')
find('body').native.send_keys([:shift, 'T']) find('body').native.send_keys([:shift, 'S'])
check_page_title('Todos') expect(page).to have_selector('.snippets-list-holder')
end
end end
def check_page_title(title) def check_page_title(title)
......
...@@ -89,6 +89,19 @@ feature 'Merge When Pipeline Succeeds', :feature, :js do ...@@ -89,6 +89,19 @@ feature 'Merge When Pipeline Succeeds', :feature, :js do
it_behaves_like 'Merge when pipeline succeeds activator' it_behaves_like 'Merge when pipeline succeeds activator'
end end
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 end
context 'when merge when pipeline succeeds is enabled' do context 'when merge when pipeline succeeds is enabled' do
......
...@@ -86,10 +86,10 @@ describe PreferencesHelper do ...@@ -86,10 +86,10 @@ describe PreferencesHelper do
context 'when repository is not empty' do context 'when repository is not empty' do
let(:project) { create(:project, :public, :repository) } 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) 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 end
it 'returns activity if user does not have repository access' do it 'returns activity if user does not have repository access' do
......
...@@ -50,6 +50,13 @@ describe ContainerRegistry::Tag do ...@@ -50,6 +50,13 @@ describe ContainerRegistry::Tag do
end end
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 'manifest processing' do
context 'schema v1' do context 'schema v1' do
before 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 ...@@ -4,7 +4,7 @@ describe ContainerRepository do
let(:group) { create(:group, name: 'group') } let(:group) { create(:group, name: 'group') }
let(:project) { create(:project, path: 'test', group: group) } let(:project) { create(:project, path: 'test', group: group) }
let(:container_repository) do let(:repository) do
create(:container_repository, name: 'my_image', project: project) create(:container_repository, name: 'my_image', project: project)
end end
...@@ -23,48 +23,48 @@ describe ContainerRepository do ...@@ -23,48 +23,48 @@ describe ContainerRepository do
describe 'associations' do describe 'associations' do
it 'belongs to the project' do it 'belongs to the project' do
expect(container_repository).to belong_to(:project) expect(repository).to belong_to(:project)
end end
end end
describe '#tag' do describe '#tag' do
it 'has a test 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
end end
describe '#path' do describe '#path' do
it 'returns a full path to the repository' 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
end end
describe '#manifest' do describe '#manifest' do
subject { container_repository.manifest } it 'returns non-empty manifest' do
expect(repository.manifest).not_to be_nil
it { is_expected.not_to be_nil } end
end end
describe '#valid?' do describe '#valid?' do
subject { container_repository.valid? } it 'is a valid repository' do
expect(repository).to be_valid
it { is_expected.to be_truthy } end
end end
describe '#tags' do describe '#tags' do
subject { container_repository.tags } it 'returns non-empty tags list' do
expect(repository.tags).not_to be_empty
it { is_expected.not_to be_empty } end
end end
describe '#has_tags?' do describe '#has_tags?' do
it 'has tags' do it 'has tags' do
expect(container_repository).to have_tags expect(repository).to have_tags
end end
end end
describe '#delete_tags!' do describe '#delete_tags!' do
let(:container_repository) do let(:repository) do
create(:container_repository, name: 'my_image', create(:container_repository, name: 'my_image',
tags: %w[latest rc1], tags: %w[latest rc1],
project: project) project: project)
...@@ -72,21 +72,36 @@ describe ContainerRepository do ...@@ -72,21 +72,36 @@ describe ContainerRepository do
context 'when action succeeds' do context 'when action succeeds' do
it 'returns status that indicates success' do it 'returns status that indicates success' do
expect(container_repository.client) expect(repository.client)
.to receive(:delete_repository_tag) .to receive(:delete_repository_tag)
.and_return(true) .and_return(true)
expect(container_repository.delete_tags!).to be_truthy expect(repository.delete_tags!).to be_truthy
end end
end end
context 'when action fails' do context 'when action fails' do
it 'returns status that indicates failure' do it 'returns status that indicates failure' do
expect(container_repository.client) expect(repository.client)
.to receive(:delete_repository_tag) .to receive(:delete_repository_tag)
.and_return(false) .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 end
end end
...@@ -102,7 +117,7 @@ describe ContainerRepository do ...@@ -102,7 +117,7 @@ describe ContainerRepository do
context 'when repository is not a root repository' do context 'when repository is not a root repository' do
it 'returns false' do it 'returns false' do
expect(container_repository).not_to be_root_repository expect(repository).not_to be_root_repository
end end
end end
end end
......
...@@ -134,15 +134,6 @@ describe Issue, models: true do ...@@ -134,15 +134,6 @@ describe Issue, models: true do
end end
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 describe '#closed_by_merge_requests' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:issue) { create(:issue, project: project)} let(:issue) { create(:issue, project: project)}
......
...@@ -1283,8 +1283,6 @@ describe Repository, models: true do ...@@ -1283,8 +1283,6 @@ describe Repository, models: true do
describe '#after_import' do describe '#after_import' do
it 'flushes and builds the cache' do it 'flushes and builds the cache' do
expect(repository).to receive(:expire_content_cache) expect(repository).to receive(:expire_content_cache)
expect(repository).to receive(:expire_tags_cache)
expect(repository).to receive(:expire_branches_cache)
repository.after_import repository.after_import
end 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 @@ ...@@ -45,6 +45,7 @@
# Kernel Module Compile Results # Kernel Module Compile Results
*.mod* *.mod*
*.cmd *.cmd
.tmp_versions/
modules.order modules.order
Module.symvers Module.symvers
Mkfile.old Mkfile.old
......
# See https://www.dartlang.org/tools/private-files.html # See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub # Files and directories created by pub
# SDK 1.20 and later (no longer creates packages directories)
.packages .packages
.pub/ .pub/
build/ build/
# If you're building an application, you may want to check-in your pubspec.lock
# Older SDK versions pubspec.lock
# (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
# Directory created by dartdoc # Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/ 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 ...@@ -11,9 +11,6 @@ local.properties
.loadpath .loadpath
.recommenders .recommenders
# Eclipse Core
.project
# External tool builders # External tool builders
.externalToolBuilders/ .externalToolBuilders/
...@@ -26,9 +23,6 @@ local.properties ...@@ -26,9 +23,6 @@ local.properties
# CDT-specific (C/C++ Development Tooling) # CDT-specific (C/C++ Development Tooling)
.cproject .cproject
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Java annotation processor (APT) # Java annotation processor (APT)
.factorypath .factorypath
......
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
# JIRA plugin # JIRA plugin
atlassian-ide-plugin.xml atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ) # Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml com_crashlytics_export_strings.xml
crashlytics.properties crashlytics.properties
......
*.DS_Store *.DS_Store
.AppleDouble .AppleDouble
.LSOverride .LSOverride
# Icon must end with two \r # Icon must end with two \r
Icon Icon
# Thumbnails
# Thumbnails ._*
._*
# Files that might appear in the root of a volume
# Files that might appear in the root of a volume .DocumentRevisions-V100
.DocumentRevisions-V100 .fseventsd
.fseventsd .Spotlight-V100
.Spotlight-V100 .TemporaryItems
.TemporaryItems .Trashes
.Trashes .VolumeIcon.icns
.VolumeIcon.icns .com.apple.timemachine.donotpresent
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
# Directories potentially created on remote AFP share .AppleDB
.AppleDB .AppleDesktop
.AppleDesktop Network Trash Folder
Network Trash Folder Temporary Items
Temporary Items .apdisk
.apdisk
......
...@@ -92,3 +92,6 @@ ENV/ ...@@ -92,3 +92,6 @@ ENV/
# Rope project settings # Rope project settings
.ropeproject .ropeproject
# mkdocs documentation
/site
...@@ -8,7 +8,7 @@ capybara-*.html ...@@ -8,7 +8,7 @@ capybara-*.html
/public/system /public/system
/coverage/ /coverage/
/spec/tmp /spec/tmp
**.orig *.orig
rerun.txt rerun.txt
pickle-email-*.html pickle-email-*.html
......
...@@ -148,6 +148,9 @@ _minted* ...@@ -148,6 +148,9 @@ _minted*
# pax # pax
*.pax *.pax
# pdfpcnotes
*.pdfpc
# sagetex # sagetex
*.sagetex.sage *.sagetex.sage
*.sagetex.py *.sagetex.py
......
...@@ -23,7 +23,6 @@ ExportedObj/ ...@@ -23,7 +23,6 @@ ExportedObj/
*.svd *.svd
*.pdb *.pdb
# Unity3D generated meta files # Unity3D generated meta files
*.pidb.meta *.pidb.meta
......
...@@ -219,6 +219,7 @@ UpgradeLog*.htm ...@@ -219,6 +219,7 @@ UpgradeLog*.htm
# SQL Server files # SQL Server files
*.mdf *.mdf
*.ldf *.ldf
*.ndf
# Business Intelligence projects # Business Intelligence projects
*.rdl.data *.rdl.data
...@@ -284,4 +285,4 @@ __pycache__/ ...@@ -284,4 +285,4 @@ __pycache__/
*.btp.cs *.btp.cs
*.btm.cs *.btm.cs
*.odx.cs *.odx.cs
*.xsd.cs *.xsd.cs
\ No newline at end of file
...@@ -26,9 +26,24 @@ before_script: ...@@ -26,9 +26,24 @@ before_script:
# - apt-get update -q && apt-get install nodejs -yqq # - apt-get update -q && apt-get install nodejs -yqq
- pip install -r requirements.txt - 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: test:
variables: variables:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB" DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
script: script:
- python manage.py migrate
- python manage.py test - python manage.py test
# Full project: https://gitlab.com/pages/hexo # Full project: https://gitlab.com/pages/hexo
image: node:4.2.2 image: node:6.10.0
pages: pages:
cache:
paths:
- node_modules/
script: script:
- npm install hexo-cli -g
- npm install - npm install
- hexo deploy - ./node_modules/hexo/bin/hexo generate
artifacts: artifacts:
paths: paths:
- public - public
cache:
paths:
- node_modules
key: project
only: only:
- master - master
# Template project: https://gitlab.com/pages/jekyll # Template project: https://gitlab.com/pages/jekyll
# Docs: https://docs.gitlab.com/ce/pages/ # Docs: https://docs.gitlab.com/ce/pages/
# Jekyll version: 3.4.0
image: ruby:2.3 image: ruby:2.3
variables:
JEKYLL_ENV: production
before_script: before_script:
- bundle install - bundle install
...@@ -25,4 +27,4 @@ pages: ...@@ -25,4 +27,4 @@ pages:
- public - public
only: only:
- master - master
\ No newline at end of file
...@@ -9,7 +9,7 @@ before_script: ...@@ -9,7 +9,7 @@ before_script:
- apt-get install apt-transport-https -yqq - apt-get install apt-transport-https -yqq
# Add keyserver for SBT # Add keyserver for SBT
- echo "deb http://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list - 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 # Install SBT
- apt-get update -yqq - apt-get update -yqq
- apt-get install sbt -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