Commit b6824473 authored by Stan Hu's avatar Stan Hu

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

parents e54b3c2b 95082a21
......@@ -13,7 +13,7 @@
.settings-content
= render partial: 'repository_mirrors_form'
%section.settings.as-repository-storage.no-animate#js-repository-storage-settings{ class: ('expanded' if expanded_by_default?) }
%section.qa-repository-storage.settings.as-repository-storage.no-animate#js-repository-storage-settings{ class: ('expanded' if expanded_by_default?) }
.settings-header
%h4
= _('Repository storage')
......
This diff is collapsed.
# GitLab quick actions
Quick actions are textual shortcuts for common actions on issues, merge requests
or commits that are usually done by clicking buttons or dropdowns in GitLab's UI.
You can enter these commands while creating a new issue or merge request, and
in comments. Each command should be on a separate line in order to be properly
detected and executed. The commands are removed from the issue, merge request or
comment body before it is saved and will not be visible to anyone else.
Below is a list of all of the available commands and descriptions about what they
do.
| Command | Action |
|:---------------------------|:-------------|
| `/close` | Close the issue, merge request or epic |
| `/reopen` | Reopen the issue, merge request or epic |
| `/merge` | Merge (when pipeline succeeds) |
| `/title <New title>` | Change title |
| `/assign @user1 @user2 ` | Add assignee(s) |
| `/reassign @user1 @user2 ` | Change assignee(s) |
| `/unassign @user1 @user2` | Remove all or specific assignee(s) |
| `/milestone %milestone` | Set milestone |
| `/remove_milestone` | Remove milestone |
| `/label ~foo ~"bar baz"` | Add label(s) |
| `/unlabel ~foo ~"bar baz"` | Remove all or specific label(s) |
| `/relabel ~foo ~"bar baz"` | Replace all label(s) |
| `/todo` | Add a todo |
| `/done` | Mark todo as done |
| `/subscribe` | Subscribe |
| `/unsubscribe` | Unsubscribe |
| <code>/due &lt;in 2 days &#124; this Friday &#124; December 31st&gt;</code> | Set due date |
| `/remove_due_date` | Remove due date |
| `/wip` | Toggle the Work In Progress status |
| <code>/estimate &lt;1w 3d 2h 14m&gt;</code> | Set time estimate |
| `/remove_estimate` | Remove estimated time |
| <code>/spend &lt;time(1h 30m &#124; -1h 5m)&gt; &lt;date(YYYY-MM-DD)&gt;</code> | Add or subtract spent time; optionally, specify the date that time was spent on |
| `/remove_time_spent` | Remove time spent |
| `/target_branch <Branch Name>` | Set target branch for current merge request |
| `/award :emoji:` | Toggle award for :emoji: |
| `/weight <0-999999999>` | Set the weight of the issue |
| `/clear_weight` | Clears the issue weight |
| `/board_move ~column` | Move issue to column on the board |
| `/duplicate #issue` | Closes this issue and marks it as a duplicate of another issue |
| `/move path/to/project` | Moves issue to another project |
| `/tag v1.2.3 <message>` | Tags a commit with a given tag name and optional message |
| `/tableflip` | Append the comment with `(╯°□°)╯︵ ┻━┻` |
| `/shrug` | Append the comment with `¯\_(ツ)_/¯` |
| <code>/copy_metadata #issue &#124; !merge_request</code> | Copy labels and milestone from other issue or merge request |
| `/confidential` | Makes the issue confidential |
| `/epic <group&epic | Epic URL>` | Adds an issue to an epic |
| `/remove_epic` | Removes an issue from an epic |
| `/lock` | Lock the discussion |
| `/unlock` | Unlock the discussion |
Quick actions are textual shortcuts for common actions on issues, epics, merge requests,
and commits that are usually done by clicking buttons or dropdowns in GitLab's UI.
You can enter these commands while creating a new issue or merge request, or
in comments of issues, epics, merge requests, and commits. Each command should be
on a separate line in order to be properly detected and executed. Once executed,
the commands are removed from the text body and not visible to anyone else.
Below is a list of all of the available commands, where they apply, and descriptions
about what they do.
docs-quick-actions-table
| Command | Action | Issue | Epic | Merge request | Commit |
|:---------------------------|:-----------------------|:------|:-----|:--------------|:-------|
| `/close` | Close | ✓ | ✓ | ✓ | |
| `/reopen` | Reopen | ✓ | ✓ | ✓ | |
| `/merge` | Merge (when pipeline succeeds) | | | ✓ | |
| `/title <New title>` | Change title | | ✓ | ✓ | ✓ | |
| `/assign @username` | Assign | ✓ | | ✓ | |
| `/unassign` | Remove assignee | ✓ | | ✓ | |
| `/milestone %milestone` | Set milestone | ✓ | | ✓ | |
| `/remove_milestone` | Remove milestone | ✓ | | ✓ | |
| `/label ~foo ~"bar baz"` | Add label(s) | ✓ | | ✓ | |
| `/unlabel ~foo ~"bar baz"` | Remove all or specific label(s)| ✓ | | ✓ | |
| `/relabel ~foo ~"bar baz"` | Replace all label(s) | ✓ | | ✓ | |
| `/todo` | Add a todo | ✓ | ✓ | ✓ | |
| `/done` | Mark todo as done | ✓ | ✓ | ✓ | |
| `/subscribe` | Subscribe | ✓ | ✓ | ✓ | |
| `/unsubscribe` | Unsubscribe | ✓ | ✓ | ✓ | |
| <code>/due &lt;in 2 days &#124; this Friday &#124; December 31st&gt;</code> | Set due date | ✓ | | | |
| `/remove_due_date` | Remove due date | ✓ | | | |
| `/wip` | Toggle the Work In Progress status | | | ✓ | |
| <code>/estimate &lt;1w 3d 2h 14m&gt;</code> | Set time estimate | ✓ | | ✓ | |
| `/remove_estimate` | Remove estimated time | ✓ | | ✓ | |
| <code>/spend &lt;time(1h 30m &#124; -1h 5m)&gt; &lt;date(YYYY-MM-DD)&gt;</code> | Add or subtract spent time; optionally, specify the date that time was spent on | ✓ | | | ✓ |
| `/remove_time_spent` | Remove time spent | ✓ | | ✓ | |
| `/target_branch <Branch Name>` | Set target branch for current merge request | | | ✓ | |
| `/award :emoji:` | Toggle award for :emoji: | ✓ | ✓ | ✓ | |
| `/weight <0-999999999>` | Set the weight of the issue | ✓ | | | |
| `/clear_weight` | Clears the issue weight | ✓ | | | |
| `/board_move ~column` | Move issue to column on the board | ✓ | | | |
| `/duplicate #issue` | Closes this issue and marks it as a duplicate of another issue | ✓ | | | |
| `/move path/to/project` | Moves issue to another project | ✓ | | | |
| `/tag v1.2.3 <message>` | Tags a commit with a given tag name and optional message | | | | ✓ |
| `/tableflip` | Append the comment with `(╯°□°)╯︵ ┻━┻` | ✓ | ✓ | ✓ | ✓ |
| `/shrug` | Append the comment with `¯\_(ツ)_/¯` | ✓ | ✓ | ✓ | ✓ |
| <code>/copy_metadata #issue &#124; !merge_request</code> | Copy labels and milestone from other issue or merge request | ✓ | | ✓ | |
| `/confidential` | Makes the issue confidential | ✓ | | | |
| `/epic <group&epic OR Epic URL>` | Adds an issue to an epic | | ✓ | | |
| `/remove_epic` | Removes an issue from an epic | | ✓ | | |
| `/lock` | Lock the discussion | ✓ | | | ✓ |
| `/unlock` | Unlock the discussion | ✓ | | | ✓|
Note: In GitLab Starter every issue can have more than one assignee, so commands `/assign`, `/unassign` and `/reassign`
support multiple assignees.
......@@ -16,7 +16,7 @@ module EE
private
def log_geo_event
::Geo::JobArtifactDeletedEventStore.new(self).create
::Geo::JobArtifactDeletedEventStore.new(self).create!
end
end
end
......@@ -16,7 +16,7 @@ module EE
private
def log_geo_event
::Geo::LfsObjectDeletedEventStore.new(self).create
::Geo::LfsObjectDeletedEventStore.new(self).create!
end
end
end
......@@ -57,7 +57,7 @@ module EE
project,
old_path: project.path,
old_path_with_namespace: old_path_with_namespace_for(project)
).create
).create!
end
end
......
......@@ -602,7 +602,7 @@ module EE
self,
old_path: path_before,
old_path_with_namespace: full_path_before
).create
).create!
end
end
end
......@@ -15,7 +15,7 @@ module EE
private
def log_geo_event
::Geo::UploadDeletedEventStore.new(self).create
::Geo::UploadDeletedEventStore.new(self).create!
end
end
end
......@@ -38,7 +38,7 @@ module EE
private
def log_geo_event(project)
::Geo::RepositoryCreatedEventStore.new(project).create
::Geo::RepositoryCreatedEventStore.new(project).create!
end
override :after_create_actions
......
......@@ -36,7 +36,7 @@ module EE
project,
repo_path: repo_path,
wiki_path: wiki_path
).create
).create!
end
# Removes physical repository in a Geo replicated secondary node
......
......@@ -11,7 +11,7 @@ module EE
project,
old_attachments_path: old_disk_path,
new_attachments_path: new_disk_path
).create
).create!
end
end
end
......
......@@ -12,7 +12,7 @@ module EE
old_storage_version: old_storage_version,
old_disk_path: old_disk_path,
old_wiki_disk_path: old_wiki_disk_path
).create
).create!
end
end
end
......
......@@ -15,7 +15,7 @@ module EE
project,
old_path: project.path,
old_path_with_namespace: @old_path # rubocop:disable Gitlab/ModuleWithInstanceVariables
).create
).create!
end
end
end
......
......@@ -30,7 +30,7 @@ module Geo
@params = params
end
def create
def create!
return unless Gitlab::Geo.primary?
return unless Gitlab::Geo.secondary_nodes.any? # no need to create an event if no one is listening
......
module Geo
class JobArtifactDeletedEventStore < EventStore
extend ::Gitlab::Utils::Override
self.event_type = :job_artifact_deleted_event
attr_reader :job_artifact
......@@ -8,7 +10,8 @@ module Geo
@job_artifact = job_artifact
end
def create
override :create!
def create!
return unless job_artifact.local_store?
super
......
module Geo
class LfsObjectDeletedEventStore < EventStore
extend ::Gitlab::Utils::Override
self.event_type = :lfs_object_deleted_event
attr_reader :lfs_object
......@@ -8,7 +10,8 @@ module Geo
@lfs_object = lfs_object
end
def create
override :create!
def create!
return unless lfs_object.local_store?
super
......
......@@ -15,7 +15,7 @@ module Geo
def execute
return false unless geo_node.update(params)
Geo::RepositoriesChangedEventStore.new(geo_node).create if selective_sync_changed?
Geo::RepositoriesChangedEventStore.new(geo_node).create! if selective_sync_changed?
true
end
......
......@@ -30,7 +30,7 @@ module Geo
def create_repository_updated_event!
Geo::RepositoryUpdatedEventStore.new(
project, refs: refs, changes: changes, source: source
).create
).create!
end
def reset_repository_checksum!
......
module Geo
class UploadDeletedEventStore < EventStore
extend ::Gitlab::Utils::Override
self.event_type = :upload_deleted_event
attr_reader :upload
......@@ -8,7 +10,8 @@ module Geo
@upload = upload
end
def create
override :create!
def create!
return unless upload.local?
super
......
......@@ -27,7 +27,7 @@ describe Geo::HashedStorageAttachmentsEventStore do
end
it 'tracks project attributes' do
subject.create
subject.create!
expect(Geo::HashedStorageAttachmentsEvent.last).to have_attributes(
old_attachments_path: old_attachments_path,
......
......@@ -26,7 +26,7 @@ describe Geo::HashedStorageMigratedEventStore do
end
it 'tracks project attributes' do
subject.create
subject.create!
expect(Geo::HashedStorageMigratedEvent.last).to have_attributes(
repository_storage_name: project.repository_storage,
......
......@@ -22,11 +22,11 @@ describe Geo::JobArtifactDeletedEventStore do
it 'does not create an event when LFS object is not on a local store' do
allow(job_artifact).to receive(:local_store?).and_return(false)
expect { subject.create }.not_to change(Geo::JobArtifactDeletedEvent, :count)
expect { subject.create! }.not_to change(Geo::JobArtifactDeletedEvent, :count)
end
it 'tracks LFS object attributes' do
subject.create
subject.create!
expect(Geo::JobArtifactDeletedEvent.last).to have_attributes(
job_artifact_id: job_artifact.id,
......@@ -49,7 +49,7 @@ describe Geo::JobArtifactDeletedEventStore do
expect(Gitlab::Geo::Logger).to receive(:error)
.with(expected_message).and_call_original
subject.create
subject.create!
end
end
end
......
......@@ -22,11 +22,11 @@ describe Geo::LfsObjectDeletedEventStore do
it 'does not create an event when LFS object is not on a local store' do
allow(lfs_object).to receive(:local_store?).and_return(false)
expect { subject.create }.not_to change(Geo::LfsObjectDeletedEvent, :count)
expect { subject.create! }.not_to change(Geo::LfsObjectDeletedEvent, :count)
end
it 'tracks LFS object attributes' do
subject.create
subject.create!
expect(Geo::LfsObjectDeletedEvent.last).to have_attributes(
lfs_object_id: lfs_object.id,
......@@ -50,7 +50,7 @@ describe Geo::LfsObjectDeletedEventStore do
expect(Gitlab::Geo::Logger).to receive(:error)
.with(expected_message).and_call_original
subject.create
subject.create!
end
end
end
......
......@@ -19,7 +19,7 @@ describe Geo::RepositoryCreatedEventStore do
end
it 'tracks information for the created project' do
subject.create
subject.create!
expect(Geo::RepositoryCreatedEvent.last).to have_attributes(
project_id: project.id,
......@@ -33,7 +33,7 @@ describe Geo::RepositoryCreatedEventStore do
it 'does not set a wiki path if the wiki is disabled' do
project.update!(wiki_enabled: false)
subject.create
subject.create!
expect(Geo::RepositoryCreatedEvent.last.wiki_path).to be_nil
end
......
......@@ -25,7 +25,7 @@ describe Geo::RepositoryDeletedEventStore do
end
it 'tracks information for the deleted project' do
subject.create
subject.create!
expect(Geo::RepositoryDeletedEvent.last).to have_attributes(
project_id: project_id,
......
......@@ -22,7 +22,7 @@ describe Geo::RepositoryRenamedEventStore do
end
it 'tracks old and new paths for project repositories' do
subject.create
subject.create!
expect(Geo::RepositoryRenamedEvent.last).to have_attributes(
repository_storage_name: project.repository_storage,
......
......@@ -30,7 +30,7 @@ describe Geo::RepositoryUpdatedEventStore do
context 'when repository is being updated' do
it 'does not track ref name when post-receive event affect multiple refs' do
subject.create
subject.create!
expect(Geo::RepositoryUpdatedEvent.last.ref).to be_nil
end
......@@ -40,19 +40,19 @@ describe Geo::RepositoryUpdatedEventStore do
changes = [{ before: '123456', after: blankrev, ref: 'refs/heads/tést' }]
subject = described_class.new(project, refs: refs, changes: changes)
subject.create
subject.create!
expect(Geo::RepositoryUpdatedEvent.last.ref).to eq 'refs/heads/tést'
end
it 'tracks number of branches post-receive event affects' do
subject.create
subject.create!
expect(Geo::RepositoryUpdatedEvent.last.branches_affected).to eq 1
end
it 'tracks number of tags post-receive event affects' do
subject.create
subject.create!
expect(Geo::RepositoryUpdatedEvent.last.tags_affected).to eq 1
end
......@@ -65,7 +65,7 @@ describe Geo::RepositoryUpdatedEventStore do
]
subject = described_class.new(project, refs: refs, changes: changes)
subject.create
subject.create!
expect(Geo::RepositoryUpdatedEvent.last.new_branch).to eq true
end
......@@ -78,7 +78,7 @@ describe Geo::RepositoryUpdatedEventStore do
]
subject = described_class.new(project, refs: refs, changes: changes)
subject.create
subject.create!
expect(Geo::RepositoryUpdatedEvent.last.remove_branch).to eq true
end
......@@ -88,7 +88,7 @@ describe Geo::RepositoryUpdatedEventStore do
it 'does not track any information' do
subject = described_class.new(project, source: Geo::RepositoryUpdatedEvent::WIKI)
subject.create
subject.create!
expect(Geo::RepositoryUpdatedEvent.last).to have_attributes(
ref: be_nil,
......
......@@ -19,7 +19,7 @@ describe Geo::ResetChecksumEventStore do
end
it 'tracks the project that checksum must be wiped' do
subject.create
subject.create!
expect(Geo::ResetChecksumEvent.last).to have_attributes(project_id: project.id)
end
......
......@@ -22,11 +22,11 @@ describe Geo::UploadDeletedEventStore do
it 'does not create an event when the upload does not use local storage' do
allow(upload).to receive(:local?).and_return(false)
expect { subject.create }.not_to change(Geo::UploadDeletedEvent, :count)
expect { subject.create! }.not_to change(Geo::UploadDeletedEvent, :count)
end
it 'tracks upload attributes' do
subject.create
subject.create!
expect(Geo::UploadDeletedEvent.last).to have_attributes(
upload_id: upload.id,
......
......@@ -7,7 +7,7 @@ shared_examples_for 'a Geo event store' do |event_class|
end
it 'does not create an event ' do
expect { subject.create }.not_to change(event_class, :count)
expect { subject.create! }.not_to change(event_class, :count)
end
end
......@@ -19,11 +19,11 @@ shared_examples_for 'a Geo event store' do |event_class|
it 'does not create an event if there are no secondary nodes' do
allow(Gitlab::Geo).to receive(:secondary_nodes) { [] }
expect { subject.create }.not_to change(event_class, :count)
expect { subject.create! }.not_to change(event_class, :count)
end
it 'creates an event' do
expect { subject.create }.to change(event_class, :count).by(1)
expect { subject.create! }.to change(event_class, :count).by(1)
end
end
end
......@@ -34,7 +34,7 @@ describe PostReceive do
described_class.new.perform(gl_repository, key_id, base64_changes)
end
it 'does not call Geo::RepositoryUpdatedEventStore when not running on a Geo primary node' do
it 'does not call Geo::RepositoryUpdatedService when not running on a Geo primary node' do
allow(Gitlab::Geo).to receive(:primary?) { false }
expect_any_instance_of(::Geo::RepositoryUpdatedService).not_to receive(:execute)
......@@ -47,7 +47,7 @@ describe PostReceive do
describe '#process_wiki_changes' do
let(:gl_repository) { "wiki-#{project.id}" }
it 'calls Geo::RepositoryUpdatedEventStore when running on a Geo primary node' do
it 'calls Geo::RepositoryUpdatedService when running on a Geo primary node' do
allow(Gitlab::Geo).to receive(:primary?) { true }
expect_any_instance_of(::Geo::RepositoryUpdatedService).to receive(:execute)
......@@ -55,7 +55,7 @@ describe PostReceive do
described_class.new.perform(gl_repository, key_id, base64_changes)
end
it 'does not call Geo::RepositoryUpdatedEventStore when not running on a Geo primary node' do
it 'does not call Geo::RepositoryUpdatedService when not running on a Geo primary node' do
allow(Gitlab::Geo).to receive(:primary?) { false }
expect_any_instance_of(::Geo::RepositoryUpdatedService).not_to receive(:execute)
......
......@@ -238,6 +238,7 @@ module QA
module Settings
autoload :RepositoryStorage, 'qa/page/admin/settings/repository_storage'
autoload :Main, 'qa/page/admin/settings/main'
autoload :Repository, 'qa/page/admin/settings/repository'
end
end
......
......@@ -8,8 +8,9 @@ module QA
Page::Main::Login.act { sign_in_using_credentials }
Page::Menu::Main.act { go_to_admin_area }
Page::Menu::Admin.act { go_to_settings }
Page::Menu::Side.act { click_repository }
Page::Admin::Settings::Main.perform do |setting|
Page::Admin::Settings::Repository.perform do |setting|
setting.expand_repository_storage do |page|
page.enable_hashed_storage
page.save_settings
......
......@@ -6,13 +6,6 @@ module QA
include QA::Page::Settings::Common
view 'app/views/admin/application_settings/show.html.haml' do
element :terms_settings
end
def expand_repository_storage(&block)
expand_section(:terms_settings) do
RepositoryStorage.perform(&block)
end
end
end
end
......
# frozen_string_literal: true
module QA
module Page
module Admin
module Settings
class Repository < Page::Base
include QA::Page::Settings::Common
view 'app/views/admin/application_settings/repository.html.haml' do
element :repository_storage
end
def expand_repository_storage(&block)
expand_section(:repository_storage) do
RepositoryStorage.perform(&block)
end
end
end
end
end
end
end
......@@ -84,6 +84,12 @@ module QA
end
end
def click_repository
within_sidebar do
click_link('Repository')
end
end
private
def hover_settings
......
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