提交 f321e51f 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/gitlab@master

上级 612a849a
......@@ -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 | |
......
......@@ -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.
......
......@@ -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.
......
......@@ -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!
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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')
......
......@@ -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
......
......@@ -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')
......
......@@ -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'
......
......@@ -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
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册