diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 06:07:59 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 06:07:59 +0000 |
commit | f321e51f46bcb628c3e96a44b5ebf3bb1c4033ab (patch) | |
tree | 41a470ff35cd211b308b1b4900935a225f103f32 | |
parent | 612a849a6cba1765bc41d30d4e931195dcdf64cf (diff) | |
download | gitlab-ce-f321e51f46bcb628c3e96a44b5ebf3bb1c4033ab.tar.gz |
Add latest changes from gitlab-org/gitlab@master
15 files changed, 63 insertions, 34 deletions
diff --git a/doc/administration/high_availability/README.md b/doc/administration/high_availability/README.md index ea7ffb7aa51..8f39c6b3c06 100644 --- a/doc/administration/high_availability/README.md +++ b/doc/administration/high_availability/README.md @@ -37,7 +37,7 @@ in which you would typically configure them. | [Load Balancer(s)](load_balancer.md)[^6] | Handles load balancing for the GitLab nodes where required. | [Load balancer HA configuration](load_balancer.md) | | [Consul](../../development/architecture.md#consul)[^3] | Service discovery and health checks/failover | [Consul HA configuration](consul.md) | | [PostgreSQL](../../development/architecture.md#postgresql) | Database | [Database HA configuration](database.md) | -| [PgBouncer](../../development/architecture.md#pgbouncer) | Database Pool Manager | [PgBouncer HA configuration](pgbouncer.md) | +| [PgBouncer](../../development/architecture.md#pgbouncer) | Database Pool Manager | [PgBouncer HA configuration](pgbouncer.md) **(PREMIUM ONLY)** | | [Redis](../../development/architecture.md#redis)[^3] with Redis Sentinel | Key/Value store for shared data with HA watcher service | [Redis HA configuration](redis.md) | | [Gitaly](../../development/architecture.md#gitaly)[^2] [^5] [^7] | Recommended high-level storage for Git repository data. | [Gitaly HA configuration](gitaly.md) | | [Sidekiq](../../development/architecture.md#sidekiq) | Asynchronous/Background jobs | | diff --git a/doc/administration/high_availability/pgbouncer.md b/doc/administration/high_availability/pgbouncer.md index cea55e6c9b4..c820a01da8a 100644 --- a/doc/administration/high_availability/pgbouncer.md +++ b/doc/administration/high_availability/pgbouncer.md @@ -2,7 +2,7 @@ type: reference --- -# Working with the bundle PgBouncer service +# Working with the bundled PgBouncer service **(PREMIUM ONLY)** As part of its High Availability stack, GitLab Premium includes a bundled version of [PgBouncer](https://pgbouncer.github.io/) that can be managed through `/etc/gitlab/gitlab.rb`. PgBouncer is used to seamlessly migrate database connections between servers in a failover scenario. Additionally, it can be used in a non-HA setup to pool connections, speeding up response time while reducing resource usage. diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 7fbaf5ca0b8..edb311e8e80 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -605,6 +605,24 @@ With `only`, individual keys are logically joined by an AND: > (any of refs) AND (any of variables) AND (any of changes) AND (if Kubernetes is active) +In the example below, the `test` job will `only` be created when **all** of the following are true: + +- The pipeline has been [scheduled](../../user/project/pipelines/schedules.md) **or** runs for `master`. +- The `variables` keyword matches. +- The `kubernetes` service is active on the project. + +```yaml +test: + script: npm run test + only: + refs: + - master + - schedules + variables: + - $CI_COMMIT_MESSAGE =~ /run-end-to-end-tests/ + kubernetes: active +``` + `except` is implemented as a negation of this complete expression: > NOT((any of refs) AND (any of variables) AND (any of changes) AND (if Kubernetes is active)) @@ -613,6 +631,21 @@ This means the keys are treated as if joined by an OR. This relationship could b > (any of refs) OR (any of variables) OR (any of changes) OR (if Kubernetes is active) +In the example below, the `test` job will **not** be created when **any** of the following are true: + +- The pipeline runs for the `master`. +- There are changes to the `README.md` file in the root directory of the repo. + +```yaml +test: + script: npm run test + except: + refs: + - master + changes: + - "README.md" +``` + #### `only:refs`/`except:refs` > `refs` policy introduced in GitLab 10.0. diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb index 6ebe3e0b620..1c78deae2bf 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb @@ -6,7 +6,7 @@ module QA it 'user rebases source branch of merge request' do Flow::Login.sign_in - project = Resource::Project.fabricate! do |project| + project = Resource::Project.fabricate_via_api! do |project| project.name = "only-fast-forward" end project.visit! diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb index 89f0fc37f3f..9236609934e 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb @@ -6,7 +6,7 @@ module QA it 'user squashes commits while merging' do Flow::Login.sign_in - project = Resource::Project.fabricate! do |project| + project = Resource::Project.fabricate_via_api! do |project| project.name = "squash-before-merge" end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb index 7b1c2a71158..bf5a9501cba 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb @@ -18,7 +18,7 @@ module QA before do Flow::Login.sign_in - project = Resource::Project.fabricate! do |proj| + project = Resource::Project.fabricate_via_api! do |proj| proj.name = 'project-qa-test' proj.description = 'project for qa test' end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb index ff0f212c289..ee5114a04af 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_http_spec.rb @@ -8,7 +8,7 @@ module QA Flow::Login.sign_in # Create a project to push to - project = Resource::Project.fabricate! do |project| + project = Resource::Project.fabricate_via_api! do |project| project.name = 'git-protocol-project' end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb index 0e8b8203c34..a9e9380cac4 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb @@ -34,7 +34,7 @@ module QA it 'user pushes to the repository' do # Create a project to push to - project = Resource::Project.fabricate! do |project| + project = Resource::Project.fabricate_via_api! do |project| project.name = 'git-protocol-project' end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_over_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_over_http_spec.rb index 059362704b4..ae95f5a7a44 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_over_http_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_over_http_spec.rb @@ -7,7 +7,7 @@ module QA Runtime::Browser.visit(:gitlab, Page::Main::Login) Page::Main::Login.perform(&:sign_in_using_credentials) - target_project = Resource::Project.fabricate! do |project| + target_project = Resource::Project.fabricate_via_api! do |project| project.name = 'push-mirror-target-project' end target_project_uri = target_project.repository_http_location.uri diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb index 2bd54d763a6..9db5fe5292f 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb @@ -6,12 +6,11 @@ module QA it 'user pushes code to the repository' do Flow::Login.sign_in - project_push = Resource::Repository::ProjectPush.fabricate! do |push| + Resource::Repository::ProjectPush.fabricate! do |push| push.file_name = 'README.md' push.file_content = '# This is a test project' push.commit_message = 'Add README.md' - end - project_push.project.visit! + end.project.visit! expect(page).to have_content('README.md') expect(page).to have_content('This is a test project') diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb index 5d0f4b215f4..455db4d811d 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb @@ -6,7 +6,7 @@ module QA let(:branch_name) { 'protected-branch' } let(:commit_message) { 'Protected push commit message' } let(:project) do - Resource::Project.fabricate! do |resource| + Resource::Project.fabricate_via_api! do |resource| resource.name = 'protected-branch-project' resource.initialize_with_readme = true end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb index 1837a110d79..ab60ee33c1e 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb @@ -15,14 +15,12 @@ module QA resource.title = key_title end - project_push = Resource::Repository::ProjectPush.fabricate! do |push| + Resource::Repository::ProjectPush.fabricate! do |push| push.ssh_key = key push.file_name = 'README.md' push.file_content = '# Test Use SSH Key' push.commit_message = 'Add README.md' - end - - project_push.project.visit! + end.project.visit! expect(page).to have_content('README.md') expect(page).to have_content('Test Use SSH Key') diff --git a/qa/qa/specs/features/browser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.rb b/qa/qa/specs/features/browser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.rb index 42aa527da85..185d10a64ed 100644 --- a/qa/qa/specs/features/browser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.rb @@ -6,7 +6,7 @@ module QA it 'user creates, edits, clones, and pushes to the wiki' do Flow::Login.sign_in - wiki = Resource::Wiki.fabricate! do |resource| + wiki = Resource::Wiki.fabricate_via_browser_ui! do |resource| resource.title = 'Home' resource.content = '# My First Wiki Content' resource.message = 'Update home' diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 120bfc6d0ca..d2680606738 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -394,7 +394,7 @@ describe NotificationService, :mailer do end end - context 'confidential issue note', :deliver_mails_inline do + context 'confidential issue note' do let(:project) { create(:project, :public) } let(:author) { create(:user) } let(:assignee) { create(:user) } @@ -406,23 +406,22 @@ describe NotificationService, :mailer do let(:note) { create(:note_on_issue, noteable: confidential_issue, project: project, note: "#{author.to_reference} #{assignee.to_reference} #{non_member.to_reference} #{member.to_reference} #{admin.to_reference}") } let(:guest_watcher) { create_user_with_notification(:watch, "guest-watcher-confidential") } - it 'filters out users that can not read the issue' do + subject { notification.new_note(note) } + + before do project.add_developer(member) project.add_guest(guest) - - expect(SentNotification).to receive(:record).with(confidential_issue, any_args).exactly(4).times - reset_delivered_emails! + end - notification.new_note(note) + it 'filters out users that can not read the issue' do + subject - should_not_email(non_member) - should_not_email(guest) - should_not_email(guest_watcher) - should_email(author) - should_email(assignee) - should_email(member) - should_email(admin) + expect_delivery_jobs_count(4) + expect_enqueud_email(author.id, note.id, "mentioned", mail: "note_issue_email") + expect_enqueud_email(assignee.id, note.id, "mentioned", mail: "note_issue_email") + expect_enqueud_email(member.id, note.id, "mentioned", mail: "note_issue_email") + expect_enqueud_email(admin.id, note.id, "mentioned", mail: "note_issue_email") end context 'on project that belongs to subgroup' do @@ -442,10 +441,10 @@ describe NotificationService, :mailer do end it 'does not email guest user' do - notification.new_note(note) + subject - should_email(group_reporter) - should_not_email(group_guest) + expect_enqueud_email(group_reporter.id, note.id, nil, mail: "note_issue_email") + expect_not_enqueud_email(group_guest.id, "mentioned", mail: "note_issue_email") end end end diff --git a/spec/support/helpers/notification_helpers.rb b/spec/support/helpers/notification_helpers.rb index aee76b8be4a..b3e0e7d811b 100644 --- a/spec/support/helpers/notification_helpers.rb +++ b/spec/support/helpers/notification_helpers.rb @@ -57,7 +57,7 @@ module NotificationHelpers expect(ActionMailer::DeliveryJob).to have_been_enqueued.with(mailer, mail, delivery, *args) end - def expect_not_enqueud_email(*args, mailer: "Notify", mail: "", delivery: "deliver_now") + def expect_not_enqueud_email(*args, mailer: "Notify", mail: "") expect(ActionMailer::DeliveryJob).not_to have_been_enqueued.with(mailer, mail, *args, any_args) end end |