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