Commit f321e51f authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 612a849a
...@@ -37,7 +37,7 @@ in which you would typically configure them. ...@@ -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) | | [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) | | [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) | | [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) | | [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) | | [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 | | | [Sidekiq](../../development/architecture.md#sidekiq) | Asynchronous/Background jobs | |
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
type: reference 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. 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.
......
...@@ -605,6 +605,24 @@ With `only`, individual keys are logically joined by an AND: ...@@ -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) > (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: `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)) > 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 ...@@ -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) > (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` #### `only:refs`/`except:refs`
> `refs` policy introduced in GitLab 10.0. > `refs` policy introduced in GitLab 10.0.
......
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
it 'user rebases source branch of merge request' do it 'user rebases source branch of merge request' do
Flow::Login.sign_in Flow::Login.sign_in
project = Resource::Project.fabricate! do |project| project = Resource::Project.fabricate_via_api! do |project|
project.name = "only-fast-forward" project.name = "only-fast-forward"
end end
project.visit! project.visit!
......
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
it 'user squashes commits while merging' do it 'user squashes commits while merging' do
Flow::Login.sign_in Flow::Login.sign_in
project = Resource::Project.fabricate! do |project| project = Resource::Project.fabricate_via_api! do |project|
project.name = "squash-before-merge" project.name = "squash-before-merge"
end end
......
...@@ -18,7 +18,7 @@ module QA ...@@ -18,7 +18,7 @@ module QA
before do before do
Flow::Login.sign_in Flow::Login.sign_in
project = Resource::Project.fabricate! do |proj| project = Resource::Project.fabricate_via_api! do |proj|
proj.name = 'project-qa-test' proj.name = 'project-qa-test'
proj.description = 'project for qa test' proj.description = 'project for qa test'
end end
......
...@@ -8,7 +8,7 @@ module QA ...@@ -8,7 +8,7 @@ module QA
Flow::Login.sign_in Flow::Login.sign_in
# Create a project to push to # 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' project.name = 'git-protocol-project'
end end
......
...@@ -34,7 +34,7 @@ module QA ...@@ -34,7 +34,7 @@ module QA
it 'user pushes to the repository' do it 'user pushes to the repository' do
# Create a project to push to # 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' project.name = 'git-protocol-project'
end end
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) 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' project.name = 'push-mirror-target-project'
end end
target_project_uri = target_project.repository_http_location.uri target_project_uri = target_project.repository_http_location.uri
......
...@@ -6,12 +6,11 @@ module QA ...@@ -6,12 +6,11 @@ module QA
it 'user pushes code to the repository' do it 'user pushes code to the repository' do
Flow::Login.sign_in 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_name = 'README.md'
push.file_content = '# This is a test project' push.file_content = '# This is a test project'
push.commit_message = 'Add README.md' push.commit_message = 'Add README.md'
end end.project.visit!
project_push.project.visit!
expect(page).to have_content('README.md') expect(page).to have_content('README.md')
expect(page).to have_content('This is a test project') expect(page).to have_content('This is a test project')
......
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
let(:branch_name) { 'protected-branch' } let(:branch_name) { 'protected-branch' }
let(:commit_message) { 'Protected push commit message' } let(:commit_message) { 'Protected push commit message' }
let(:project) do let(:project) do
Resource::Project.fabricate! do |resource| Resource::Project.fabricate_via_api! do |resource|
resource.name = 'protected-branch-project' resource.name = 'protected-branch-project'
resource.initialize_with_readme = true resource.initialize_with_readme = true
end end
......
...@@ -15,14 +15,12 @@ module QA ...@@ -15,14 +15,12 @@ module QA
resource.title = key_title resource.title = key_title
end end
project_push = Resource::Repository::ProjectPush.fabricate! do |push| Resource::Repository::ProjectPush.fabricate! do |push|
push.ssh_key = key push.ssh_key = key
push.file_name = 'README.md' push.file_name = 'README.md'
push.file_content = '# Test Use SSH Key' push.file_content = '# Test Use SSH Key'
push.commit_message = 'Add README.md' push.commit_message = 'Add README.md'
end end.project.visit!
project_push.project.visit!
expect(page).to have_content('README.md') expect(page).to have_content('README.md')
expect(page).to have_content('Test Use SSH Key') expect(page).to have_content('Test Use SSH Key')
......
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
it 'user creates, edits, clones, and pushes to the wiki' do it 'user creates, edits, clones, and pushes to the wiki' do
Flow::Login.sign_in Flow::Login.sign_in
wiki = Resource::Wiki.fabricate! do |resource| wiki = Resource::Wiki.fabricate_via_browser_ui! do |resource|
resource.title = 'Home' resource.title = 'Home'
resource.content = '# My First Wiki Content' resource.content = '# My First Wiki Content'
resource.message = 'Update home' resource.message = 'Update home'
......
...@@ -394,7 +394,7 @@ describe NotificationService, :mailer do ...@@ -394,7 +394,7 @@ describe NotificationService, :mailer do
end end
end end
context 'confidential issue note', :deliver_mails_inline do context 'confidential issue note' do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:assignee) { create(:user) } let(:assignee) { create(:user) }
...@@ -406,23 +406,22 @@ describe NotificationService, :mailer do ...@@ -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(: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") } 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_developer(member)
project.add_guest(guest) project.add_guest(guest)
expect(SentNotification).to receive(:record).with(confidential_issue, any_args).exactly(4).times
reset_delivered_emails! 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) expect_delivery_jobs_count(4)
should_not_email(guest) expect_enqueud_email(author.id, note.id, "mentioned", mail: "note_issue_email")
should_not_email(guest_watcher) expect_enqueud_email(assignee.id, note.id, "mentioned", mail: "note_issue_email")
should_email(author) expect_enqueud_email(member.id, note.id, "mentioned", mail: "note_issue_email")
should_email(assignee) expect_enqueud_email(admin.id, note.id, "mentioned", mail: "note_issue_email")
should_email(member)
should_email(admin)
end end
context 'on project that belongs to subgroup' do context 'on project that belongs to subgroup' do
...@@ -442,10 +441,10 @@ describe NotificationService, :mailer do ...@@ -442,10 +441,10 @@ describe NotificationService, :mailer do
end end
it 'does not email guest user' do it 'does not email guest user' do
notification.new_note(note) subject
should_email(group_reporter) expect_enqueud_email(group_reporter.id, note.id, nil, mail: "note_issue_email")
should_not_email(group_guest) expect_not_enqueud_email(group_guest.id, "mentioned", mail: "note_issue_email")
end end
end end
end end
......
...@@ -57,7 +57,7 @@ module NotificationHelpers ...@@ -57,7 +57,7 @@ module NotificationHelpers
expect(ActionMailer::DeliveryJob).to have_been_enqueued.with(mailer, mail, delivery, *args) expect(ActionMailer::DeliveryJob).to have_been_enqueued.with(mailer, mail, delivery, *args)
end 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) expect(ActionMailer::DeliveryJob).not_to have_been_enqueued.with(mailer, mail, *args, any_args)
end end
end end
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