Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-08-04 09:09:21 +00:00
parent debd8f45f8
commit f797f00ec7
22 changed files with 92 additions and 49 deletions

View File

@ -1 +1 @@
v16.3.0-rc5
v16.3.0-rc6

View File

@ -256,6 +256,10 @@
gl-emoji {
margin-top: -1px;
margin-bottom: -1px;
img {
top: 0;
}
}
}

View File

@ -3,10 +3,14 @@ gl-emoji {
display: inline-flex;
vertical-align: baseline;
font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
font-size: 1.2em;
line-height: 1;
img {
width: 1.2em;
height: 1.2em;
position: relative;
top: 0.25em;
}
}

View File

@ -22,7 +22,7 @@
= @gpg_keys.count
.gl-new-card-actions
= render Pajamas::ButtonComponent.new(size: :small, button_options: { class: "js-toggle-button js-toggle-content #{hide_class}" }) do
= _('Add a GPG key')
= _('Add new key')
- c.with_body do
.gl-new-card-add-form.gl-m-3.js-toggle-content{ class: add_form_class }
%h4.gl-mt-0

View File

@ -53,6 +53,7 @@ module ActiveRecord
def recursive(*args)
@scope.with_values += args
@scope.recursive_value = true
@scope.extend(Gitlab::Database::ReadOnlyRelation)
@scope
end
end

View File

@ -42,11 +42,7 @@ Prerequisite:
gitlab_rails['ci_secure_files_enabled'] = false
```
1. Save the file and reconfigure GitLab:
```shell
sudo gitlab-ctl reconfigure
```
1. Save the file and [reconfigure GitLab](restart_gitlab.md#reconfigure-a-linux-package-installation).
**For self-compiled installations**
@ -73,12 +69,7 @@ are stored locally, follow the steps below.
gitlab_rails['ci_secure_files_storage_path'] = "/mnt/storage/ci_secure_files"
```
1. Save the file and [reconfigure GitLab](restart_gitlab.md#reconfigure-a-linux-package-installation)
1. Save the file and reconfigure GitLab:
```shell
sudo gitlab-ctl reconfigure
```
1. Save the file and [reconfigure GitLab](restart_gitlab.md#reconfigure-a-linux-package-installation).
**For self-compiled installations**
@ -149,14 +140,8 @@ See [the available connection settings for different providers](object_storage.m
}
```
1. Save the file and [reconfigure GitLab](restart_gitlab.md#reconfigure-a-linux-package-installation)
1. Save the file and reconfigure GitLab:
```shell
sudo gitlab-ctl reconfigure
```
1. [Migrate any existing local states to the object storage](#migrate-to-object-storage)
1. Save the file and [reconfigure GitLab](restart_gitlab.md#reconfigure-a-linux-package-installation).
1. [Migrate any existing local states to the object storage](#migrate-to-object-storage).
**For self-compiled installations**
@ -176,7 +161,7 @@ See [the available connection settings for different providers](object_storage.m
```
1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) for the changes to take effect.
1. [Migrate any existing local states to the object storage](#migrate-to-object-storage)
1. [Migrate any existing local states to the object storage](#migrate-to-object-storage).
### Migrate to object storage

View File

@ -67,7 +67,7 @@ To use merge request pipelines:
## Use `rules` to add jobs
You can use the [`rules`](../yaml/index.md#rules) keyword to configure jobs to run in
Use the [`rules`](../yaml/index.md#rules) keyword to configure jobs to run in
merge request pipelines. For example:
```yaml
@ -97,8 +97,9 @@ job2:
## Use `only` to add jobs
You can use the [`only`](../yaml/index.md#onlyrefs--exceptrefs) keyword with `merge_requests`
to configure jobs to run in merge request pipelines.
[`rules`](#use-rules-to-add-jobs) is the preferred method, but you can also use
the [`only`](../yaml/index.md#onlyrefs--exceptrefs) keyword with `merge_requests`
to configure jobs to run in merge request pipelines. For example:
```yaml
job1:

View File

@ -10,6 +10,8 @@ With the [GitLab for Jira Cloud](https://marketplace.atlassian.com/apps/1221011/
You can use the GitLab for Jira Cloud app to link top-level groups or subgroups. It's not possible to directly link projects or personal namespaces.
To set up the GitLab for Jira Cloud app:
- **For GitLab.com**:
- [Install the GitLab for Jira Cloud app](#install-the-gitlab-for-jira-cloud-app).
- **For self-managed GitLab**, do one of the following:
@ -18,6 +20,21 @@ You can use the GitLab for Jira Cloud app to link top-level groups or subgroups.
If you use Jira Data Center or Jira Server, use the [Jira DVCS connector](dvcs/index.md) developed and maintained by Atlassian.
## GitLab data synced to Jira
After you link a group, the following GitLab data is synced to Jira for all projects in that group when you [mention a Jira issue ID](development_panel.md#information-displayed-in-the-development-panel):
- Existing project data (before you linked the group):
- The last 400 merge requests
- The last 400 branches and the last commit to each of those branches (GitLab 15.11 and later)
- New project data (after you linked the group):
- Merge requests
- Branches
- Commits
- Builds
- Deployments
- Feature flags
## Install the GitLab for Jira Cloud app **(FREE SAAS)**
Prerequisites:
@ -64,12 +81,6 @@ After you link to a GitLab group, data is synced to Jira for all projects in tha
The initial data sync happens in batches of 20 projects per minute.
For groups with many projects, the data sync for some projects is delayed.
The following data is synced:
- New and existing merge requests.
- New branches and commits.
- Existing branches and commits (GitLab 15.11 and later). You must delete and add any namespaces that were added to the GitLab for Jira Cloud app in GitLab 15.10 and earlier.
## Update the GitLab for Jira Cloud app
Most updates to the app are automatic. For more information, see the

View File

@ -25,7 +25,7 @@ This table shows the features available with the Jira DVCS connector and the Git
| Sync merge requests | **{check-circle}** Yes | **{check-circle}** Yes |
| Sync branches | **{check-circle}** Yes | **{check-circle}** Yes |
| Sync commits | **{check-circle}** Yes | **{check-circle}** Yes |
| Sync existing data | **{check-circle}** Yes | **{check-circle}** Yes |
| Sync existing data | **{check-circle}** Yes | **{check-circle}** Yes (partial) <sup>1</sup>|
| Sync builds | **{dotted-circle}** No | **{check-circle}** Yes |
| Sync deployments | **{dotted-circle}** No | **{check-circle}** Yes |
| Sync feature flags | **{dotted-circle}** No | **{check-circle}** Yes |
@ -34,6 +34,8 @@ This table shows the features available with the Jira DVCS connector and the Git
| Create merge request from branch | **{check-circle}** Yes | **{check-circle}** Yes |
| Create branch from Jira issue | **{dotted-circle}** No | **{check-circle}** Yes ([introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66032) in GitLab 14.2) |
1. See [GitLab data synced to Jira](connect-app.md#gitlab-data-synced-to-jira).
## Connected projects in GitLab
The Jira development panel connects a Jira instance with all its projects to the following:

View File

@ -38,6 +38,7 @@ To create a new application for your user:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **Applications**.
1. Select **Add new application**.
1. Enter a **Name** and **Redirect URI**.
1. Select OAuth 2 **Scopes** as defined in [Authorized Applications](#view-all-authorized-applications).
1. In the **Redirect URI**, enter the URL where users are sent after they authorize with GitLab.

View File

@ -28,6 +28,7 @@ Set up runners to run jobs in a pipeline.
| Topic | Description | Good for beginners |
|-------|-------------|--------------------|
| [Create, register, and run your own project runner](create_register_first_runner/index.md) | Learn the basics of how to create and register a project runner that runs jobs for your project. | **{star}** |
| [Configure GitLab Runner to use the Google Kubernetes Engine](configure_gitlab_runner_to_use_gke/index.md) | Learn how to configure GitLab Runner to use the GKE to run jobs. | |
## Publish a static website

View File

@ -41,6 +41,7 @@ To create a comment template for future use:
1. On the left sidebar, select your avatar.
1. From the dropdown list, select **Preferences**.
1. On the left sidebar, select **Comment templates** (**{comment-lines}**).
1. Select **Add new**.
1. Provide a **Name** for your comment template.
1. Enter the **Content** of your reply. You can use any formatting you use in
other GitLab text areas.

View File

@ -57,6 +57,7 @@ To add new email to your account:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **Emails**.
1. Select **Add new email**.
1. In the **Email** text box, enter the new email.
1. Select **Add email address**.
1. Verify your email address with the verification email received.

View File

@ -51,6 +51,7 @@ You can create as many personal access tokens as you like.
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **Access Tokens**.
1. Select **Add new token**.
1. Enter a name and expiry date for the token.
- The token expires on that date at midnight UTC.
- If you do not enter an expiry date, the expiry date is automatically set to 365 days later than the current date.

View File

@ -122,6 +122,7 @@ To add a GPG key to your user settings:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. Select **GPG Keys** (**{key}**).
1. Select **Add new key**.
1. In **Key**, paste your _public_ key.
1. To add the key to your account, select **Add key**. GitLab shows the key's
fingerprint, email address, and creation date:

View File

@ -325,6 +325,7 @@ To use SSH with GitLab, copy your public key to your GitLab account:
1. On the left sidebar, select your avatar.
1. Select **Edit profile**.
1. On the left sidebar, select **SSH Keys**.
1. Select **Add new key**.
1. In the **Key** box, paste the contents of your public key.
If you manually copied the key, make sure you copy the entire key,
which starts with `ssh-rsa`, `ssh-dss`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`,

View File

@ -16,12 +16,12 @@ module Gitlab
object_kind: object_kind,
event_type: event_type,
user: user.hook_attrs,
project: issuable.project.hook_attrs,
project: issuable.project&.hook_attrs,
object_attributes: issuable_builder.new(issuable).build,
labels: issuable.labels_hook_attrs,
changes: final_changes(changes.slice(*safe_keys)),
# DEPRECATED
repository: issuable.project.hook_attrs.slice(:name, :url, :description, :homepage)
repository: issuable.project&.hook_attrs&.slice(:name, :url, :description, :homepage)
}
hook_data[:assignees] = issuable.assignees.map(&:hook_attrs) if issuable.assignees.any?

View File

@ -12,10 +12,6 @@ module Gitlab
end
def git_diff_prefix
/\A@@( -\d+,\d+ \+\d+,\d+ )@@/
end
def generate_commit_message_git_diff_prefix
/\A@@( -\d+,\d+ \+\d+(,\d+)? )@@/
end
end

View File

@ -12203,6 +12203,9 @@ msgstr ""
msgid "ComplianceReport|Update result"
msgstr ""
msgid "ComplianceStandardsAdherence|At least two approvals"
msgstr ""
msgid "ComplianceStandardsAdherence|Have a valid rule that prevents author approved merge requests"
msgstr ""
@ -12218,9 +12221,6 @@ msgstr ""
msgid "ComplianceStandardsAdherence|Prevent committers as approvers"
msgstr ""
msgid "ComplianceStandardsAdherence|Two approvals"
msgstr ""
msgid "ComplianceStandardsAdherence|View details"
msgstr ""

View File

@ -15,7 +15,7 @@ RSpec.describe 'Profile > GPG Keys', feature_category: :user_profile do
end
it 'saves the new key' do
click_button('Add a GPG key')
click_button('Add new key')
fill_in('Key', with: GpgHelpers::User2.public_key)
click_button('Add key')
@ -25,7 +25,7 @@ RSpec.describe 'Profile > GPG Keys', feature_category: :user_profile do
end
it 'with multiple subkeys' do
click_button('Add a GPG key')
click_button('Add new key')
fill_in('Key', with: GpgHelpers::User3.public_key)
click_button('Add key')

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'ActiveRecord::Relation patch for PostgreSQL WITH statements', feature_category: :database do
describe 'ActiveRecord::Relation::WithChain#recursive' do
subject(:relation) { User.with.recursive }
it 'sets recursive value flag on the relation' do
expect(relation.recursive_value).to eq(true)
end
it 'raises an error when #update_all is called' do
expect { relation.update_all(attribute: 42) }.to raise_exception(ActiveRecord::ReadOnlyRecord)
end
end
end

View File

@ -4,6 +4,8 @@ require 'spec_helper'
RSpec.describe Gitlab::DataBuilder::Issuable do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
let_it_be(:reusable_project) { create(:project, :repository, group: group) }
# This shared example requires a `builder` and `user` variable
shared_examples 'issuable hook data' do |kind, hook_data_issuable_builder_class|
@ -96,17 +98,17 @@ RSpec.describe Gitlab::DataBuilder::Issuable do
describe '#build' do
it_behaves_like 'issuable hook data', 'issue', Gitlab::HookData::IssueBuilder do
let(:issuable) { create(:issue, description: 'A description') }
let_it_be(:issuable) { create(:issue, description: 'A description', project: reusable_project) }
let(:builder) { described_class.new(issuable) }
end
it_behaves_like 'issuable hook data', 'merge_request', Gitlab::HookData::MergeRequestBuilder do
let(:issuable) { create(:merge_request, description: 'A description') }
let_it_be(:issuable) { create(:merge_request, description: 'A description', source_project: reusable_project) }
let(:builder) { described_class.new(issuable) }
end
context 'issue is assigned' do
let(:issue) { create(:issue, assignees: [user]) }
let(:issue) { create(:issue, assignees: [user], project: reusable_project) }
let(:data) { described_class.new(issue).build(user: user) }
it 'returns correct hook data' do
@ -117,8 +119,21 @@ RSpec.describe Gitlab::DataBuilder::Issuable do
end
end
context 'when issuable is a group level work item' do
let(:work_item) { create(:work_item, namespace: group, description: 'work item description') }
it 'returns correct hook data', :aggregate_failures do
data = described_class.new(work_item).build(user: user)
expect(data[:object_kind]).to eq('work_item')
expect(data[:event_type]).to eq('work_item')
expect(data.dig(:object_attributes, :id)).to eq(work_item.id)
expect(data.dig(:object_attributes, :iid)).to eq(work_item.iid)
end
end
context 'merge_request is assigned' do
let(:merge_request) { create(:merge_request, assignees: [user]) }
let(:merge_request) { create(:merge_request, assignees: [user], source_project: reusable_project) }
let(:data) { described_class.new(merge_request).build(user: user) }
it 'returns correct hook data' do
@ -129,7 +144,7 @@ RSpec.describe Gitlab::DataBuilder::Issuable do
end
context 'merge_request is assigned reviewers' do
let(:merge_request) { create(:merge_request, reviewers: [user]) }
let(:merge_request) { create(:merge_request, reviewers: [user], source_project: reusable_project) }
let(:data) { described_class.new(merge_request).build(user: user) }
it 'returns correct hook data' do
@ -139,7 +154,7 @@ RSpec.describe Gitlab::DataBuilder::Issuable do
end
context 'when merge_request does not have reviewers and assignees' do
let(:merge_request) { create(:merge_request) }
let(:merge_request) { create(:merge_request, source_project: reusable_project) }
let(:data) { described_class.new(merge_request).build(user: user) }
it 'returns correct hook data' do