Commit 10e19915 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'ce-to-ee-2018-05-09' into 'master'

CE upstream - 2018-05-09 12:24 UTC

Closes gitlab-com/gitlab-docs#200

See merge request gitlab-org/gitlab-ee!5633
parents 12d57caf d5e9ecd7
......@@ -14,12 +14,12 @@ export default class Model {
(this.originalModel = this.monaco.editor.createModel(
head ? head.content : this.file.raw,
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.content,
undefined,
new this.monaco.Uri(null, null, this.file.key),
new this.monaco.Uri(null, null, this.path),
)),
);
if (this.file.mrChange) {
......@@ -27,7 +27,7 @@ export default class Model {
(this.baseModel = this.monaco.editor.createModel(
this.file.baseRaw,
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) => {
};
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}`));
commit(types.ADD_PENDING_TAB, { file, keyPrefix });
......
......@@ -36,7 +36,9 @@ ul.notes-form,
.gutter-toggle,
.issuable-details .content-block-small,
.edit-link,
.note-action-button {
.note-action-button,
.right-sidebar,
.flash-container {
display: none !important;
}
......@@ -53,3 +55,7 @@ pre {
.right-sidebar {
top: 0;
}
a[href]::after {
content: none !important;
}
......@@ -59,6 +59,7 @@ module Ci
validate :tag_constraints
validate :either_projects_or_group
validates :access_level, presence: true
validates :runner_type, presence: true
acts_as_taggable
......
......@@ -43,12 +43,20 @@ module Clusters
def create_and_assign_runner
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)
end
end
end
def runner_create_params
{
name: 'kubernetes-cluster',
runner_type: :project_type,
tag_list: %w(kubernetes cluster)
}
end
def gitlab_url
Gitlab::Routing.url_helpers.root_url(only_path: false)
end
......
- link = link_to 'Runners API', help_page_path('api/runners.md')
- link = link_to _('Runners API'), help_page_path('api/runners.md')
%h3
= _('Group Runners')
......
- page_title "Edit", "#{@runner.description} ##{@runner.id}", "Runners"
- page_title _('Edit'), "#{@runner.description} ##{@runner.id}", 'Runners'
%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
= _('Group Runners')
......@@ -25,7 +25,7 @@
= _('This group does not provide any group Runners yet.')
- 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 }
- else
= _('Ask your group master to setup a group Runner.')
......
%h3 Shared Runners
%h3
= _('Shared Runners')
.bs-callout.shared-runners-description
- if Gitlab::CurrentSettings.shared_runners_text.present?
......@@ -17,8 +18,7 @@
  for this project
- if @shared_runners_count.zero?
This GitLab instance does not provide any shared Runners yet. Instance
administrators can register shared Runners in the admin area.
= _('This GitLab instance does not provide any shared Runners yet. Instance administrators can register shared Runners in the admin area.')
- else
%h4.underlined-title Available shared Runners : #{@shared_runners_count}
%ul.bordered-list.available-shared-runners
......
%h3 Specific Runners
%h3
= _('Specific Runners')
= render partial: 'ci/runner/how_to_setup_specific_runner',
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}
......
......@@ -20,11 +20,11 @@
%span.light Indicates whether this runner can pick jobs without tags
- unless runner.group_type?
.form-group
= label :locked, 'Lock to current projects', class: 'control-label'
= label :locked, _('Lock to current projects'), class: 'control-label'
.col-sm-10
.checkbox
= 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
= label_tag :token, class: 'control-label' do
Token
......
......@@ -21,17 +21,17 @@
%th Value
%tr
%td Active
%td= @runner.active? ? 'Yes' : 'No'
%td= @runner.active? ? _('Yes') : _('No')
%tr
%td Protected
%td= @runner.ref_protected? ? 'Yes' : 'No'
%td= @runner.ref_protected? ? _('Yes') : _('No')
%tr
%td Can run untagged jobs
%td= @runner.run_untagged? ? 'Yes' : 'No'
%td= _('Can run untagged jobs')
%td= @runner.run_untagged? ? _('Yes') : _('No')
- unless @runner.group_type?
%tr
%td Locked to this project
%td= @runner.locked? ? 'Yes' : 'No'
%td= _('Locked to this project')
%td= @runner.locked? ? _('Yes') : _('No')
%tr
%td Tags
%td
......@@ -60,7 +60,7 @@
%td Description
%td= @runner.description
%tr
%td Maximum job timeout
%td= _('Maximum job timeout')
%td= @runner.maximum_timeout_human_readable
%tr
%td Last contact
......
---
title: Fix print styles for markdown pages
merge_request:
author:
type: fixed
---
title: 'Replace the `project/ff_merge_requests.feature` spinach test with an rspec analog'
merge_request: 18800
author: '@blackst0ne'
type: other
class InitSchema < ActiveRecord::Migration
DOWNTIME = true
def up
create_table "broadcast_messages", force: :cascade do |t|
t.text "message", null: false
......
class SetRunnerTypeNotNull < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
change_column_null(:ci_runners, :runner_type, false)
end
end
......@@ -593,7 +593,7 @@ ActiveRecord::Schema.define(version: 20180509091305) do
t.integer "access_level", default: 0, null: false
t.string "ip_address"
t.integer "maximum_timeout"
t.integer "runner_type", limit: 2
t.integer "runner_type", limit: 2, null: false
end
add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree
......
......@@ -23,7 +23,7 @@ container_scanning:
- docker:stable-dind
script:
- 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
- docker pull ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG}
- 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
Read the [requirements documentation](../../install/requirements.md#gitlab-runner)
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
specific. You can only register a shared Runner if you have admin access to
......@@ -32,6 +32,9 @@ are:
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)
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
can run jobs for every project that has enabled the option **Allow shared Runners**
......@@ -66,7 +69,7 @@ Runners to disabled.
## 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. 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:
1. Go to **Settings > CI/CD** to obtain the token
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
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:
> **Note**:
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.
An admin can enable/disable a specific Runner for projects:
......
......@@ -205,6 +205,19 @@ Things to note:
built-in help page, that's why we omit it in `git grep`.
- 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
If the documentation page being relocated already has any Disqus comments,
......
Feature: Project Ff Merge Requests
Background:
Given I sign in as a user
And I own project "Shop"
And project "Shop" have "Bug NS-05" open merge request with diffs inside
And merge request "Bug NS-05" is mergeable
@javascript
Scenario: I do ff-only merge for rebased branch
Given ff merge enabled
And merge request "Bug NS-05" is rebased
When I visit merge request page "Bug NS-05"
Then I should see ff-only merge button
When I accept this merge request
Then I should see merged request
@javascript
Scenario: I do ff-only merge for merged branch
Given ff merge enabled
And merge request "Bug NS-05" merged target
When I visit merge request page "Bug NS-05"
Then I should see ff-only merge button
When I accept this merge request
Then I should see merged request
@javascript
Scenario: I do rebase before ff-only merge
Given ff merge enabled
And rebase before merge enabled
When I visit merge request page "Bug NS-05"
Then I should see rebase button
When I press rebase button
Then I should see rebase in progress message
@javascript
Scenario: I do rebase before regular merge
Given rebase before merge enabled
When I visit merge request page "Bug NS-05"
Then I should see rebase button
When I press rebase button
Then I should see rebase in progress message
class Spinach::Features::ProjectFfMergeRequests < Spinach::FeatureSteps
include SharedAuthentication
include SharedIssuable
include SharedProject
include SharedNote
include SharedPaths
include SharedMarkdown
include SharedDiffNote
include SharedUser
include WaitForRequests
step 'project "Shop" have "Bug NS-05" open merge request with diffs inside' do
create(:merge_request_with_diffs,
title: "Bug NS-05",
source_project: project,
target_project: project,
author: project.users.first)
end
step 'merge request is mergeable' do
expect(page).to have_button 'Merge'
end
step 'I should see ff-only merge button' do
expect(page).to have_content "Fast-forward merge without a merge commit"
expect(page).to have_button 'Merge'
end
step 'merge request "Bug NS-05" is mergeable' do
merge_request.mark_as_mergeable
end
step 'I accept this merge request' do
page.within '.mr-state-widget' do
click_button "Merge"
end
end
step 'I should see merged request' do
page.within '.status-box' do
expect(page).to have_content "Merged"
wait_for_requests
end
end
step 'ff merge enabled' do
project = merge_request.target_project
project.merge_requests_ff_only_enabled = true
project.save!
end
step 'I should see rebase button' do
expect(page).to have_button "Rebase"
end
step 'merge request "Bug NS-05" is rebased' do
merge_request.source_branch = 'flatten-dir'
merge_request.target_branch = 'improve/awesome'
merge_request.reload_diff
merge_request.save!
end
step 'merge request "Bug NS-05" merged target' do
merge_request.source_branch = 'merged-target'
merge_request.target_branch = 'improve/awesome'
merge_request.reload_diff
merge_request.save!
end
step 'rebase before merge enabled' do
project = merge_request.target_project
project.merge_requests_rebase_enabled = true
project.save!
end
step 'I press rebase button' do
click_button "Rebase"
end
step "I should see rebase in progress message" do
expect(page).to have_content("Rebase in progress")
end
def merge_request
@merge_request ||= MergeRequest.find_by!(title: "Bug NS-05")
end
end
......@@ -344,11 +344,6 @@ module SharedPaths
wait_for_requests
end
step 'I visit merge request page "Bug NS-05"' do
visit merge_request_path("Bug NS-05")
wait_for_requests
end
step 'I visit merge request page "Bug NS-07"' do
visit merge_request_path("Bug NS-07")
wait_for_requests
......
This diff is collapsed.
......@@ -6,6 +6,7 @@ FactoryBot.define do
is_shared false
active true
access_level :not_protected
runner_type :project_type
trait :online do
contacted_at Time.now
......@@ -13,6 +14,7 @@ FactoryBot.define do
trait :shared do
is_shared true
runner_type :instance_type
end
trait :specific do
......
......@@ -41,6 +41,11 @@ FactoryBot.define do
state :merged
end
trait :merged_target do
source_branch "merged-target"
target_branch "improve/awesome"
end
trait :closed do
state :closed
end
......
require "spec_helper"
describe "User merges a merge request", :js do
let(:user) { project.owner }
before do
sign_in(user)
end
shared_examples "fast forward merge a merge request" do
it "merges a merge request" do
expect(page).to have_content("Fast-forward merge without a merge commit").and have_button("Merge")
page.within(".mr-state-widget") do
click_button("Merge")
end
page.within(".status-box") do
expect(page).to have_content("Merged")
end
end
end
context "ff-only merge" do
let(:project) { create(:project, :public, :repository, merge_requests_ff_only_enabled: true) }
before do
visit(merge_request_path(merge_request))
end
context "when branch is rebased" do
let!(:merge_request) { create(:merge_request, :rebased, source_project: project) }
it_behaves_like "fast forward merge a merge request"
end
context "when branch is merged" do
let!(:merge_request) { create(:merge_request, :merged_target, source_project: project) }
it_behaves_like "fast forward merge a merge request"
end
end
end
require "spec_helper"
describe "User rebases a merge request", :js do
let(:merge_request) { create(:merge_request, :simple, source_project: project) }
let(:user) { project.owner }
before do
sign_in(user)
end
shared_examples "rebases" do
it "rebases" do
visit(merge_request_path(merge_request))
expect(page).to have_button("Rebase")
click_button("Rebase")
expect(page).to have_content("Rebase in progress")
end
end
context "when merge is regular" do
let(:project) { create(:project, :public, :repository, merge_requests_rebase_enabled: true) }
it_behaves_like "rebases"
end
context "when merge is ff-only" do
let(:project) { create(:project, :public, :repository, merge_requests_ff_only_enabled: true) }
it_behaves_like "rebases"
end
end
......@@ -28,6 +28,10 @@ describe('Multi-file editor library model', () => {
expect(model.originalModel).not.toBeNull();
expect(model.model).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', () => {
......
......@@ -569,6 +569,22 @@ describe('IDE store file actions', () => {
.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 => {
store.state.currentBranchId = 'master';
......
......@@ -3,6 +3,7 @@ require 'spec_helper'
describe Ci::Runner do
describe 'validation' do
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 does not have tags' do
......
......@@ -70,9 +70,8 @@ describe Clusters::Applications::Runner do
it 'assigns the new runner to runner' do
subject
gitlab_runner.reload
expect(gitlab_runner.runner).not_to be_nil
expect(gitlab_runner.reload.runner).to be_project_type
end
end
......
......@@ -4,7 +4,8 @@
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/dictionaries
.idea/**/shelf
# Sensitive or high-churn files
.idea/**/dataSources/
......
......@@ -12,3 +12,5 @@ Session.vim
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
......@@ -13,6 +13,7 @@
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
......
......@@ -52,7 +52,7 @@ Carthage/Build
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/screenshots/**/*.png
fastlane/test_output
# Code Injection
......
......@@ -64,5 +64,5 @@ Carthage/Build
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/screenshots/**/*.png
fastlane/test_output
......@@ -198,6 +198,9 @@ pythontex-files-*/
# easy-todo
*.lod
# xmpincl
*.xmpi
# xindy
*.xdy
......@@ -234,3 +237,6 @@ TSWLatexianTemp*
# standalone packages
*.sta
# generated if using elsarticle.cls
*.spl
......@@ -6,7 +6,7 @@
Assets/AssetStoreTools*
# Visual Studio cache directory
/.vs/
.vs/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
......@@ -22,6 +22,7 @@ ExportedObj/
*.booproj
*.svd
*.pdb
*.opendb
# Unity3D generated meta files
*.pidb.meta
......
......@@ -240,6 +240,7 @@ Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
......
......@@ -7,7 +7,7 @@
image: "chef/chefdk"
services:
- docker:stable-dind
- docker:dind
variables:
DOCKER_HOST: "tcp://docker:2375"
......
......@@ -2,7 +2,7 @@
image: docker:latest
services:
- docker:stable-dind
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
......
......@@ -24,7 +24,7 @@ variables:
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_REF_NAME"'
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .m2/repository
......
# Lifted from: https://about.gitlab.com/2016/03/10/setting-up-gitlab-ci-for-ios-projects/
# This file assumes an own GitLab CI runner, setup on an OS X system.
# This file assumes an own GitLab CI runner, setup on an macOS system.
stages:
- build
- archive
......@@ -8,11 +8,11 @@ build_project:
stage: build
script:
- xcodebuild clean -project ProjectName.xcodeproj -scheme SchemeName | xcpretty
- xcodebuild test -project ProjectName.xcodeproj -scheme SchemeName -destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.2' | xcpretty -s
- xcodebuild test -project ProjectName.xcodeproj -scheme SchemeName -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.3' | xcpretty -s
tags:
- ios_9-2
- xcode_7-2
- osx_10-11
- ios_11-3
- xcode_9-3
- macos_10-13
archive_project:
stage: archive
......@@ -25,6 +25,6 @@ archive_project:
paths:
- build/ProjectName.ipa
tags:
- ios_9-2
- xcode_7-2
- osx_10-11
- ios_11-3
- xcode_9-3
- macos_10-13
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