Commit 40e17727 authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'master' into per-project-pipeline-iid

parents 7622f5ab 93498185
...@@ -218,9 +218,6 @@ gem 'ruby-fogbugz', '~> 0.2.1' ...@@ -218,9 +218,6 @@ gem 'ruby-fogbugz', '~> 0.2.1'
# Kubernetes integration # Kubernetes integration
gem 'kubeclient', '~> 3.0' gem 'kubeclient', '~> 3.0'
# d3
gem 'd3_rails', '~> 3.5.0'
# Sanitize user input # Sanitize user input
gem 'sanitize', '~> 2.0' gem 'sanitize', '~> 2.0'
gem 'babosa', '~> 1.0.2' gem 'babosa', '~> 1.0.2'
......
...@@ -147,8 +147,6 @@ GEM ...@@ -147,8 +147,6 @@ GEM
creole (0.5.0) creole (0.5.0)
css_parser (1.5.0) css_parser (1.5.0)
addressable addressable
d3_rails (3.5.11)
railties (>= 3.1.0)
daemons (1.2.3) daemons (1.2.3)
database_cleaner (1.5.3) database_cleaner (1.5.3)
debug_inspector (0.0.2) debug_inspector (0.0.2)
...@@ -1024,7 +1022,6 @@ DEPENDENCIES ...@@ -1024,7 +1022,6 @@ DEPENDENCIES
concurrent-ruby (~> 1.0.5) concurrent-ruby (~> 1.0.5)
connection_pool (~> 2.0) connection_pool (~> 2.0)
creole (~> 0.5.0) creole (~> 0.5.0)
d3_rails (~> 3.5.0)
database_cleaner (~> 1.5.0) database_cleaner (~> 1.5.0)
deckar01-task_list (= 2.0.0) deckar01-task_list (= 2.0.0)
default_value_for (~> 3.0.0) default_value_for (~> 3.0.0)
......
...@@ -82,7 +82,6 @@ export default () => { ...@@ -82,7 +82,6 @@ export default () => {
this.service this.service
.fetchCycleAnalyticsData(fetchOptions) .fetchCycleAnalyticsData(fetchOptions)
.then(resp => resp.json())
.then((response) => { .then((response) => {
this.store.setCycleAnalyticsData(response); this.store.setCycleAnalyticsData(response);
this.selectDefaultStage(); this.selectDefaultStage();
...@@ -116,7 +115,6 @@ export default () => { ...@@ -116,7 +115,6 @@ export default () => {
stage, stage,
startDate: this.startDate, startDate: this.startDate,
}) })
.then(resp => resp.json())
.then((response) => { .then((response) => {
this.isEmptyStage = !response.events.length; this.isEmptyStage = !response.events.length;
this.store.setStageEvents(response.events, stage); this.store.setStageEvents(response.events, stage);
......
import Vue from 'vue'; import axios from '~/lib/utils/axios_utils';
import VueResource from 'vue-resource';
Vue.use(VueResource);
export default class CycleAnalyticsService { export default class CycleAnalyticsService {
constructor(options) { constructor(options) {
this.requestPath = options.requestPath; this.axios = axios.create({
this.cycleAnalytics = Vue.resource(this.requestPath); baseURL: options.requestPath,
});
} }
fetchCycleAnalyticsData(options = { startDate: 30 }) { fetchCycleAnalyticsData(options = { startDate: 30 }) {
return this.cycleAnalytics.get({ cycle_analytics: { start_date: options.startDate } }); return this.axios
.get('', {
params: {
'cycle_analytics[start_date]': options.startDate,
},
})
.then(x => x.data);
} }
fetchStageData(options) { fetchStageData(options) {
...@@ -19,12 +23,12 @@ export default class CycleAnalyticsService { ...@@ -19,12 +23,12 @@ export default class CycleAnalyticsService {
startDate, startDate,
} = options; } = options;
return Vue.http.get(`${this.requestPath}/events/${stage.name}.json`, { return this.axios
.get(`events/${stage.name}.json`, {
params: { params: {
cycle_analytics: { 'cycle_analytics[start_date]': startDate,
start_date: startDate,
},
}, },
}); })
.then(x => x.data);
} }
} }
import Vue from 'vue'; import axios from '~/lib/utils/axios_utils';
import VueResource from 'vue-resource';
Vue.use(VueResource);
export default class DeployKeysService { export default class DeployKeysService {
constructor(endpoint) { constructor(endpoint) {
this.endpoint = endpoint; this.axios = axios.create({
baseURL: endpoint,
this.resource = Vue.resource( });
`${this.endpoint}{/id}`,
{},
{
enable: {
method: 'PUT',
url: `${this.endpoint}{/id}/enable`,
},
disable: {
method: 'PUT',
url: `${this.endpoint}{/id}/disable`,
},
},
);
} }
getKeys() { getKeys() {
return this.resource.get().then(response => response.json()); return this.axios.get()
.then(response => response.data);
} }
enableKey(id) { enableKey(id) {
return this.resource.enable({ id }, {}); return this.axios.put(`${id}/enable`)
.then(response => response.data);
} }
disableKey(id) { disableKey(id) {
return this.resource.disable({ id }, {}); return this.axios.put(`${id}/disable`)
.then(response => response.data);
} }
} }
...@@ -14,12 +14,12 @@ export default class Model { ...@@ -14,12 +14,12 @@ export default class Model {
(this.originalModel = this.monaco.editor.createModel( (this.originalModel = this.monaco.editor.createModel(
head ? head.content : this.file.raw, head ? head.content : this.file.raw,
undefined, undefined,
new this.monaco.Uri(null, null, `original/${this.file.key}`), new this.monaco.Uri(null, null, `original/${this.path}`),
)), )),
(this.model = this.monaco.editor.createModel( (this.model = this.monaco.editor.createModel(
this.content, this.content,
undefined, undefined,
new this.monaco.Uri(null, null, this.file.key), new this.monaco.Uri(null, null, this.path),
)), )),
); );
if (this.file.mrChange) { if (this.file.mrChange) {
...@@ -27,7 +27,7 @@ export default class Model { ...@@ -27,7 +27,7 @@ export default class Model {
(this.baseModel = this.monaco.editor.createModel( (this.baseModel = this.monaco.editor.createModel(
this.file.baseRaw, this.file.baseRaw,
undefined, undefined,
new this.monaco.Uri(null, null, `target/${this.file.path}`), new this.monaco.Uri(null, null, `target/${this.path}`),
)), )),
); );
} }
......
...@@ -196,6 +196,8 @@ export const unstageChange = ({ commit }, path) => { ...@@ -196,6 +196,8 @@ export const unstageChange = ({ commit }, path) => {
}; };
export const openPendingTab = ({ commit, getters, dispatch, state }, { file, keyPrefix }) => { export const openPendingTab = ({ commit, getters, dispatch, state }, { file, keyPrefix }) => {
if (getters.activeFile && getters.activeFile.key === `${keyPrefix}-${file.key}`) return false;
state.openFiles.forEach(f => eventHub.$emit(`editor.update.model.dispose.${f.key}`)); state.openFiles.forEach(f => eventHub.$emit(`editor.update.model.dispose.${f.key}`));
commit(types.ADD_PENDING_TAB, { file, keyPrefix }); commit(types.ADD_PENDING_TAB, { file, keyPrefix });
......
...@@ -36,7 +36,9 @@ ul.notes-form, ...@@ -36,7 +36,9 @@ ul.notes-form,
.gutter-toggle, .gutter-toggle,
.issuable-details .content-block-small, .issuable-details .content-block-small,
.edit-link, .edit-link,
.note-action-button { .note-action-button,
.right-sidebar,
.flash-container {
display: none !important; display: none !important;
} }
...@@ -53,3 +55,7 @@ pre { ...@@ -53,3 +55,7 @@ pre {
.right-sidebar { .right-sidebar {
top: 0; top: 0;
} }
a[href]::after {
content: none !important;
}
...@@ -58,6 +58,7 @@ module Ci ...@@ -58,6 +58,7 @@ module Ci
validate :tag_constraints validate :tag_constraints
validate :either_projects_or_group validate :either_projects_or_group
validates :access_level, presence: true validates :access_level, presence: true
validates :runner_type, presence: true
acts_as_taggable acts_as_taggable
......
...@@ -43,12 +43,20 @@ module Clusters ...@@ -43,12 +43,20 @@ module Clusters
def create_and_assign_runner def create_and_assign_runner
transaction do transaction do
project.runners.create!(name: 'kubernetes-cluster', tag_list: %w(kubernetes cluster)).tap do |runner| project.runners.create!(runner_create_params).tap do |runner|
update!(runner_id: runner.id) update!(runner_id: runner.id)
end end
end end
end end
def runner_create_params
{
name: 'kubernetes-cluster',
runner_type: :project_type,
tag_list: %w(kubernetes cluster)
}
end
def gitlab_url def gitlab_url
Gitlab::Routing.url_helpers.root_url(only_path: false) Gitlab::Routing.url_helpers.root_url(only_path: false)
end end
......
...@@ -37,7 +37,7 @@ class Repository ...@@ -37,7 +37,7 @@ class Repository
changelog license_blob license_key gitignore koding_yml changelog license_blob license_key gitignore koding_yml
gitlab_ci_yml branch_names tag_names branch_count gitlab_ci_yml branch_names tag_names branch_count
tag_count avatar exists? root_ref has_visible_content? tag_count avatar exists? root_ref has_visible_content?
issue_template_names merge_request_template_names).freeze issue_template_names merge_request_template_names xcode_project?).freeze
# Methods that use cache_method but only memoize the value # Methods that use cache_method but only memoize the value
MEMOIZED_CACHED_METHODS = %i(license).freeze MEMOIZED_CACHED_METHODS = %i(license).freeze
...@@ -55,7 +55,8 @@ class Repository ...@@ -55,7 +55,8 @@ class Repository
gitlab_ci: :gitlab_ci_yml, gitlab_ci: :gitlab_ci_yml,
avatar: :avatar, avatar: :avatar,
issue_template: :issue_template_names, issue_template: :issue_template_names,
merge_request_template: :merge_request_template_names merge_request_template: :merge_request_template_names,
xcode_config: :xcode_project?
}.freeze }.freeze
def initialize(full_path, project, disk_path: nil, is_wiki: false) def initialize(full_path, project, disk_path: nil, is_wiki: false)
...@@ -594,6 +595,11 @@ class Repository ...@@ -594,6 +595,11 @@ class Repository
end end
cache_method :gitlab_ci_yml cache_method :gitlab_ci_yml
def xcode_project?
file_on_head(:xcode_config).present?
end
cache_method :xcode_project?
def head_commit def head_commit
@head_commit ||= commit(self.root_ref) @head_commit ||= commit(self.root_ref)
end end
......
- link = link_to 'Runners API', help_page_path('api/runners.md') - link = link_to _('Runners API'), help_page_path('api/runners.md')
%h3 %h3
= _('Group Runners') = _('Group Runners')
......
- page_title "Edit", "#{@runner.description} ##{@runner.id}", "Runners" - page_title _('Edit'), "#{@runner.description} ##{@runner.id}", 'Runners'
%h4 Runner ##{@runner.id} %h4 Runner ##{@runner.id}
......
- link = link_to 'Runners API', help_page_path('api/runners.md') - link = link_to _('Runners API'), help_page_path('api/runners.md')
%h3 %h3
= _('Group Runners') = _('Group Runners')
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
= _('This group does not provide any group Runners yet.') = _('This group does not provide any group Runners yet.')
- if can?(current_user, :admin_pipeline, @project.group) - if can?(current_user, :admin_pipeline, @project.group)
- group_link = link_to 'Group CI/CD settings', group_settings_ci_cd_path(@project.group) - group_link = link_to _('Group CI/CD settings'), group_settings_ci_cd_path(@project.group)
= _('Group masters can register group runners in the %{link}').html_safe % { link: group_link } = _('Group masters can register group runners in the %{link}').html_safe % { link: group_link }
- else - else
= _('Ask your group master to setup a group Runner.') = _('Ask your group master to setup a group Runner.')
......
%h3 Shared Runners %h3
= _('Shared Runners')
.bs-callout.shared-runners-description .bs-callout.shared-runners-description
- if Gitlab::CurrentSettings.shared_runners_text.present? - if Gitlab::CurrentSettings.shared_runners_text.present?
...@@ -17,8 +18,7 @@ ...@@ -17,8 +18,7 @@
  for this project   for this project
- if @shared_runners_count.zero? - if @shared_runners_count.zero?
This GitLab instance does not provide any shared Runners yet. Instance = _('This GitLab instance does not provide any shared Runners yet. Instance administrators can register shared Runners in the admin area.')
administrators can register shared Runners in the admin area.
- else - else
%h4.underlined-title Available shared Runners : #{@shared_runners_count} %h4.underlined-title Available shared Runners : #{@shared_runners_count}
%ul.bordered-list.available-shared-runners %ul.bordered-list.available-shared-runners
......
%h3 Specific Runners %h3
= _('Specific Runners')
= render partial: 'ci/runner/how_to_setup_specific_runner', = render partial: 'ci/runner/how_to_setup_specific_runner',
locals: { registration_token: @project.runners_token } locals: { registration_token: @project.runners_token }
......
- page_title "Edit", "#{@runner.description} ##{@runner.id}", "Runners" - page_title _('Edit'), "#{@runner.description} ##{@runner.id}", 'Runners'
%h4 Runner ##{@runner.id} %h4 Runner ##{@runner.id}
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
%span.light Indicates whether this runner can pick jobs without tags %span.light Indicates whether this runner can pick jobs without tags
- unless runner.group_type? - unless runner.group_type?
.form-group .form-group
= label :locked, 'Lock to current projects', class: 'control-label' = label :locked, _('Lock to current projects'), class: 'control-label'
.col-sm-10 .col-sm-10
.checkbox .checkbox
= f.check_box :locked = f.check_box :locked
%span.light When a runner is locked, it cannot be assigned to other projects %span.light= _('When a runner is locked, it cannot be assigned to other projects')
.form-group .form-group
= label_tag :token, class: 'control-label' do = label_tag :token, class: 'control-label' do
Token Token
......
...@@ -21,17 +21,17 @@ ...@@ -21,17 +21,17 @@
%th Value %th Value
%tr %tr
%td Active %td Active
%td= @runner.active? ? 'Yes' : 'No' %td= @runner.active? ? _('Yes') : _('No')
%tr %tr
%td Protected %td Protected
%td= @runner.ref_protected? ? 'Yes' : 'No' %td= @runner.ref_protected? ? _('Yes') : _('No')
%tr %tr
%td Can run untagged jobs %td= _('Can run untagged jobs')
%td= @runner.run_untagged? ? 'Yes' : 'No' %td= @runner.run_untagged? ? _('Yes') : _('No')
- unless @runner.group_type? - unless @runner.group_type?
%tr %tr
%td Locked to this project %td= _('Locked to this project')
%td= @runner.locked? ? 'Yes' : 'No' %td= @runner.locked? ? _('Yes') : _('No')
%tr %tr
%td Tags %td Tags
%td %td
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
%td Description %td Description
%td= @runner.description %td= @runner.description
%tr %tr
%td Maximum job timeout %td= _('Maximum job timeout')
%td= @runner.maximum_timeout_human_readable %td= @runner.maximum_timeout_human_readable
%tr %tr
%td Last contact %td Last contact
......
---
title: Fix print styles for markdown pages
merge_request:
author:
type: fixed
---
title: 'Replace the `project/deploy_keys.feature` spinach test with an rspec analog'
merge_request: 18796
author: '@blackst0ne'
type: other
---
title: 'Replace the `project/issues/references.feature` spinach test with an rspec analog'
merge_request: 18769
author: '@blackst0ne'
type: other
---
title: Fixes database inconsistencies between Community and Enterprise Edition on
import state
merge_request: 18811
author:
type: fixed
---
title: Add support for 'active' setting on Runner Registration API endpoint
merge_request: 18848
author:
type: changed
class InitSchema < ActiveRecord::Migration class InitSchema < ActiveRecord::Migration
DOWNTIME = true
def up def up
create_table "broadcast_messages", force: :cascade do |t| create_table "broadcast_messages", force: :cascade do |t|
t.text "message", null: false t.text "message", null: false
......
...@@ -2,6 +2,7 @@ class CleanupBuildStageMigration < ActiveRecord::Migration ...@@ -2,6 +2,7 @@ class CleanupBuildStageMigration < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
DOWNTIME = false DOWNTIME = false
TMP_INDEX = 'tmp_id_stage_partial_null_index'.freeze
disable_ddl_transaction! disable_ddl_transaction!
...@@ -13,16 +14,48 @@ class CleanupBuildStageMigration < ActiveRecord::Migration ...@@ -13,16 +14,48 @@ class CleanupBuildStageMigration < ActiveRecord::Migration
end end
def up def up
disable_statement_timeout
##
# We steal from the background migrations queue to catch up with the
# scheduled migrations set.
#
Gitlab::BackgroundMigration.steal('MigrateBuildStage') Gitlab::BackgroundMigration.steal('MigrateBuildStage')
##
# We add temporary index, to make iteration over batches more performant.
# Conditional here is to avoid the need of doing that in a separate
# migration file to make this operation idempotent.
#
unless index_exists_by_name?(:ci_builds, TMP_INDEX)
add_concurrent_index(:ci_builds, :id, where: 'stage_id IS NULL', name: TMP_INDEX)
end
##
# We check if there are remaining rows that should be migrated (for example
# if Sidekiq / Redis fails / is restarted, what could result in not all
# background migrations being executed correctly.
#
# We migrate remaining rows synchronously in a blocking way, to make sure
# that when this migration is done we are confident that all rows are
# already migrated.
#
Build.where('stage_id IS NULL').each_batch(of: 50) do |batch| Build.where('stage_id IS NULL').each_batch(of: 50) do |batch|
range = batch.pluck('MIN(id)', 'MAX(id)').first range = batch.pluck('MIN(id)', 'MAX(id)').first
Gitlab::BackgroundMigration::MigrateBuildStage.new.perform(*range) Gitlab::BackgroundMigration::MigrateBuildStage.new.perform(*range)
end end
##
# We remove temporary index, because it is not required during standard
# operations and runtime.
#
remove_concurrent_index_by_name(:ci_builds, TMP_INDEX)
end end
def down def down
# noop if index_exists_by_name?(:ci_builds, TMP_INDEX)
remove_concurrent_index_by_name(:ci_builds, TMP_INDEX)
end
end end
end end
class AddNotNullConstraintToProjectMirrorDataForeignKey < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
class ProjectImportState < ActiveRecord::Base
include EachBatch
self.table_name = 'project_mirror_data'
end
def up
ProjectImportState.where(project_id: nil).delete_all
change_column_null :project_mirror_data, :project_id, false
end
def down
change_column_null :project_mirror_data, :project_id, true
end
end
class AddUniqueConstraintToProjectMirrorDataProjectIdIndex < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index(:project_mirror_data,
:project_id,
unique: true,
name: 'index_project_mirror_data_on_project_id_unique')
remove_concurrent_index_by_name(:project_mirror_data, 'index_project_mirror_data_on_project_id')
rename_index(:project_mirror_data,
'index_project_mirror_data_on_project_id_unique',
'index_project_mirror_data_on_project_id')
end
def down
rename_index(:project_mirror_data,
'index_project_mirror_data_on_project_id',
'index_project_mirror_data_on_project_id_old')
add_concurrent_index(:project_mirror_data, :project_id)
remove_concurrent_index_by_name(:project_mirror_data,
'index_project_mirror_data_on_project_id_old')
end
end
class SetRunnerTypeNotNull < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
change_column_null(:ci_runners, :runner_type, false)
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,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: 20180508055821) do ActiveRecord::Schema.define(version: 20180508135515) 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"
...@@ -499,7 +499,7 @@ ActiveRecord::Schema.define(version: 20180508055821) do ...@@ -499,7 +499,7 @@ ActiveRecord::Schema.define(version: 20180508055821) do
t.integer "access_level", default: 0, null: false t.integer "access_level", default: 0, null: false
t.string "ip_address" t.string "ip_address"
t.integer "maximum_timeout" t.integer "maximum_timeout"
t.integer "runner_type", limit: 2 t.integer "runner_type", limit: 2, null: false
end end
add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree
...@@ -1531,14 +1531,14 @@ ActiveRecord::Schema.define(version: 20180508055821) do ...@@ -1531,14 +1531,14 @@ ActiveRecord::Schema.define(version: 20180508055821) do
add_index "project_import_data", ["project_id"], name: "index_project_import_data_on_project_id", using: :btree add_index "project_import_data", ["project_id"], name: "index_project_import_data_on_project_id", using: :btree
create_table "project_mirror_data", force: :cascade do |t| create_table "project_mirror_data", force: :cascade do |t|
t.integer "project_id" t.integer "project_id", null: false
t.string "status" t.string "status"
t.string "jid" t.string "jid"
t.text "last_error" t.text "last_error"
end end
add_index "project_mirror_data", ["jid"], name: "index_project_mirror_data_on_jid", using: :btree add_index "project_mirror_data", ["jid"], name: "index_project_mirror_data_on_jid", using: :btree
add_index "project_mirror_data", ["project_id"], name: "index_project_mirror_data_on_project_id", using: :btree add_index "project_mirror_data", ["project_id"], name: "index_project_mirror_data_on_project_id", unique: true, using: :btree
add_index "project_mirror_data", ["status"], name: "index_project_mirror_data_on_status", using: :btree add_index "project_mirror_data", ["status"], name: "index_project_mirror_data_on_status", using: :btree
create_table "project_statistics", force: :cascade do |t| create_table "project_statistics", force: :cascade do |t|
...@@ -2150,6 +2150,7 @@ ActiveRecord::Schema.define(version: 20180508055821) do ...@@ -2150,6 +2150,7 @@ ActiveRecord::Schema.define(version: 20180508055821) do
add_foreign_key "ci_build_trace_sections", "ci_builds", column: "build_id", name: "fk_4ebe41f502", on_delete: :cascade add_foreign_key "ci_build_trace_sections", "ci_builds", column: "build_id", name: "fk_4ebe41f502", on_delete: :cascade
add_foreign_key "ci_build_trace_sections", "projects", on_delete: :cascade add_foreign_key "ci_build_trace_sections", "projects", 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_builds", "ci_pipelines", column: "commit_id", name: "fk_d3130c9a7f", on_delete: :cascade
add_foreign_key "ci_builds", "ci_stages", column: "stage_id", name: "fk_3a9eaa254d", on_delete: :cascade add_foreign_key "ci_builds", "ci_stages", column: "stage_id", name: "fk_3a9eaa254d", on_delete: :cascade
add_foreign_key "ci_builds", "projects", name: "fk_befce0568a", on_delete: :cascade add_foreign_key "ci_builds", "projects", name: "fk_befce0568a", on_delete: :cascade
add_foreign_key "ci_builds_metadata", "ci_builds", column: "build_id", on_delete: :cascade add_foreign_key "ci_builds_metadata", "ci_builds", column: "build_id", on_delete: :cascade
......
--- ---
comments: false comments: false
description: 'Learn how to use and administer GitLab, the most scalable Git-based fully integrated platform for software development.'
--- ---
# GitLab Documentation # GitLab Documentation
......
# Configure GitLab using an external PostgreSQL service
If you're hosting GitLab on a cloud provider, you can optionally use a
managed service for PostgreSQL. For example, AWS offers a managed Relational
Database Service (RDS) that runs PostgreSQL.
Alternatively, you may opt to manage your own PostgreSQL instance or cluster
separate from the GitLab Omnibus package.
If you use a cloud-managed service, or provide your own PostgreSQL instance:
1. Setup PostgreSQL according to the
[database requirements document](../install/requirements.md#database).
1. Set up a `gitlab` username with a password of your choice. The `gitlab` user
needs privileges to create the `gitlabhq_production` database.
1. Configure the GitLab application servers with the appropriate details.
This step is covered in [Configuring GitLab for HA](high_availability/gitlab.md).
---
description: 'Learn how to install, configure, update, and maintain your GitLab instance.'
---
# Administrator documentation **[CORE ONLY]** # Administrator documentation **[CORE ONLY]**
Learn how to administer your GitLab instance (Community Edition and Learn how to administer your GitLab instance (Community Edition and
......
---
description: 'Learn how to administer GitLab Pages.'
---
# GitLab Pages administration # GitLab Pages administration
> **Notes:** > **Notes:**
...@@ -8,8 +12,6 @@ ...@@ -8,8 +12,6 @@
GitLab from source, follow the [Pages source installation document](source.md). GitLab from source, follow the [Pages source installation document](source.md).
- To learn how to use GitLab Pages, read the [user documentation][pages-userguide]. - To learn how to use GitLab Pages, read the [user documentation][pages-userguide].
---
This document describes how to set up the _latest_ GitLab Pages feature. Make This document describes how to set up the _latest_ GitLab Pages feature. Make
sure to read the [changelog](#changelog) if you are upgrading to a new GitLab sure to read the [changelog](#changelog) if you are upgrading to a new GitLab
version as it may include new features and changes needed to be made in your version as it may include new features and changes needed to be made in your
...@@ -24,8 +26,6 @@ SNI and exposes pages using HTTP2 by default. ...@@ -24,8 +26,6 @@ SNI and exposes pages using HTTP2 by default.
You are encouraged to read its [README][pages-readme] to fully understand how You are encouraged to read its [README][pages-readme] to fully understand how
it works. it works.
---
In the case of [custom domains](#custom-domains) (but not In the case of [custom domains](#custom-domains) (but not
[wildcard domains](#wildcard-domains)), the Pages daemon needs to listen on [wildcard domains](#wildcard-domains)), the Pages daemon needs to listen on
ports `80` and/or `443`. For that reason, there is some flexibility in the way ports `80` and/or `443`. For that reason, there is some flexibility in the way
......
# Project import/export # Project import/export administration **[CORE ONLY]**
>**Note:** >**Note:**
> >
......
This document was moved to [another location](../../install/openshift_and_gitlab/index.html). ---
redirect_to: '../../install/openshift_and_gitlab/index.html'
---
--- ---
comments: false comments: false
description: "Learn how to use GitLab CI/CD, the GitLab built-in Continuous Integration, Continuous Deployment, and Continuous Delivery toolset to build, test, and deploy your application."
--- ---
# GitLab Continuous Integration (GitLab CI/CD) # GitLab Continuous Integration (GitLab CI/CD)
......
...@@ -23,7 +23,7 @@ sast:container: ...@@ -23,7 +23,7 @@ sast:container:
- docker:stable-dind - docker:stable-dind
script: script:
- docker run -d --name db arminc/clair-db:latest - docker run -d --name db arminc/clair-db:latest
- docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan:v2.0.1 - docker run -p 6060:6060 --link db:postgres -d --name clair --restart on-failure arminc/clair-local-scan:v2.0.1
- apk add -U wget ca-certificates - apk add -U wget ca-certificates
- docker pull ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} - docker pull ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG}
- wget https://github.com/arminc/clair-scanner/releases/download/v8/clair-scanner_linux_amd64 - wget https://github.com/arminc/clair-scanner/releases/download/v8/clair-scanner_linux_amd64
......
...@@ -11,7 +11,7 @@ Ideally, the GitLab Runner should not be installed on the same machine as GitLab ...@@ -11,7 +11,7 @@ Ideally, the GitLab Runner should not be installed on the same machine as GitLab
Read the [requirements documentation](../../install/requirements.md#gitlab-runner) Read the [requirements documentation](../../install/requirements.md#gitlab-runner)
for more information. for more information.
## Shared vs specific Runners ## Shared, specific and group Runners
After [installing the Runner][install], you can either register it as shared or After [installing the Runner][install], you can either register it as shared or
specific. You can only register a shared Runner if you have admin access to specific. You can only register a shared Runner if you have admin access to
...@@ -32,6 +32,9 @@ are: ...@@ -32,6 +32,9 @@ are:
Runners. For example, if you want to deploy a certain project, you can setup Runners. For example, if you want to deploy a certain project, you can setup
a specific Runner to have the right credentials for this. The [usage of tags](#using-tags) a specific Runner to have the right credentials for this. The [usage of tags](#using-tags)
may be useful in this case. Specific Runners process jobs using a [FIFO] queue. may be useful in this case. Specific Runners process jobs using a [FIFO] queue.
- **Group Runners** are useful when you have multiple projects under one group
and would like all projects to have access to a set of Runners. Group Runners
process jobs using a [FIFO] queue.
A Runner that is specific only runs for the specified project(s). A shared Runner A Runner that is specific only runs for the specified project(s). A shared Runner
can run jobs for every project that has enabled the option **Allow shared Runners** can run jobs for every project that has enabled the option **Allow shared Runners**
...@@ -66,7 +69,7 @@ Runners to disabled. ...@@ -66,7 +69,7 @@ Runners to disabled.
## Registering a specific Runner ## Registering a specific Runner
Registering a specific can be done in two ways: Registering a specific Runner can be done in two ways:
1. Creating a Runner with the project registration token 1. Creating a Runner with the project registration token
1. Converting a shared Runner into a specific Runner (one-way, admin only) 1. Converting a shared Runner into a specific Runner (one-way, admin only)
...@@ -79,6 +82,14 @@ visit the project you want to make the Runner work for in GitLab: ...@@ -79,6 +82,14 @@ visit the project you want to make the Runner work for in GitLab:
1. Go to **Settings > CI/CD** to obtain the token 1. Go to **Settings > CI/CD** to obtain the token
1. [Register the Runner][register] 1. [Register the Runner][register]
## Registering a group Runner
Creating a group Runner requires Master permissions for the group. To create a
group Runner visit the group you want to make the Runner work for in GitLab:
1. Go to **Settings > CI/CD** to obtain the token
1. [Register the Runner][register]
### Making an existing shared Runner specific ### Making an existing shared Runner specific
If you are an admin on your GitLab instance, you can turn any shared Runner into If you are an admin on your GitLab instance, you can turn any shared Runner into
...@@ -121,7 +132,7 @@ To enable/disable a Runner in your project: ...@@ -121,7 +132,7 @@ To enable/disable a Runner in your project:
> **Note**: > **Note**:
Consider that if you don't lock your specific Runner to a specific project, any Consider that if you don't lock your specific Runner to a specific project, any
user with Master role in you project can assign your runner to another arbitrary user with Master role in you project can assign your Runner to another arbitrary
project without requiring your authorization, so use it with caution. project without requiring your authorization, so use it with caution.
An admin can enable/disable a specific Runner for projects: An admin can enable/disable a specific Runner for projects:
......
--- ---
comments: false redirect_to: 'README.md'
--- ---
# GitLab CI Services
- [Using MySQL](mysql.md)
- [Using PostgreSQL](postgres.md)
- [Using Redis](redis.md)
...@@ -738,10 +738,15 @@ cache: ...@@ -738,10 +738,15 @@ cache:
rspec: rspec:
script: test script: test
cache: cache:
key: rspec
paths: paths:
- binaries/ - binaries/
``` ```
Note that since cache is shared between jobs, if you're using different
paths for different jobs, you should also set a different **cache:key**
otherwise cache content can be overwritten.
### `cache:key` ### `cache:key`
> Introduced in GitLab Runner v1.0.0. > Introduced in GitLab Runner v1.0.0.
...@@ -756,10 +761,9 @@ or any other way that fits your workflow. This way, you can fine tune caching, ...@@ -756,10 +761,9 @@ or any other way that fits your workflow. This way, you can fine tune caching,
allowing you to cache data between different jobs or even different branches. allowing you to cache data between different jobs or even different branches.
The `cache:key` variable can use any of the The `cache:key` variable can use any of the
[predefined variables](../variables/README.md), and the default key, if not set, [predefined variables](../variables/README.md), and the default key, if not
is `$CI_JOB_NAME-$CI_COMMIT_REF_NAME` which translates as "per-job and set, is just literal `default` which means everything is shared between each
per-branch". It is the default across the project, therefore everything is pipelines and jobs by default, starting from GitLab 9.0.
shared between pipelines and jobs running on the same branch by default.
NOTE: **Note:** NOTE: **Note:**
The `cache:key` variable cannot contain the `/` character, or the equivalent The `cache:key` variable cannot contain the `/` character, or the equivalent
...@@ -779,7 +783,7 @@ If you use **Windows Batch** to run your shell scripts you need to replace ...@@ -779,7 +783,7 @@ If you use **Windows Batch** to run your shell scripts you need to replace
```yaml ```yaml
cache: cache:
key: "%CI_JOB_STAGE%-%CI_COMMIT_REF_SLUG%" key: "%CI_COMMIT_REF_SLUG%"
paths: paths:
- binaries/ - binaries/
``` ```
...@@ -789,7 +793,7 @@ If you use **Windows PowerShell** to run your shell scripts you need to replace ...@@ -789,7 +793,7 @@ If you use **Windows PowerShell** to run your shell scripts you need to replace
```yaml ```yaml
cache: cache:
key: "$env:CI_JOB_STAGE-$env:CI_COMMIT_REF_SLUG" key: "$env:CI_COMMIT_REF_SLUG"
paths: paths:
- binaries/ - binaries/
``` ```
......
This document was moved in [user/project/container_registry](../user/project/container_registry.md). This document was moved to [another location](../user/project/container_registry.md).
--- ---
comments: false redirect_to: '../user/project/issues/automatic_issue_closing.md'
--- ---
This document was split into:
- [administration/issue_closing_pattern.md](../administration/issue_closing_pattern.md).
- [user/project/issues/automatic_issue_closing](../user/project/issues/automatic_issue_closing.md).
--- ---
comments: false comments: false
description: 'Learn how to contribute to GitLab.'
--- ---
# GitLab development guides # GitLab development guides
......
---
description: 'Writing styles, markup, formatting, and reusing regular expressions throughout the GitLab Documentation.'
---
# Documentation style guidelines # Documentation style guidelines
The documentation style guide defines the markup structure used in The documentation style guide defines the markup structure used in
...@@ -21,23 +25,39 @@ Check the GitLab handbook for the [writing styles guidelines](https://about.gitl ...@@ -21,23 +25,39 @@ Check the GitLab handbook for the [writing styles guidelines](https://about.gitl
- Use [single spaces][] instead of double spaces - Use [single spaces][] instead of double spaces
- Jump a line between different markups (e.g., after every paragraph, header, list, etc) - Jump a line between different markups (e.g., after every paragraph, header, list, etc)
- Capitalize "G" and "L" in GitLab - Capitalize "G" and "L" in GitLab
- Capitalize feature, products, and methods names. E.g.: GitLab Runner, Geo, - Use sentence case for titles, headings, labels, menu items, and buttons.
Issue Boards, Git, Prometheus, Continuous Integration. - Use title case when referring to [features](https://about.gitlab.com/features/) or [products](https://about.gitlab.com/pricing/), and methods. Note that some features are also objects (e.g. "Merge Requests" and "merge requests"). E.g.: GitLab Runner, Geo, Issue Boards, Git, Prometheus, Continuous Integration.
## Formatting ## Formatting
- Use double asterisks (`**`) to mark a word or text in bold (`**bold**`)
- Use undescore (`_`) for text in italics (`_italic_`)
- Jump a line between different markups, for example:
```md
## Header
Paragraph.
- List item
- List item
```
### Punctuation
For punctuation rules, please refer to the [GitLab UX guide](https://design.gitlab.com/content/punctuation/).
### Ordered and unordered lists
- Use dashes (`-`) for unordered lists instead of asterisks (`*`) - Use dashes (`-`) for unordered lists instead of asterisks (`*`)
- Use the number one (`1`) for ordered lists - Use the number one (`1`) for ordered lists
- Use underscores (`_`) to mark a word or text in italics - For punctuation in bullet lists, please refer to the [GitLab UX guide](https://design.gitlab.com/content/punctuation/)
- Use double asterisks (`**`) to mark a word or text in bold
- When using lists, prefer not to end each item with a period. You can use
them if there are multiple sentences, just keep the last sentence without
a period
## Headings ## Headings
- Add only one H1 title in each document, by adding `#` at the beginning of - Add **only one H1** in each document, by adding `#` at the beginning of
it (when using markdown). For subheadings, use `##`, `###` and so on it (when using markdown). The `h1` will be the document `<title>`.
- For subheadings, use `##`, `###` and so on
- Avoid putting numbers in headings. Numbers shift, hence documentation anchor - Avoid putting numbers in headings. Numbers shift, hence documentation anchor
links shift too, which eventually leads to dead links. If you think it is links shift too, which eventually leads to dead links. If you think it is
compelling to add numbers in headings, make sure to at least discuss it with compelling to add numbers in headings, make sure to at least discuss it with
...@@ -106,21 +126,75 @@ Inside the document: ...@@ -106,21 +126,75 @@ Inside the document:
- If a heading is placed right after an image, always add three dashes (`---`) - If a heading is placed right after an image, always add three dashes (`---`)
between the image and the heading between the image and the heading
## Notes ## Alert boxes
- Notes should be quoted with the word `Note:` being bold. Use this form: Whenever you want to call the attention to a particular sentence,
use the following markup for highlighting.
```md _Note that the alert boxes only work for one paragraph only. Multiple paragraphs,
>**Note:** lists, headers, etc will not render correctly._
This is something to note.
``` ### Note
```md
NOTE: **Note:**
This is something to note.
```
How it renders in docs.gitlab.com:
NOTE: **Note:**
This is something to note.
### Tip
```md
TIP: **Tip:**
This is a tip.
```
How it renders in docs.gitlab.com:
TIP: **Tip:**
This is a tip.
### Caution
```md
CAUTION: **Caution:**
This is something to be cautious about.
```
How it renders in docs.gitlab.com:
CAUTION: **Caution:**
This is something to be cautious about.
### Danger
which renders to: ```md
DANGER: **Danger:**
This is a breaking change, a bug, or something very important to note.
```
How it renders in docs.gitlab.com:
>**Note:** DANGER: **Danger:**
This is something to note. This is a breaking change, a bug, or something very important to note.
If the note spans across multiple lines it's OK to split the line. ## Blockquotes
For highlighting a text within a blue blockquote, use this format:
```md
> This is a blockquote.
```
which renders in docs.gitlab.com to:
> This is a blockquote.
If the text spans across multiple lines it's OK to split the line.
## Specific sections and terms ## Specific sections and terms
...@@ -137,7 +211,7 @@ below. ...@@ -137,7 +211,7 @@ below.
> Introduced in GitLab 8.3. > Introduced in GitLab 8.3.
``` ```
- If possible every feature should have a link to the MR, issue, or epic that introduced it. - Whenever possible, every feature should have a link to the MR, issue, or epic that introduced it.
The above note would be then transformed to: The above note would be then transformed to:
```md ```md
...@@ -152,11 +226,9 @@ below. ...@@ -152,11 +226,9 @@ below.
the feature is available in: the feature is available in:
```md ```md
> [Introduced][ee-1234] in [GitLab Starter](https://about.gitlab.com/products/) 8.3. > [Introduced][ee-1234] in [GitLab Starter](https://about.gitlab.com/pricing/) 8.3.
``` ```
Otherwise, leave this mention out.
### Product badges ### Product badges
When a feature is available in EE-only tiers, add the corresponding tier according to the When a feature is available in EE-only tiers, add the corresponding tier according to the
......
---
description: Learn how to contribute to GitLab Documentation.
---
# GitLab Documentation guidelines # GitLab Documentation guidelines
- **General Documentation**: written by the [developers responsible by creating features](#contributing-to-docs). Should be submitted in the same merge request containing code. Feature proposals (by GitLab contributors) should also be accompanied by its respective documentation. They can be later improved by PMs and Technical Writers. - **General Documentation**: written by the [developers responsible by creating features](#contributing-to-docs). Should be submitted in the same merge request containing code. Feature proposals (by GitLab contributors) should also be accompanied by its respective documentation. They can be later improved by PMs and Technical Writers.
...@@ -201,6 +205,19 @@ Things to note: ...@@ -201,6 +205,19 @@ Things to note:
built-in help page, that's why we omit it in `git grep`. built-in help page, that's why we omit it in `git grep`.
- Use the checklist on the documentation MR description template. - Use the checklist on the documentation MR description template.
#### Alternative redirection method
Alternatively to the method described above, you can simply replace the content
of the old file with a frontmatter containing a redirect link:
```yaml
---
redirect_to: '../path/to/file/README.md'
---
```
It supports both full and relative URLs, e.g. `https://docs.gitlab.com/ee/path/to/file.html`, `../path/to/file.html`, `path/to/file.md`. Note that any `*.md` paths will be compiled to `*.html`.
### Redirections for pages with Disqus comments ### Redirections for pages with Disqus comments
If the documentation page being relocated already has any Disqus comments, If the documentation page being relocated already has any Disqus comments,
......
--- ---
comments: false comments: false
description: Read through the GitLab installation methods.
--- ---
# Installation # Installation
......
---
description: 'Learn how to spin up a
pre-configured GitLab VM on Microsoft Azure and have your very own private GitLab instance up and running in around 30 minutes.'
---
# Install GitLab on Microsoft Azure # Install GitLab on Microsoft Azure
> _This article was originally written by Dave Wentzel and [published on the GitLab Blog][Original-Blog-Post]._ > _This article was originally written by Dave Wentzel and [published on the GitLab Blog][Original-Blog-Post]._
......
# GitLab Docker images # Install GitLab with Docker
[Docker](https://www.docker.com) and container technology have been revolutionizing the software world for the past few years. They combine the performance and efficiency of native execution with the abstraction, security, and immutability of virtualization. [Docker](https://www.docker.com) and container technology have been revolutionizing the software world for the past few years. They combine the performance and efficiency of native execution with the abstraction, security, and immutability of virtualization.
......
---
description: 'Learn how to install a GitLab instance on Google Cloud Platform.'
---
# Installing GitLab on Google Cloud Platform # Installing GitLab on Google Cloud Platform
![GCP landing page](img/gcp_landing.png) ![GCP landing page](img/gcp_landing.png)
......
---
description: 'Read through the different methods to deploy GitLab on Kubernetes.'
---
# Installing GitLab on Kubernetes # Installing GitLab on Kubernetes
> **Note**: These charts have been tested on Google Kubernetes Engine and Azure Container Service. Other Kubernetes installations may work as well, if not please [open an issue](https://gitlab.com/charts/charts.gitlab.io/issues). > **Note**: These charts have been tested on Google Kubernetes Engine and Azure Container Service. Other Kubernetes installations may work as well, if not please [open an issue](https://gitlab.com/charts/charts.gitlab.io/issues).
The easiest method to deploy GitLab on [Kubernetes](https://kubernetes.io/) is The easiest method to deploy GitLab on [Kubernetes](https://kubernetes.io/) is
...@@ -16,6 +21,7 @@ should be deployed, upgraded, and configured. ...@@ -16,6 +21,7 @@ should be deployed, upgraded, and configured.
* [Community Contributed Charts](#community-contributed-charts): Community contributed charts, deprecated by the official GitLab chart. * [Community Contributed Charts](#community-contributed-charts): Community contributed charts, deprecated by the official GitLab chart.
## GitLab-Omnibus Chart (Recommended) ## GitLab-Omnibus Chart (Recommended)
> **Note**: This chart is in beta while [additional features](https://gitlab.com/charts/charts.gitlab.io/issues/68) are being added. > **Note**: This chart is in beta while [additional features](https://gitlab.com/charts/charts.gitlab.io/issues/68) are being added.
This chart is the best available way to operate GitLab on Kubernetes. It deploys and configures nearly all features of GitLab, including: a [Runner](https://docs.gitlab.com/runner/), [Container Registry](../../user/project/container_registry.html#gitlab-container-registry), [Mattermost](https://docs.gitlab.com/omnibus/gitlab-mattermost/), [automatic SSL](https://github.com/kubernetes/charts/tree/master/stable/kube-lego), and a [load balancer](https://github.com/kubernetes/ingress/tree/master/controllers/nginx). It is based on our [GitLab Omnibus Docker Images](https://docs.gitlab.com/omnibus/docker/README.html). This chart is the best available way to operate GitLab on Kubernetes. It deploys and configures nearly all features of GitLab, including: a [Runner](https://docs.gitlab.com/runner/), [Container Registry](../../user/project/container_registry.html#gitlab-container-registry), [Mattermost](https://docs.gitlab.com/omnibus/gitlab-mattermost/), [automatic SSL](https://github.com/kubernetes/charts/tree/master/stable/kube-lego), and a [load balancer](https://github.com/kubernetes/ingress/tree/master/controllers/nginx). It is based on our [GitLab Omnibus Docker Images](https://docs.gitlab.com/omnibus/docker/README.html).
......
...@@ -6,7 +6,7 @@ article_type: tutorial ...@@ -6,7 +6,7 @@ article_type: tutorial
date: 2016-06-28 date: 2016-06-28
--- ---
# Getting started with OpenShift Origin 3 and GitLab # How to install GitLab on OpenShift Origin 3
## Introduction ## Introduction
......
...@@ -4,5 +4,4 @@ comments: false ...@@ -4,5 +4,4 @@ comments: false
# Legal # Legal
- [Corporate contributor license agreement](corporate_contributor_license_agreement.md) Please read through the [GitLab License Agreement](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md).
- [Individual contributor license agreement](individual_contributor_license_agreement.md)
This document has been replaced by a Developer Certificate of Origin and License, ---
as described in [Contributing.md](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md). redirect_to: 'README.md'
\ No newline at end of file ---
This document has been replaced by a Developer Certificate of Origin and License, ---
as described in [Contributing.md](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md). redirect_to: 'README.md'
\ No newline at end of file ---
# Features # Namespaces
## Enable usernames and namespaces for user projects ## Enable usernames and namespaces for user projects
......
# Webhooks # Webhooks administration **[CORE ONLY]**
## Add a webhook for **ALL** projects: ## Add a webhook for **ALL** projects:
......
...@@ -4,6 +4,7 @@ author_gitlab: SeanPackham ...@@ -4,6 +4,7 @@ author_gitlab: SeanPackham
level: beginner level: beginner
article_type: user guide article_type: user guide
date: 2017-05-15 date: 2017-05-15
description: 'This article describes how to install Git on macOS, Ubuntu Linux and Windows.'
--- ---
# Installing Git # Installing Git
......
...@@ -2,39 +2,31 @@ ...@@ -2,39 +2,31 @@
comments: false comments: false
--- ---
# GitLab Flow # What is the GitLab Flow
- A simplified branching strategy - A simplified branching strategy
- All features and fixes first go to master - All features and fixes first go to master
- Allows for 'production' or 'stable' branches - Allows for 'production' or 'stable' branches
- Bug fixes/hot fix patches are cherry-picked from master - Bug fixes/hot fix patches are cherry-picked from master
--- ## Feature branches
# Feature branches
- Create a feature/bugfix branch to do all work - Create a feature/bugfix branch to do all work
- Use merge requests to merge to master - Use merge requests to merge to master
![inline](gitlab_flow/feature_branches.png) ![inline](gitlab_flow/feature_branches.png)
--- ## Production branch
# Production branch
- One, long-running production release branch - One, long-running production release branch
as opposed to individual stable branches as opposed to individual stable branches
- Consider creating a tag for each version that gets deployed - Consider creating a tag for each version that gets deployed
--- ## Production branch
# Production branch
![inline](gitlab_flow/production_branch.png) ![inline](gitlab_flow/production_branch.png)
--- ## Release branch
# Release branch
- Useful if you release software to customers - Useful if you release software to customers
- When preparing a new release, create stable branch - When preparing a new release, create stable branch
...@@ -43,15 +35,11 @@ comments: false ...@@ -43,15 +35,11 @@ comments: false
- Cherry-pick critical bug fixes to stable branch for patch release - Cherry-pick critical bug fixes to stable branch for patch release
- Never commit bug fixes directly to stable branch - Never commit bug fixes directly to stable branch
--- ## Release branch
# Release branch
![inline](gitlab_flow/release_branches.png) ![inline](gitlab_flow/release_branches.png)
--- ## More details
# More details
Blog post on 'GitLab Flow' at For more information read through the [GitLab Flow](../../workflow/gitlab_flow.md)
[http://doc.gitlab.com/ee/workflow/gitlab_flow.html](http://doc.gitlab.com/ee/workflow/gitlab_flow.html) documentation.
--- ---
comments: false redirect_to: '../gitlab_flow.md'
--- ---
# GitLab Flow
----------
- A simplified branching strategy
- All features and fixes first go to master
- Allows for 'production' or 'stable' branches
- Bug fixes/hot fix patches are cherry-picked from master
----------
### Feature branches
- Create a feature/bugfix branch to do all work
- Use merge requests to merge to master
![inline](http://gitlab.com/gitlab-org/University/raw/5baea0fe222a915d0500e40747d35eb18681cdc3/training/gitlab_flow/feature_branches.png)
----------
## Production branch
- One, long-running production release branch
as opposed to individual stable branches
- Consider creating a tag for each version that gets deployed
----------
## Production branch
![inline](http://gitlab.com/gitlab-org/University/raw/5baea0fe222a915d0500e40747d35eb18681cdc3/training/gitlab_flow/production_branch.png)
----------
## Release branch
- Useful if you release software to customers
- When preparing a new release, create stable branch
from master
- Consider creating a tag for each version
- Cherry-pick critical bug fixes to stable branch for patch release
- Never commit bug fixes directly to stable branch
----------
![inline](http://gitlab.com/gitlab-org/University/raw/5baea0fe222a915d0500e40747d35eb18681cdc3/training/gitlab_flow/release_branches.png)
----------
## More details
Blog post on 'GitLab Flow' at
[http://doc.gitlab.com/ee/workflow/gitlab_flow.html](http://doc.gitlab.com/ee/workflow/gitlab_flow.html)
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
comments: false comments: false
--- ---
# Merge requests # Code review and collaboration with Merge Requests
---------- ----------
......
# Labels # Labels administration **[CORE ONLY]**
## Default Labels ## Default Labels
......
...@@ -40,20 +40,20 @@ In GitLab, a namespace is a unique name to be used as a user name, a group name, ...@@ -40,20 +40,20 @@ In GitLab, a namespace is a unique name to be used as a user name, a group name,
- `http://gitlab.example.com/groupname` - `http://gitlab.example.com/groupname`
- `http://gitlab.example.com/groupname/subgroup_name` - `http://gitlab.example.com/groupname/subgroup_name`
For example, consider a user called John: For example, consider a user named Alex:
1. John creates his account on GitLab.com with the username `john`; 1. Alex creates an account on GitLab.com with the username `alex`;
his profile will be accessed under `https://gitlab.example.com/john` their profile will be accessed under `https://gitlab.example.com/alex`
1. John creates a group for his team with the groupname `john-team`; 1. Alex creates a group for their team with the groupname `alex-team`;
his group and its projects will be accessed under `https://gitlab.example.com/john-team` the group and its projects will be accessed under `https://gitlab.example.com/alex-team`
1. John creates a subgroup of `john-team` with the subgroup name `marketing`; 1. Alex creates a subgroup of `alex-team` with the subgroup name `marketing`;
his subgroup and its projects will be accessed under `https://gitlab.example.com/john-team/marketing` this subgroup and its projects will be accessed under `https://gitlab.example.com/alex-team/marketing`
By doing so: By doing so:
- Any team member mentions John with `@john` - Any team member mentions Alex with `@alex`
- John mentions everyone from his team with `@john-team` - Alex mentions everyone from their team with `@alex-team`
- John mentions only his marketing team with `@john-team/marketing` - Alex mentions only the marketing team with `@alex-team/marketing`
## Issues and merge requests within a group ## Issues and merge requests within a group
......
---
description: 'Read through the GitLab User documentation to learn how to use, configure, and customize GitLab and GitLab.com to your own needs.'
---
# User documentation # User documentation
Welcome to GitLab! We're glad to have you here! Welcome to GitLab! We're glad to have you here!
......
---
description: 'Understand and explore the user permission levels in GitLab, and what features each of them grants you access to.'
---
# Permissions # Permissions
Users have different abilities depending on the access level they have in a Users have different abilities depending on the access level they have in a
......
---
description: 'Learn how to use GitLab Pages to deploy a static website at no additional cost.'
---
# GitLab Pages # GitLab Pages
With GitLab Pages it's easy to publish your project website. GitLab Pages is a hosting service for static websites, at no additional cost. With GitLab Pages it's easy to publish your project website. GitLab Pages is a hosting service for static websites, at no additional cost.
......
# GitLab Pages # Exploring GitLab Pages
> **Notes:** > **Notes:**
> - This feature was [introduced][ee-80] in GitLab EE 8.3. > - This feature was [introduced][ee-80] in GitLab EE 8.3.
...@@ -14,9 +14,7 @@ deploy static pages for your individual projects, your user or your group. ...@@ -14,9 +14,7 @@ deploy static pages for your individual projects, your user or your group.
Read [GitLab Pages on GitLab.com](#gitlab-pages-on-gitlab-com) for specific Read [GitLab Pages on GitLab.com](#gitlab-pages-on-gitlab-com) for specific
information, if you are using GitLab.com to host your website. information, if you are using GitLab.com to host your website.
Read through [All you Need to Know About GitLab Pages][pages-index-guide] for a list of all learning materials we have prepared for GitLab Pages (webpages, articles, guides, blog posts, video tutorials). ## Getting started with GitLab Pages domains
## Getting started with GitLab Pages
> **Note:** > **Note:**
> In the rest of this document we will assume that the general domain name that > In the rest of this document we will assume that the general domain name that
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
> - [Introduced][ce-3050] in GitLab 8.9. > - [Introduced][ce-3050] in GitLab 8.9.
> - Importing will not be possible if the import instance version differs from > - Importing will not be possible if the import instance version differs from
> that of the exporter. > that of the exporter.
> - For GitLab admins, please read through [Project import/export administration](../../../administration/raketasks/project_import_export.md).
> - For existing installations, the project import option has to be enabled in > - For existing installations, the project import option has to be enabled in
> application settings (`/admin/application_settings`) under 'Import sources'. > application settings (`/admin/application_settings`) under 'Import sources'.
> Ask your administrator if you don't see the **GitLab export** button when > Ask your administrator if you don't see the **GitLab export** button when
......
This document is moved to [user/project/protected_branches.md](../user/project/protected_branches.md) This document was moved to [another location](../user/project/protected_branches.md).
Feature: Project Deploy Keys
Background:
Given I sign in as a user
And I own project "Shop"
@javascript
Scenario: I should see deploy keys list
Given project has deploy key
When I visit project deploy keys page
Then I should see project deploy key
@javascript
Scenario: I should see project deploy keys
Given other projects have deploy keys
When I visit project deploy keys page
Then I should see other project deploy key
And I should only see the same deploy key once
@javascript
Scenario: I should see public deploy keys
Given public deploy key exists
When I visit project deploy keys page
Then I should see public deploy key
@javascript
Scenario: I add new deploy key
Given I visit project deploy keys page
And I submit new deploy key
Then I should be on deploy keys page
And I should see newly created deploy key
@javascript
Scenario: I attach other project deploy key to project
Given other projects have deploy keys
And I visit project deploy keys page
When I click attach deploy key
Then I should be on deploy keys page
And I should see newly created deploy key
@javascript
Scenario: I attach public deploy key to project
Given public deploy key exists
And I visit project deploy keys page
When I click attach deploy key
Then I should be on deploy keys page
And I should see newly created deploy key
@project_issues
Feature: Project Issues References
Background:
Given I sign in as "John Doe"
And public project "Community"
And "John Doe" owns public project "Community"
And project "Community" has "Community issue" open issue
And I logout
And I sign in as "Mary Jane"
And private project "Enterprise"
And "Mary Jane" owns private project "Enterprise"
And project "Enterprise" has "Enterprise issue" open issue
And project "Enterprise" has "Enterprise fix" open merge request
And I visit issue page "Enterprise issue"
And I leave a comment referencing issue "Community issue"
And I visit merge request page "Enterprise fix"
And I leave a comment referencing issue "Community issue"
And I logout
@javascript
Scenario: Viewing the public issue as a "John Doe"
Given I sign in as "John Doe"
When I visit issue page "Community issue"
Then I should not see any related merge requests
And I should see no notes at all
@javascript
Scenario: Viewing the public issue as "Mary Jane"
Given I sign in as "Mary Jane"
When I visit issue page "Community issue"
Then I should see the "Enterprise fix" related merge request
And I should see a note linking to "Enterprise fix" merge request
And I should see a note linking to "Enterprise issue" issue
class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
step 'project has deploy key' do
create(:deploy_keys_project, project: @project)
end
step 'I should see project deploy key' do
page.within(find('.deploy-keys')) do
find('.js-deployKeys-tab-enabled_keys').click()
expect(page).to have_content deploy_key.title
end
end
step 'I should see other project deploy key' do
page.within(find('.deploy-keys')) do
find('.js-deployKeys-tab-available_project_keys').click()
expect(page).to have_content other_deploy_key.title
end
end
step 'I should see public deploy key' do
page.within(find('.deploy-keys')) do
find('.js-deployKeys-tab-public_keys').click()
expect(page).to have_content public_deploy_key.title
end
end
step 'I click \'New Deploy Key\'' do
click_link 'New deploy key'
end
step 'I submit new deploy key' do
fill_in "deploy_key_title", with: "laptop"
fill_in "deploy_key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop"
click_button "Add key"
end
step 'I should be on deploy keys page' do
expect(current_path).to eq project_settings_repository_path(@project)
end
step 'I should see newly created deploy key' do
@project.reload
page.within(find('.deploy-keys')) do
find('.js-deployKeys-tab-enabled_keys').click()
expect(page).to have_content(deploy_key.title)
end
end
step 'other projects have deploy keys' do
@second_project = create(:project, namespace: create(:group))
@second_project.add_master(current_user)
create(:deploy_keys_project, project: @second_project)
@third_project = create(:project, namespace: create(:group))
@third_project.add_master(current_user)
create(:deploy_keys_project, project: @third_project, deploy_key: @second_project.deploy_keys.first)
end
step 'I should only see the same deploy key once' do
page.within(find('.deploy-keys')) do
expect(find('.js-deployKeys-tab-available_project_keys .badge')).to have_content('1')
end
end
step 'public deploy key exists' do
create(:deploy_key, public: true)
end
step 'I click attach deploy key' do
page.within(find('.deploy-keys')) do
find('.badge', text: '1').click()
click_button 'Enable'
expect(page).not_to have_selector('.fa-spinner')
end
end
protected
def deploy_key
@project.deploy_keys.last
end
def other_deploy_key
@second_project.deploy_keys.last
end
def public_deploy_key
DeployKey.are_public.last
end
end
...@@ -5,13 +5,6 @@ module SharedIssuable ...@@ -5,13 +5,6 @@ module SharedIssuable
find('.js-issuable-edit', visible: true).click find('.js-issuable-edit', visible: true).click
end end
step 'project "Community" has "Community issue" open issue' do
create_issuable_for_project(
project_name: 'Community',
title: 'Community issue'
)
end
step 'project "Community" has "Community fix" open merge request' do step 'project "Community" has "Community fix" open merge request' do
create_issuable_for_project( create_issuable_for_project(
project_name: 'Community', project_name: 'Community',
...@@ -59,32 +52,11 @@ module SharedIssuable ...@@ -59,32 +52,11 @@ module SharedIssuable
visit project_merge_request_path(mr.target_project, mr) visit project_merge_request_path(mr.target_project, mr)
end end
step 'I visit issue page "Community issue"' do
issue = Issue.find_by(title: 'Community issue')
visit project_issue_path(issue.project, issue)
end
step 'I visit issue page "Community fix"' do step 'I visit issue page "Community fix"' do
mr = MergeRequest.find_by(title: 'Community fix') mr = MergeRequest.find_by(title: 'Community fix')
visit project_merge_request_path(mr.target_project, mr) visit project_merge_request_path(mr.target_project, mr)
end end
step 'I should not see any related merge requests' do
page.within '.issue-details' do
expect(page).not_to have_content('#merge-requests .merge-requests-title')
end
end
step 'I should see the "Enterprise fix" related merge request' do
page.within '#merge-requests .merge-requests-title' do
expect(page).to have_content('1 Related Merge Request')
end
page.within '#merge-requests ul' do
expect(page).to have_content('Enterprise fix')
end
end
step 'I should see a note linking to "Enterprise fix" merge request' do step 'I should see a note linking to "Enterprise fix" merge request' do
visible_note( visible_note(
issuable: MergeRequest.find_by(title: 'Enterprise fix'), issuable: MergeRequest.find_by(title: 'Enterprise fix'),
......
...@@ -240,10 +240,6 @@ module SharedPaths ...@@ -240,10 +240,6 @@ module SharedPaths
visit project_settings_integrations_path(@project) visit project_settings_integrations_path(@project)
end end
step 'I visit project deploy keys page' do
visit project_deploy_keys_path(@project)
end
step 'I visit project find file page' do step 'I visit project find file page' do
visit project_find_file_path(@project, root_ref) visit project_find_file_path(@project, root_ref)
end end
......
...@@ -11,13 +11,14 @@ module API ...@@ -11,13 +11,14 @@ module API
requires :token, type: String, desc: 'Registration token' requires :token, type: String, desc: 'Registration token'
optional :description, type: String, desc: %q(Runner's description) optional :description, type: String, desc: %q(Runner's description)
optional :info, type: Hash, desc: %q(Runner's metadata) optional :info, type: Hash, desc: %q(Runner's metadata)
optional :active, type: Boolean, desc: 'Should Runner be active'
optional :locked, type: Boolean, desc: 'Should Runner be locked for current project' optional :locked, type: Boolean, desc: 'Should Runner be locked for current project'
optional :run_untagged, type: Boolean, desc: 'Should Runner handle untagged jobs' optional :run_untagged, type: Boolean, desc: 'Should Runner handle untagged jobs'
optional :tag_list, type: Array[String], desc: %q(List of Runner's tags) optional :tag_list, type: Array[String], desc: %q(List of Runner's tags)
optional :maximum_timeout, type: Integer, desc: 'Maximum timeout set when this Runner will handle the job' optional :maximum_timeout, type: Integer, desc: 'Maximum timeout set when this Runner will handle the job'
end end
post '/' do post '/' do
attributes = attributes_for_keys([:description, :locked, :run_untagged, :tag_list, :maximum_timeout]) attributes = attributes_for_keys([:description, :active, :locked, :run_untagged, :tag_list, :maximum_timeout])
.merge(get_runner_details_from_request) .merge(get_runner_details_from_request)
runner = runner =
......
...@@ -14,6 +14,7 @@ module Gitlab ...@@ -14,6 +14,7 @@ module Gitlab
avatar: /\Alogo\.(png|jpg|gif)\z/, avatar: /\Alogo\.(png|jpg|gif)\z/,
issue_template: %r{\A\.gitlab/issue_templates/[^/]+\.md\z}, issue_template: %r{\A\.gitlab/issue_templates/[^/]+\.md\z},
merge_request_template: %r{\A\.gitlab/merge_request_templates/[^/]+\.md\z}, merge_request_template: %r{\A\.gitlab/merge_request_templates/[^/]+\.md\z},
xcode_config: %r{\A[^/]*\.(xcodeproj|xcworkspace)\z},
# Configuration files # Configuration files
gitignore: '.gitignore', gitignore: '.gitignore',
......
...@@ -15,10 +15,7 @@ module Gitlab ...@@ -15,10 +15,7 @@ module Gitlab
def each def each
@blames.each do |blame| @blames.each do |blame|
yield( yield(blame.commit, blame.line)
Gitlab::Git::Commit.new(@repo, blame.commit),
blame.line
)
end end
end end
...@@ -60,9 +57,8 @@ module Gitlab ...@@ -60,9 +57,8 @@ module Gitlab
end end
end end
# load all commits in single call Gitlab::Git::Commit.batch_by_oid(@repo, commits.keys).each do |commit|
commits.keys.each do |key| commits[commit.sha] = commit
commits[key] = @repo.lookup(key)
end end
# get it together # get it together
......
...@@ -8,8 +8,8 @@ msgid "" ...@@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gitlab 1.0.0\n" "Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-02 22:28+0200\n" "POT-Creation-Date: 2018-05-09 09:24+0200\n"
"PO-Revision-Date: 2018-05-02 22:28+0200\n" "PO-Revision-Date: 2018-05-09 09:24+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n" "Language: \n"
...@@ -104,6 +104,12 @@ msgstr "" ...@@ -104,6 +104,12 @@ msgstr ""
msgid "+ %{moreCount} more" msgid "+ %{moreCount} more"
msgstr "" msgstr ""
msgid "- Runner is active and can process any new jobs"
msgstr ""
msgid "- Runner is paused and will not receive any new jobs"
msgstr ""
msgid "- show less" msgid "- show less"
msgstr "" msgstr ""
...@@ -156,6 +162,9 @@ msgstr "" ...@@ -156,6 +162,9 @@ msgstr ""
msgid "<strong>Removes</strong> source branch" msgid "<strong>Removes</strong> source branch"
msgstr "" msgstr ""
msgid "A 'Runner' is a process which runs a job. You can setup as many Runners as you need."
msgstr ""
msgid "A collection of graphs regarding Continuous Integration" msgid "A collection of graphs regarding Continuous Integration"
msgstr "" msgstr ""
...@@ -387,6 +396,9 @@ msgstr "" ...@@ -387,6 +396,9 @@ msgstr ""
msgid "Artifacts" msgid "Artifacts"
msgstr "" msgstr ""
msgid "Ask your group master to setup a group Runner."
msgstr ""
msgid "Assign custom color like #FF0000" msgid "Assign custom color like #FF0000"
msgstr "" msgstr ""
...@@ -474,6 +486,12 @@ msgstr "" ...@@ -474,6 +486,12 @@ msgstr ""
msgid "Available" msgid "Available"
msgstr "" msgstr ""
msgid "Available group Runners : %{runners}"
msgstr ""
msgid "Available group Runners : %{runners}."
msgstr ""
msgid "Avatar will be removed. Are you sure?" msgid "Avatar will be removed. Are you sure?"
msgstr "" msgstr ""
...@@ -716,6 +734,9 @@ msgstr "" ...@@ -716,6 +734,9 @@ msgstr ""
msgid "CI/CD configuration" msgid "CI/CD configuration"
msgstr "" msgstr ""
msgid "CI/CD settings"
msgstr ""
msgid "CICD|An explicit %{ci_file} needs to be specified before you can begin using Continuous Integration and Delivery." msgid "CICD|An explicit %{ci_file} needs to be specified before you can begin using Continuous Integration and Delivery."
msgstr "" msgstr ""
...@@ -749,6 +770,9 @@ msgstr "" ...@@ -749,6 +770,9 @@ msgstr ""
msgid "CICD|You need to specify a domain if you want to use Auto Review Apps and Auto Deploy stages." msgid "CICD|You need to specify a domain if you want to use Auto Review Apps and Auto Deploy stages."
msgstr "" msgstr ""
msgid "Can run untagged jobs"
msgstr ""
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
...@@ -1652,6 +1676,15 @@ msgstr "" ...@@ -1652,6 +1676,15 @@ msgstr ""
msgid "Directory name" msgid "Directory name"
msgstr "" msgstr ""
msgid "Disable"
msgstr ""
msgid "Disable for this project"
msgstr ""
msgid "Disable group Runners"
msgstr ""
msgid "Discard changes" msgid "Discard changes"
msgstr "" msgstr ""
...@@ -1703,6 +1736,9 @@ msgstr "" ...@@ -1703,6 +1736,9 @@ msgstr ""
msgid "Due date" msgid "Due date"
msgstr "" msgstr ""
msgid "Each Runner can be in one of the following states:"
msgstr ""
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
...@@ -1724,6 +1760,9 @@ msgstr "" ...@@ -1724,6 +1760,9 @@ msgstr ""
msgid "Embed" msgid "Embed"
msgstr "" msgstr ""
msgid "Enable"
msgstr ""
msgid "Enable Auto DevOps" msgid "Enable Auto DevOps"
msgstr "" msgstr ""
...@@ -1736,6 +1775,12 @@ msgstr "" ...@@ -1736,6 +1775,12 @@ msgstr ""
msgid "Enable and configure Prometheus metrics." msgid "Enable and configure Prometheus metrics."
msgstr "" msgstr ""
msgid "Enable for this project"
msgstr ""
msgid "Enable group Runners"
msgstr ""
msgid "Enable or disable version check and usage ping." msgid "Enable or disable version check and usage ping."
msgstr "" msgstr ""
...@@ -1978,6 +2023,9 @@ msgstr "" ...@@ -1978,6 +2023,9 @@ msgstr ""
msgid "GitLab CI Linter has been moved" msgid "GitLab CI Linter has been moved"
msgstr "" msgstr ""
msgid "GitLab Group Runners can execute code for all the projects in this group."
msgstr ""
msgid "GitLab Runner section" msgid "GitLab Runner section"
msgstr "" msgstr ""
...@@ -2002,9 +2050,18 @@ msgstr "" ...@@ -2002,9 +2050,18 @@ msgstr ""
msgid "Got it!" msgid "Got it!"
msgstr "" msgstr ""
msgid "Group CI/CD settings"
msgstr ""
msgid "Group ID" msgid "Group ID"
msgstr "" msgstr ""
msgid "Group Runners"
msgstr ""
msgid "Group masters can register group runners in the %{link}"
msgstr ""
msgid "GroupSettings|Prevent sharing a project within %{group} with other groups" msgid "GroupSettings|Prevent sharing a project within %{group} with other groups"
msgstr "" msgstr ""
...@@ -2315,9 +2372,18 @@ msgstr "" ...@@ -2315,9 +2372,18 @@ msgstr ""
msgid "Lock %{issuableDisplayName}" msgid "Lock %{issuableDisplayName}"
msgstr "" msgstr ""
msgid "Lock to current projects"
msgstr ""
msgid "Locked" msgid "Locked"
msgstr "" msgstr ""
msgid "Locked to current projects"
msgstr ""
msgid "Locked to this project"
msgstr ""
msgid "Login" msgid "Login"
msgstr "" msgstr ""
...@@ -2348,6 +2414,9 @@ msgstr "" ...@@ -2348,6 +2414,9 @@ msgstr ""
msgid "Maximum git storage failures" msgid "Maximum git storage failures"
msgstr "" msgstr ""
msgid "Maximum job timeout"
msgstr ""
msgid "May" msgid "May"
msgstr "" msgstr ""
...@@ -2491,6 +2560,9 @@ msgstr "" ...@@ -2491,6 +2560,9 @@ msgstr ""
msgid "New tag" msgid "New tag"
msgstr "" msgstr ""
msgid "No"
msgstr ""
msgid "No assignee" msgid "No assignee"
msgstr "" msgstr ""
...@@ -2680,6 +2752,9 @@ msgstr "" ...@@ -2680,6 +2752,9 @@ msgstr ""
msgid "Password" msgid "Password"
msgstr "" msgstr ""
msgid "Pause"
msgstr ""
msgid "Pending" msgid "Pending"
msgstr "" msgstr ""
...@@ -3145,6 +3220,9 @@ msgstr "" ...@@ -3145,6 +3220,9 @@ msgstr ""
msgid "Register / Sign In" msgid "Register / Sign In"
msgstr "" msgstr ""
msgid "Register and see your runners for this group."
msgstr ""
msgid "Related Commits" msgid "Related Commits"
msgstr "" msgstr ""
...@@ -3169,6 +3247,12 @@ msgstr "" ...@@ -3169,6 +3247,12 @@ msgstr ""
msgid "Remind later" msgid "Remind later"
msgstr "" msgstr ""
msgid "Remove"
msgstr ""
msgid "Remove Runner"
msgstr ""
msgid "Remove avatar" msgid "Remove avatar"
msgstr "" msgstr ""
...@@ -3202,6 +3286,9 @@ msgstr "" ...@@ -3202,6 +3286,9 @@ msgstr ""
msgid "Resolve discussion" msgid "Resolve discussion"
msgstr "" msgstr ""
msgid "Resume"
msgstr ""
msgid "Retry" msgid "Retry"
msgstr "" msgstr ""
...@@ -3234,6 +3321,15 @@ msgstr "" ...@@ -3234,6 +3321,15 @@ msgstr ""
msgid "Runners" msgid "Runners"
msgstr "" msgstr ""
msgid "Runners API"
msgstr ""
msgid "Runners can be placed on separate users, servers, and even on your local machine."
msgstr ""
msgid "Runners settings"
msgstr ""
msgid "Running" msgid "Running"
msgstr "" msgstr ""
...@@ -3360,6 +3456,9 @@ msgstr "" ...@@ -3360,6 +3456,9 @@ msgstr ""
msgid "Share" msgid "Share"
msgstr "" msgstr ""
msgid "Shared Runners"
msgstr ""
msgid "Show command" msgid "Show command"
msgstr "" msgstr ""
...@@ -3515,6 +3614,9 @@ msgstr "" ...@@ -3515,6 +3614,9 @@ msgstr ""
msgid "Spam and Anti-bot Protection" msgid "Spam and Anti-bot Protection"
msgstr "" msgstr ""
msgid "Specific Runners"
msgstr ""
msgid "Specify the following URL during the Runner setup:" msgid "Specify the following URL during the Runner setup:"
msgstr "" msgstr ""
...@@ -3772,9 +3874,18 @@ msgstr "" ...@@ -3772,9 +3874,18 @@ msgstr ""
msgid "There was an error when unsubscribing from this label." msgid "There was an error when unsubscribing from this label."
msgstr "" msgstr ""
msgid "They can be managed using the %{link}."
msgstr ""
msgid "This GitLab instance does not provide any shared Runners yet. Instance administrators can register shared Runners in the admin area."
msgstr ""
msgid "This directory" msgid "This directory"
msgstr "" msgstr ""
msgid "This group does not provide any group Runners yet."
msgstr ""
msgid "This is a confidential issue." msgid "This is a confidential issue."
msgstr "" msgstr ""
...@@ -3832,6 +3943,9 @@ msgstr "" ...@@ -3832,6 +3943,9 @@ msgstr ""
msgid "This project" msgid "This project"
msgstr "" msgstr ""
msgid "This project does not belong to a group and can therefore not make use of group Runners."
msgstr ""
msgid "This repository" msgid "This repository"
msgstr "" msgstr ""
...@@ -4016,6 +4130,9 @@ msgstr "" ...@@ -4016,6 +4130,9 @@ msgstr ""
msgid "To import an SVN repository, check out %{svn_link}." msgid "To import an SVN repository, check out %{svn_link}."
msgstr "" msgstr ""
msgid "To start serving your jobs you can add Runners to your group"
msgstr ""
msgid "To validate your GitLab CI configurations, go to 'CI/CD → Pipelines' inside your project, and click on the 'CI Lint' button." msgid "To validate your GitLab CI configurations, go to 'CI/CD → Pipelines' inside your project, and click on the 'CI Lint' button."
msgstr "" msgstr ""
...@@ -4187,6 +4304,9 @@ msgstr "" ...@@ -4187,6 +4304,9 @@ msgstr ""
msgid "Web terminal" msgid "Web terminal"
msgstr "" msgstr ""
msgid "When a runner is locked, it cannot be assigned to other projects"
msgstr ""
msgid "When enabled, users cannot use GitLab until the terms have been accepted." msgid "When enabled, users cannot use GitLab until the terms have been accepted."
msgstr "" msgstr ""
...@@ -4304,6 +4424,9 @@ msgstr "" ...@@ -4304,6 +4424,9 @@ msgstr ""
msgid "Write a commit message..." msgid "Write a commit message..."
msgstr "" msgstr ""
msgid "Yes"
msgstr ""
msgid "You are going to remove %{group_name}. Removed groups CANNOT be restored! Are you ABSOLUTELY sure?" msgid "You are going to remove %{group_name}. Removed groups CANNOT be restored! Are you ABSOLUTELY sure?"
msgstr "" msgstr ""
...@@ -4447,6 +4570,9 @@ msgstr "" ...@@ -4447,6 +4570,9 @@ msgstr ""
msgid "estimateCommand|%{slash_command} will update the estimated time with the latest command." msgid "estimateCommand|%{slash_command} will update the estimated time with the latest command."
msgstr "" msgstr ""
msgid "for this project"
msgstr ""
msgid "importing" msgid "importing"
msgstr "" msgstr ""
......
...@@ -6,6 +6,7 @@ FactoryBot.define do ...@@ -6,6 +6,7 @@ FactoryBot.define do
is_shared false is_shared false
active true active true
access_level :not_protected access_level :not_protected
runner_type :project_type
trait :online do trait :online do
contacted_at Time.now contacted_at Time.now
...@@ -13,6 +14,7 @@ FactoryBot.define do ...@@ -13,6 +14,7 @@ FactoryBot.define do
trait :shared do trait :shared do
is_shared true is_shared true
runner_type :instance_type
end end
trait :specific do trait :specific do
......
require "rails_helper"
describe "Internal references", :js do
include Spec::Support::Helpers::Features::NotesHelpers
let(:private_project_user) { private_project.owner }
let(:private_project) { create(:project, :private, :repository) }
let(:private_project_issue) { create(:issue, project: private_project) }
let(:private_project_merge_request) { create(:merge_request, source_project: private_project) }
let(:public_project_user) { public_project.owner }
let(:public_project) { create(:project, :public, :repository) }
let(:public_project_issue) { create(:issue, project: public_project) }
context "when referencing to open issue" do
context "from private project" do
context "from issue" do
before do
sign_in(private_project_user)
visit(project_issue_path(private_project, private_project_issue))
add_note("##{public_project_issue.to_reference(private_project)}")
end
context "when user doesn't have access to private project" do
before do
sign_in(public_project_user)
visit(project_issue_path(public_project, public_project_issue))
end
it { expect(page).not_to have_css(".note") }
end
end
context "from merge request" do
before do
sign_in(private_project_user)
visit(project_merge_request_path(private_project, private_project_merge_request))
add_note("##{public_project_issue.to_reference(private_project)}")
end
context "when user doesn't have access to private project" do
before do
sign_in(public_project_user)
visit(project_issue_path(public_project, public_project_issue))
end
it "doesn't show any references" do
page.within(".issue-details") do
expect(page).not_to have_content("#merge-requests .merge-requests-title")
end
end
end
context "when user has access to private project" do
before do
visit(project_issue_path(public_project, public_project_issue))
end
it "shows references" do
page.within("#merge-requests .merge-requests-title") do
expect(page).to have_content("1 Related Merge Request")
end
page.within("#merge-requests ul") do
expect(page).to have_content(private_project_merge_request.title)
end
expect(page).to have_content("mentioned in merge request #{private_project_merge_request.to_reference(public_project)}")
.and have_content(private_project_user.name)
end
end
end
end
end
end
require 'rails_helper' require "rails_helper"
describe 'Markdown References', :js do describe "Jira", :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:actual_project) { create(:project, :public, :repository) } let(:actual_project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, target_project: actual_project, source_project: actual_project)} let(:merge_request) { create(:merge_request, target_project: actual_project, source_project: actual_project) }
let(:issue_actual_project) { create(:issue, project: actual_project) } let(:issue_actual_project) { create(:issue, project: actual_project) }
let!(:other_project) { create(:project, :public) } let!(:other_project) { create(:project, :public) }
let!(:issue_other_project) { create(:issue, project: other_project) } let!(:issue_other_project) { create(:issue, project: other_project) }
let(:issues) { [issue_actual_project, issue_other_project] } let(:issues) { [issue_actual_project, issue_other_project] }
def build_note shared_examples "correct references" do
markdown = "Referencing internal issue #{issue_actual_project.to_reference}, " +
"cross-project #{issue_other_project.to_reference(actual_project)} external JIRA-5 " +
"and non existing #999"
page.within('#diff-notes-app') do
fill_in 'note_note', with: markdown
end
end
shared_examples 'correct references' do
before do before do
remotelink = double(:remotelink, all: [], build: double(save!: true)) remotelink = double(:remotelink, all: [], build: double(save!: true))
...@@ -28,110 +18,89 @@ describe 'Markdown References', :js do ...@@ -28,110 +18,89 @@ describe 'Markdown References', :js do
allow_any_instance_of(JIRA::Resource::Issue).to receive(:remotelink).and_return(remotelink) allow_any_instance_of(JIRA::Resource::Issue).to receive(:remotelink).and_return(remotelink)
sign_in(user) sign_in(user)
visit merge_request_path(merge_request)
build_note
end
def links_expectations visit(merge_request_path(merge_request))
issues.each do |issue|
if referenced_issues.include?(issue)
expect(page).to have_link(issue.to_reference, href: issue_path(issue))
else
expect(page).not_to have_link(issue.to_reference, href: issue_path(issue))
end
end
if jira_referenced build_note
expect(page).to have_link('JIRA-5', href: 'https://jira.example.com/browse/JIRA-5')
else
expect(page).not_to have_link('JIRA-5', href: 'https://jira.example.com/browse/JIRA-5')
end end
expect(page).not_to have_link('#999') it "creates a link to the referenced issue on the preview" do
end find(".js-md-preview-button").click
it 'creates a link to the referenced issue on the preview' do
find('.js-md-preview-button').click
wait_for_requests wait_for_requests
page.within('.md-preview-holder') do page.within(".md-preview-holder") do
links_expectations links_expectations
end end
end end
it 'creates a link to the referenced issue after submit' do it "creates a link to the referenced issue after submit" do
click_button 'Comment' click_button("Comment")
wait_for_requests wait_for_requests
page.within('#diff-notes-app') do page.within("#diff-notes-app") do
links_expectations links_expectations
end end
end end
it 'creates a note on the referenced issues' do it "creates a note on the referenced issues" do
click_button 'Comment' click_button("Comment")
wait_for_requests wait_for_requests
if referenced_issues.include?(issue_actual_project) if referenced_issues.include?(issue_actual_project)
visit issue_path(issue_actual_project) visit(issue_path(issue_actual_project))
page.within('#notes') do page.within("#notes") do
expect(page).to have_content( expect(page).to have_content("#{user.to_reference} mentioned in merge request #{merge_request.to_reference}")
"#{user.to_reference} mentioned in merge request #{merge_request.to_reference}"
)
end end
end end
if referenced_issues.include?(issue_other_project) if referenced_issues.include?(issue_other_project)
visit issue_path(issue_other_project) visit(issue_path(issue_other_project))
page.within('#notes') do page.within("#notes") do
expect(page).to have_content( expect(page).to have_content("#{user.to_reference} mentioned in merge request #{merge_request.to_reference(other_project)}")
"#{user.to_reference} mentioned in merge request #{merge_request.to_reference(other_project)}"
)
end end
end end
end end
end end
context 'when internal issues tracker is enabled for the other project' do context "when internal issues tracker is enabled for the other project" do
context 'when only internal issues tracker is enabled for the actual project' do context "when only internal issues tracker is enabled for the actual project" do
include_examples 'correct references' do include_examples "correct references" do
let(:referenced_issues) { [issue_actual_project, issue_other_project] } let(:referenced_issues) { [issue_actual_project, issue_other_project] }
let(:jira_referenced) { false } let(:jira_referenced) { false }
end end
end end
context 'when both external and internal issues trackers are enabled for the actual project' do context "when both external and internal issues trackers are enabled for the actual project" do
before do before do
create(:jira_service, project: actual_project) create(:jira_service, project: actual_project)
end end
include_examples 'correct references' do include_examples "correct references" do
let(:referenced_issues) { [issue_actual_project, issue_other_project] } let(:referenced_issues) { [issue_actual_project, issue_other_project] }
let(:jira_referenced) { true } let(:jira_referenced) { true }
end end
end end
context 'when only external issues tracker is enabled for the actual project' do context "when only external issues tracker is enabled for the actual project" do
let(:actual_project) { create(:project, :public, :repository, :issues_disabled) }
before do before do
create(:jira_service, project: actual_project) create(:jira_service, project: actual_project)
actual_project.issues_enabled = false
actual_project.save!
end end
include_examples 'correct references' do include_examples "correct references" do
let(:referenced_issues) { [issue_other_project] } let(:referenced_issues) { [issue_other_project] }
let(:jira_referenced) { true } let(:jira_referenced) { true }
end end
end end
context 'when no tracker is enabled for the actual project' do context "when no tracker is enabled for the actual project" do
before do let(:actual_project) { create(:project, :public, :repository, :issues_disabled) }
actual_project.issues_enabled = false
actual_project.save!
end
include_examples 'correct references' do include_examples 'correct references' do
let(:referenced_issues) { [issue_other_project] } let(:referenced_issues) { [issue_other_project] }
...@@ -140,54 +109,79 @@ describe 'Markdown References', :js do ...@@ -140,54 +109,79 @@ describe 'Markdown References', :js do
end end
end end
context 'when internal issues tracker is disabled for the other project' do context "when internal issues tracker is disabled for the other project" do
before do let(:other_project) { create(:project, :public, :repository, :issues_disabled) }
other_project.issues_enabled = false
other_project.save!
end
context 'when only internal issues tracker is enabled for the actual project' do context "when only internal issues tracker is enabled for the actual project" do
include_examples 'correct references' do include_examples "correct references" do
let(:referenced_issues) { [issue_actual_project] } let(:referenced_issues) { [issue_actual_project] }
let(:jira_referenced) { false } let(:jira_referenced) { false }
end end
end end
context 'when both external and internal issues trackers are enabled for the actual project' do context "when both external and internal issues trackers are enabled for the actual project" do
before do before do
create(:jira_service, project: actual_project) create(:jira_service, project: actual_project)
end end
include_examples 'correct references' do include_examples "correct references" do
let(:referenced_issues) { [issue_actual_project] } let(:referenced_issues) { [issue_actual_project] }
let(:jira_referenced) { true } let(:jira_referenced) { true }
end end
end end
context 'when only external issues tracker is enabled for the actual project' do context "when only external issues tracker is enabled for the actual project" do
let(:actual_project) { create(:project, :public, :repository, :issues_disabled) }
before do before do
create(:jira_service, project: actual_project) create(:jira_service, project: actual_project)
actual_project.issues_enabled = false
actual_project.save!
end end
include_examples 'correct references' do include_examples "correct references" do
let(:referenced_issues) { [] } let(:referenced_issues) { [] }
let(:jira_referenced) { true } let(:jira_referenced) { true }
end end
end end
context 'when no issues tracker is enabled for the actual project' do context "when no issues tracker is enabled for the actual project" do
before do let(:actual_project) { create(:project, :public, :repository, :issues_disabled) }
actual_project.issues_enabled = false
actual_project.save!
end
include_examples 'correct references' do include_examples "correct references" do
let(:referenced_issues) { [] } let(:referenced_issues) { [] }
let(:jira_referenced) { false } let(:jira_referenced) { false }
end end
end end
end end
private
def build_note
markdown = <<~HEREDOC
Referencing internal issue #{issue_actual_project.to_reference},
cross-project #{issue_other_project.to_reference(actual_project)} external JIRA-5
and non existing #999
HEREDOC
page.within("#diff-notes-app") do
fill_in("note_note", with: markdown)
end
end
def links_expectations
issues.each do |issue|
if referenced_issues.include?(issue)
expect(page).to have_link(issue.to_reference, href: issue_path(issue))
else
expect(page).not_to have_link(issue.to_reference, href: issue_path(issue))
end
end
if jira_referenced
expect(page).to have_link("JIRA-5", href: "https://jira.example.com/browse/JIRA-5")
else
expect(page).not_to have_link("JIRA-5", href: "https://jira.example.com/browse/JIRA-5")
end
expect(page).not_to have_link("#999")
end
end end
require "spec_helper"
describe "User interacts with deploy keys", :js do
let(:project) { create(:project, :repository) }
let(:user) { project.owner }
before do
sign_in(user)
end
shared_examples "attaches a key" do
it "attaches key" do
visit(project_deploy_keys_path(project))
page.within(".deploy-keys") do
find(".badge", text: "1").click
click_button("Enable")
expect(page).not_to have_selector(".fa-spinner")
expect(current_path).to eq(project_settings_repository_path(project))
find(".js-deployKeys-tab-enabled_keys").click
expect(page).to have_content(deploy_key.title)
end
end
end
context "viewing deploy keys" do
let(:deploy_key) { create(:deploy_key) }
context "when project has keys" do
before do
create(:deploy_keys_project, project: project, deploy_key: deploy_key)
end
it "shows deploy keys" do
visit(project_deploy_keys_path(project))
page.within(".deploy-keys") do
expect(page).to have_content(deploy_key.title)
end
end
end
context "when another project has keys" do
let(:another_project) { create(:project) }
before do
create(:deploy_keys_project, project: another_project, deploy_key: deploy_key)
another_project.add_master(user)
end
it "shows deploy keys" do
visit(project_deploy_keys_path(project))
page.within(".deploy-keys") do
find('.js-deployKeys-tab-available_project_keys').click
expect(page).to have_content(deploy_key.title)
expect(find(".js-deployKeys-tab-available_project_keys .badge")).to have_content("1")
end
end
end
context "when there are public deploy keys" do
let!(:deploy_key) { create(:deploy_key, public: true) }
it "shows public deploy keys" do
visit(project_deploy_keys_path(project))
page.within(".deploy-keys") do
find(".js-deployKeys-tab-public_keys").click
expect(page).to have_content(deploy_key.title)
end
end
end
end
context "adding deploy keys" do
before do
visit(project_deploy_keys_path(project))
end
it "adds new key" do
DEPLOY_KEY_TITLE = attributes_for(:key)[:title]
DEPLOY_KEY_BODY = attributes_for(:key)[:key]
fill_in("deploy_key_title", with: DEPLOY_KEY_TITLE)
fill_in("deploy_key_key", with: DEPLOY_KEY_BODY)
click_button("Add key")
expect(current_path).to eq(project_settings_repository_path(project))
page.within(".deploy-keys") do
expect(page).to have_content(DEPLOY_KEY_TITLE)
end
end
end
context "attaching existing keys" do
context "from another project" do
let(:another_project) { create(:project) }
let(:deploy_key) { create(:deploy_key) }
before do
create(:deploy_keys_project, project: another_project, deploy_key: deploy_key)
another_project.add_master(user)
end
it_behaves_like "attaches a key"
end
context "when keys are public" do
let!(:deploy_key) { create(:deploy_key, public: true) }
it_behaves_like "attaches a key"
end
end
end
...@@ -283,7 +283,7 @@ describe ProjectsHelper do ...@@ -283,7 +283,7 @@ describe ProjectsHelper do
end end
it 'removes the repo path' do it 'removes the repo path' do
repo = "#{storage_path}/namespace/test.git" repo = File.join(storage_path, 'namespace/test.git')
import_error = "Could not clone #{repo}\n" import_error = "Could not clone #{repo}\n"
expect(sanitize_repo_path(project, import_error)).to eq('Could not clone [REPOS PATH]/namespace/test.git') expect(sanitize_repo_path(project, import_error)).to eq('Could not clone [REPOS PATH]/namespace/test.git')
......
import _ from 'underscore';
import Vue from 'vue'; import Vue from 'vue';
import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
import eventHub from '~/deploy_keys/eventhub'; import eventHub from '~/deploy_keys/eventhub';
import deployKeysApp from '~/deploy_keys/components/app.vue'; import deployKeysApp from '~/deploy_keys/components/app.vue';
import { TEST_HOST } from 'spec/test_constants';
describe('Deploy keys app component', () => { describe('Deploy keys app component', () => {
const data = getJSONFixture('deploy_keys/keys.json'); const data = getJSONFixture('deploy_keys/keys.json');
let vm; let vm;
let mock;
const deployKeysResponse = (request, next) => { beforeEach((done) => {
next( // setup axios mock before component
request.respondWith(JSON.stringify(data), { mock = new MockAdapter(axios);
status: 200, mock.onGet(`${TEST_HOST}/dummy/`).replyOnce(200, data);
}),
);
};
beforeEach(done => {
const Component = Vue.extend(deployKeysApp); const Component = Vue.extend(deployKeysApp);
Vue.http.interceptors.push(deployKeysResponse);
vm = new Component({ vm = new Component({
propsData: { propsData: {
endpoint: '/test', endpoint: `${TEST_HOST}/dummy`,
projectId: '8', projectId: '8',
}, },
}).$mount(); }).$mount();
...@@ -31,7 +28,7 @@ describe('Deploy keys app component', () => { ...@@ -31,7 +28,7 @@ describe('Deploy keys app component', () => {
}); });
afterEach(() => { afterEach(() => {
Vue.http.interceptors = _.without(Vue.http.interceptors, deployKeysResponse); mock.restore();
}); });
it('renders loading icon', done => { it('renders loading icon', done => {
......
...@@ -28,6 +28,10 @@ describe('Multi-file editor library model', () => { ...@@ -28,6 +28,10 @@ describe('Multi-file editor library model', () => {
expect(model.originalModel).not.toBeNull(); expect(model.originalModel).not.toBeNull();
expect(model.model).not.toBeNull(); expect(model.model).not.toBeNull();
expect(model.baseModel).not.toBeNull(); expect(model.baseModel).not.toBeNull();
expect(model.originalModel.uri.path).toBe('original/path--path');
expect(model.model.uri.path).toBe('path--path');
expect(model.baseModel.uri.path).toBe('target/path--path');
}); });
it('creates model with head file to compare against', () => { it('creates model with head file to compare against', () => {
......
...@@ -569,6 +569,22 @@ describe('IDE store file actions', () => { ...@@ -569,6 +569,22 @@ describe('IDE store file actions', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('returns false when already opened', done => {
store.state.openFiles.push({
...f,
active: true,
key: `pending-${f.key}`,
});
store
.dispatch('openPendingTab', { file: f, keyPrefix: 'pending' })
.then(added => {
expect(added).toBe(false);
})
.then(done)
.catch(done.fail);
});
it('pushes router URL when added', done => { it('pushes router URL when added', done => {
store.state.currentBranchId = 'master'; store.state.currentBranchId = 'master';
......
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20180508100222_add_not_null_constraint_to_project_mirror_data_foreign_key.rb')
describe AddNotNullConstraintToProjectMirrorDataForeignKey, :migration do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:import_state) { table(:project_mirror_data) }
before do
import_state.create!(id: 1, project_id: nil, status: :started)
end
it 'removes every import state without an associated project_id' do
expect do
subject.up
end.to change { import_state.count }.from(1).to(0)
end
end
...@@ -3,6 +3,7 @@ require 'spec_helper' ...@@ -3,6 +3,7 @@ require 'spec_helper'
describe Ci::Runner do describe Ci::Runner do
describe 'validation' do describe 'validation' do
it { is_expected.to validate_presence_of(:access_level) } it { is_expected.to validate_presence_of(:access_level) }
it { is_expected.to validate_presence_of(:runner_type) }
context 'when runner is not allowed to pick untagged jobs' do context 'when runner is not allowed to pick untagged jobs' do
context 'when runner does not have tags' do context 'when runner does not have tags' do
......
...@@ -74,9 +74,8 @@ describe Clusters::Applications::Runner do ...@@ -74,9 +74,8 @@ describe Clusters::Applications::Runner do
it 'assigns the new runner to runner' do it 'assigns the new runner to runner' do
subject subject
gitlab_runner.reload
expect(gitlab_runner.runner).not_to be_nil expect(gitlab_runner.reload.runner).to be_project_type
end end
end end
......
...@@ -1733,7 +1733,8 @@ describe Repository do ...@@ -1733,7 +1733,8 @@ describe Repository do
:gitlab_ci, :gitlab_ci,
:avatar, :avatar,
:issue_template, :issue_template,
:merge_request_template :merge_request_template,
:xcode_config
]) ])
repository.after_change_head repository.after_change_head
...@@ -2058,6 +2059,36 @@ describe Repository do ...@@ -2058,6 +2059,36 @@ describe Repository do
end end
end end
describe '#xcode_project?' do
before do
allow(repository).to receive(:tree).with(:head).and_return(double(:tree, blobs: [blob]))
end
context 'when the root contains a *.xcodeproj file' do
let(:blob) { double(:blob, path: 'Foo.xcodeproj') }
it 'returns true' do
expect(repository.xcode_project?).to be_truthy
end
end
context 'when the root contains a *.xcworkspace file' do
let(:blob) { double(:blob, path: 'Foo.xcworkspace') }
it 'returns true' do
expect(repository.xcode_project?).to be_truthy
end
end
context 'when the root contains no XCode config file' do
let(:blob) { double(:blob, path: 'subdir/Foo.xcworkspace') }
it 'returns false' do
expect(repository.xcode_project?).to be_falsey
end
end
end
describe "#keep_around" do describe "#keep_around" do
it "does not fail if we attempt to reference bad commit" do it "does not fail if we attempt to reference bad commit" do
expect(repository.kept_around?('abc1234')).to be_falsey expect(repository.kept_around?('abc1234')).to be_falsey
......
...@@ -41,6 +41,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do ...@@ -41,6 +41,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
expect(json_response['id']).to eq(runner.id) expect(json_response['id']).to eq(runner.id)
expect(json_response['token']).to eq(runner.token) expect(json_response['token']).to eq(runner.token)
expect(runner.run_untagged).to be true expect(runner.run_untagged).to be true
expect(runner.active).to be true
expect(runner.token).not_to eq(registration_token) expect(runner.token).not_to eq(registration_token)
expect(runner).to be_instance_type expect(runner).to be_instance_type
end end
...@@ -129,6 +130,28 @@ describe API::Runner, :clean_gitlab_redis_shared_state do ...@@ -129,6 +130,28 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
end end
end end
context 'when option for activating a Runner is provided' do
context 'when active is set to true' do
it 'creates runner' do
post api('/runners'), token: registration_token,
active: true
expect(response).to have_gitlab_http_status 201
expect(Ci::Runner.first.active).to be true
end
end
context 'when active is set to false' do
it 'creates runner' do
post api('/runners'), token: registration_token,
active: false
expect(response).to have_gitlab_http_status 201
expect(Ci::Runner.first.active).to be false
end
end
end
context 'when maximum job timeout is specified' do context 'when maximum job timeout is specified' do
it 'creates runner' do it 'creates runner' do
post api('/runners'), token: registration_token, post api('/runners'), token: registration_token,
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
# User-specific stuff # User-specific stuff
.idea/**/workspace.xml .idea/**/workspace.xml
.idea/**/tasks.xml .idea/**/tasks.xml
.idea/dictionaries .idea/**/dictionaries
.idea/**/shelf
# Sensitive or high-churn files # Sensitive or high-churn files
.idea/**/dataSources/ .idea/**/dataSources/
......
...@@ -12,3 +12,5 @@ Session.vim ...@@ -12,3 +12,5 @@ Session.vim
*~ *~
# Auto-generated tag files # Auto-generated tag files
tags tags
# Persistent undo
[._]*.un~
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# Package Files # # Package Files #
*.jar *.jar
*.war *.war
*.nar
*.ear *.ear
*.zip *.zip
*.tar.gz *.tar.gz
......
...@@ -52,7 +52,7 @@ Carthage/Build ...@@ -52,7 +52,7 @@ Carthage/Build
fastlane/report.xml fastlane/report.xml
fastlane/Preview.html fastlane/Preview.html
fastlane/screenshots fastlane/screenshots/**/*.png
fastlane/test_output fastlane/test_output
# Code Injection # Code Injection
......
...@@ -64,5 +64,5 @@ Carthage/Build ...@@ -64,5 +64,5 @@ Carthage/Build
fastlane/report.xml fastlane/report.xml
fastlane/Preview.html fastlane/Preview.html
fastlane/screenshots fastlane/screenshots/**/*.png
fastlane/test_output fastlane/test_output
...@@ -198,6 +198,9 @@ pythontex-files-*/ ...@@ -198,6 +198,9 @@ pythontex-files-*/
# easy-todo # easy-todo
*.lod *.lod
# xmpincl
*.xmpi
# xindy # xindy
*.xdy *.xdy
...@@ -234,3 +237,6 @@ TSWLatexianTemp* ...@@ -234,3 +237,6 @@ TSWLatexianTemp*
# standalone packages # standalone packages
*.sta *.sta
# generated if using elsarticle.cls
*.spl
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
Assets/AssetStoreTools* Assets/AssetStoreTools*
# Visual Studio cache directory # Visual Studio cache directory
/.vs/ .vs/
# Autogenerated VS/MD/Consulo solution and project files # Autogenerated VS/MD/Consulo solution and project files
ExportedObj/ ExportedObj/
...@@ -22,6 +22,7 @@ ExportedObj/ ...@@ -22,6 +22,7 @@ ExportedObj/
*.booproj *.booproj
*.svd *.svd
*.pdb *.pdb
*.opendb
# Unity3D generated meta files # Unity3D generated meta files
*.pidb.meta *.pidb.meta
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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