Skip to content

Commit 127e6d9

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 14cb5b3 commit 127e6d9

File tree

63 files changed

+726
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+726
-180
lines changed

.rubocop_manual_todo.yml

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ FactoryBot/InlineAssociation:
1616
- 'spec/factories/import_export_uploads.rb'
1717
- 'spec/factories/merge_requests.rb'
1818
- 'spec/factories/notes.rb'
19-
- 'spec/factories/packages.rb'
20-
- 'spec/factories/packages/package_file.rb'
2119
- 'spec/factories/sent_notifications.rb'
2220
- 'spec/factories/uploads.rb'
2321
- 'spec/factories/wiki_pages.rb'

GITALY_SERVER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
194a9f58926793ade53152de90b474d66804e21e
1+
506c44cc07dcb804ce970ec1c02bb6e0d52320d8

app/assets/javascripts/vue_shared/components/dropdown/dropdown_button.vue

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<script>
2-
import { GlLoadingIcon } from '@gitlab/ui';
2+
import { GlLoadingIcon, GlIcon } from '@gitlab/ui';
33
import { __ } from '~/locale';
44
55
export default {
66
components: {
77
GlLoadingIcon,
8+
GlIcon,
89
},
910
props: {
1011
isDisabled: {
@@ -39,8 +40,10 @@ export default {
3940
<slot v-if="$slots.default"></slot>
4041
<span v-else class="dropdown-toggle-text"> {{ toggleText }} </span>
4142
</template>
42-
<span v-show="!isLoading" class="dropdown-toggle-icon">
43-
<i class="fa fa-chevron-down" aria-hidden="true" data-hidden="true"></i>
44-
</span>
43+
<gl-icon
44+
v-show="!isLoading"
45+
class="gl-absolute gl-top-3 gl-right-3 gl-text-gray-500"
46+
name="chevron-down"
47+
/>
4548
</button>
4649
</template>

app/controllers/application_controller.rb

+6
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ def no_cache_headers
266266
end
267267
end
268268

269+
def stream_headers
270+
headers['Content-Length'] = nil
271+
headers['X-Accel-Buffering'] = 'no' # Disable buffering on Nginx
272+
headers['Last-Modified'] = '0' # Prevent buffering via Rack::ETag middleware
273+
end
274+
269275
def default_headers
270276
headers['X-Frame-Options'] = 'DENY'
271277
headers['X-XSS-Protection'] = '1; mode=block'

app/controllers/registrations_controller.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class RegistrationsController < Devise::RegistrationsController
44
include Recaptcha::Verify
55
include AcceptsPendingInvitations
6-
include RecaptchaExperimentHelper
6+
include RecaptchaHelper
77
include InvisibleCaptchaOnSignup
88

99
BLOCKED_PENDING_APPROVAL_STATE = 'blocked_pending_approval'.freeze
@@ -176,5 +176,3 @@ def set_invite_params
176176
@invite_email = ActionController::Base.helpers.sanitize(params[:invite_email])
177177
end
178178
end
179-
180-
RegistrationsController.prepend_if_ee('EE::RegistrationsController')

app/helpers/recaptcha_experiment_helper.rb

-9
This file was deleted.

app/helpers/recaptcha_helper.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
module RecaptchaHelper
4+
def show_recaptcha_sign_up?
5+
!!Gitlab::Recaptcha.enabled?
6+
end
7+
end

app/services/issues/reopen_service.rb

-8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ class ReopenService < Issues::BaseService
55
def execute(issue)
66
return issue unless can?(current_user, :reopen_issue, issue)
77

8-
before_reopen(issue)
9-
108
if issue.reopen
119
event_service.reopen_issue(issue, current_user)
1210
create_note(issue, 'reopened')
@@ -23,14 +21,8 @@ def execute(issue)
2321

2422
private
2523

26-
def before_reopen(issue)
27-
# Overriden in EE
28-
end
29-
3024
def create_note(issue, state = issue.state)
3125
SystemNoteService.change_status(issue, issue.project, current_user, state, nil)
3226
end
3327
end
3428
end
35-
36-
Issues::ReopenService.prepend_if_ee('EE::Issues::ReopenService')

app/services/jira_connect_subscriptions/create_service.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module JiraConnectSubscriptions
44
class CreateService < ::JiraConnectSubscriptions::BaseService
55
include Gitlab::Utils::StrongMemoize
66
MERGE_REQUEST_SYNC_BATCH_SIZE = 20
7-
MERGE_REQUEST_SYNC_BATCH_delay = 1.minute.freeze
7+
MERGE_REQUEST_SYNC_BATCH_DELAY = 1.minute.freeze
88

99
def execute
1010
unless namespace && can?(current_user, :create_jira_connect_subscription, namespace)
@@ -39,7 +39,7 @@ def schedule_sync_project_jobs
3939

4040
namespace.all_projects.each_batch(of: MERGE_REQUEST_SYNC_BATCH_SIZE) do |projects, index|
4141
JiraConnect::SyncProjectWorker.bulk_perform_in_with_contexts(
42-
index * MERGE_REQUEST_SYNC_BATCH_delay,
42+
index * MERGE_REQUEST_SYNC_BATCH_DELAY,
4343
projects,
4444
arguments_proc: -> (project) { [project.id, Atlassian::JiraConnect::Client.generate_update_sequence_id] },
4545
context_proc: -> (project) { { project: project } }

app/views/admin/application_settings/_eks.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.settings-header
44
%h4
55
= _('Amazon EKS')
6-
%button.btn.js-settings-toggle{ type: 'button' }
6+
%button.btn.gl-button.js-settings-toggle{ type: 'button' }
77
= expanded ? 'Collapse' : 'Expand'
88
%p
99
= _('Amazon EKS integration allows you to provision EKS clusters from GitLab.')

app/views/admin/application_settings/_gitpod.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.settings-header
66
%h4
77
= _('Gitpod')
8-
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
8+
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
99
= expanded ? _('Collapse') : _('Expand')
1010
%p
1111
%integration-help-text{ "id" => "js-gitpod-settings-help-text", "message" => gitpod_enable_description, "message-url" => "https://gitpod.io/" }

app/views/admin/application_settings/_plantuml.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.settings-header
44
%h4
55
= _('PlantUML')
6-
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
6+
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
77
= expanded ? _('Collapse') : _('Expand')
88
%p
99
= _('Allow rendering of PlantUML diagrams in Asciidoc documents.')

app/views/admin/application_settings/_snowplow.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.settings-header
44
%h4
55
= _('Snowplow')
6-
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
6+
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
77
= expanded ? _('Collapse') : _('Expand')
88
%p
99
= _('Configure the %{link} integration.').html_safe % { link: link_to('Snowplow', 'https://snowplowanalytics.com/', target: '_blank') }

app/views/admin/application_settings/_third_party_offers.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.settings-header
44
%h4
55
= _('Third party offers')
6-
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
6+
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
77
= expanded ? _('Collapse') : _('Expand')
88
%p
99
= _('Control the display of third party offers.')

app/views/admin/application_settings/general.html.haml

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.settings-header
77
%h4
88
= _('Visibility and access controls')
9-
%button.btn.js-settings-toggle{ type: 'button' }
9+
%button.btn.gl-button.js-settings-toggle{ type: 'button' }
1010
= expanded_by_default? ? _('Collapse') : _('Expand')
1111
%p
1212
= _('Set default and restrict visibility levels. Configure import sources and git access protocol.')
@@ -17,7 +17,7 @@
1717
.settings-header
1818
%h4
1919
= _('Account and limit')
20-
%button.btn.js-settings-toggle{ type: 'button' }
20+
%button.btn.gl-button.js-settings-toggle{ type: 'button' }
2121
= expanded_by_default? ? _('Collapse') : _('Expand')
2222
%p
2323
= _('Set projects and maximum size limits, session duration, user options, and check feature availability for namespace plan.')
@@ -28,7 +28,7 @@
2828
.settings-header
2929
%h4
3030
= _('Diff limits')
31-
%button.btn.js-settings-toggle{ type: 'button' }
31+
%button.btn.gl-button.js-settings-toggle{ type: 'button' }
3232
= expanded_by_default? ? _('Collapse') : _('Expand')
3333
%p
3434
= _('Diff content limits')
@@ -39,7 +39,7 @@
3939
.settings-header
4040
%h4
4141
= _('Sign-up restrictions')
42-
%button.btn.js-settings-toggle{ type: 'button' }
42+
%button.btn.gl-button.js-settings-toggle{ type: 'button' }
4343
= expanded_by_default? ? _('Collapse') : _('Expand')
4444
%p
4545
= _('Configure the way a user creates a new account.')
@@ -50,7 +50,7 @@
5050
.settings-header
5151
%h4
5252
= _('Sign-in restrictions')
53-
%button.btn.js-settings-toggle{ type: 'button' }
53+
%button.btn.gl-button.js-settings-toggle{ type: 'button' }
5454
= expanded_by_default? ? _('Collapse') : _('Expand')
5555
%p
5656
= _('Set requirements for a user to sign-in. Enable mandatory two-factor authentication.')
@@ -61,7 +61,7 @@
6161
.settings-header
6262
%h4
6363
= _('Terms of Service and Privacy Policy')
64-
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
64+
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
6565
= expanded_by_default? ? _('Collapse') : _('Expand')
6666
%p
6767
= _('Include a Terms of Service agreement and Privacy Policy that all users must accept.')
@@ -74,7 +74,7 @@
7474
.settings-header
7575
%h4
7676
= _('Web terminal')
77-
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
77+
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
7878
= expanded_by_default? ? _('Collapse') : _('Expand')
7979
%p
8080
= _('Set max session time for web terminal.')
@@ -85,7 +85,7 @@
8585
.settings-header
8686
%h4
8787
= _('Web IDE')
88-
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
88+
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
8989
= expanded_by_default? ? _('Collapse') : _('Expand')
9090
%p
9191
= _('Manage Web IDE features')
@@ -108,7 +108,7 @@
108108
.settings-header
109109
%h4
110110
= _('Maintenance mode')
111-
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
111+
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
112112
= expanded_by_default? ? _('Collapse') : _('Expand')
113113
%p
114114
= _('Prevent users from performing write operations on GitLab while performing maintenance.')

app/views/jira_connect/subscriptions/index.html.haml

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252

5353
%p.browser-limitations-notice
5454
%strong Browser limitations:
55-
Adding a namespace currently works only in browsers that allow cross site cookies. Please make sure to use
55+
Adding a namespace currently works only in browsers that allow crosssite cookies. Please make sure to use
5656
%a{ href: 'https://www.mozilla.org/en-US/firefox/', target: '_blank', rel: 'noopener noreferrer' } Firefox
5757
or
5858
%a{ href: 'https://www.google.com/chrome/index.html', target: '_blank', rel: 'noopener noreferrer' } Google Chrome
59-
or enable cross-site cookies in your browser when adding a namespace.
59+
or enable crosssite cookies in your browser when adding a namespace.
6060
%a{ href: 'https://gitlab.com/gitlab-org/gitlab/-/issues/263509', target: '_blank', rel: 'noopener noreferrer' } Learn more
6161

6262
= webpack_bundle_tag 'performance_bar' if performance_bar_enabled?
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Rename "cycle analytics" with "value stream analytics" under /spec
3+
merge_request: 46613
4+
author: Takuya Noguchi
5+
type: other
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Stop finding commit with empty ref
3+
merge_request: 47497
4+
author:
5+
type: fixed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Bump versions of secrets and klar in the Secure-Binaries template
3+
merge_request: 47531
4+
author:
5+
type: fixed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Replace fa-chevron-down in dropdown button
3+
merge_request: 47758
4+
author:
5+
type: changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: pat_creation_api_for_admin
3+
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45152
4+
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/267553
5+
type: development
6+
group: group::access
7+
default_enabled: false

doc/administration/audit_events.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ The first row contains the headers, which are listed in the following table alon
239239

240240
### Limitation
241241

242-
The Audit Log CSV file size is limited to a maximum of `15 MB`.
242+
The Audit Log CSV file size is limited to a maximum of `100,000` events.
243243
The remaining records are truncated when this limit is reached.
244244

245245
### Enable or disable Audit Log Export to CSV

doc/api/personal_access_tokens.md

+4
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,7 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://git
9393

9494
- `204: No Content` if successfully revoked.
9595
- `400 Bad Request` if not revoked successfully.
96+
97+
## Create a personal access token (admin only)
98+
99+
See the [Users API documentation](users.md#create-a-personal-access-token-admin-only) for information on creating a personal access token.

doc/api/users.md

+67-1
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,54 @@ Parameters:
14411441
| `user_id` | integer | yes | The ID of the user |
14421442
| `impersonation_token_id` | integer | yes | The ID of the impersonation token |
14431443

1444-
### Get user activities (admin only)
1444+
## Create a personal access token (admin only)
1445+
1446+
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17176) in GitLab 13.6.
1447+
> - It's [deployed behind a feature flag](../user/feature_flags.md), disabled by default.
1448+
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-an-administrators-ability-to-use-the-api-to-create-personal-access-tokens). **(CORE)**
1449+
1450+
CAUTION: **Warning:**
1451+
This feature might not be available to you. Check the **version history** note above for details.
1452+
1453+
> Requires admin permissions.
1454+
> Token values are returned once. Make sure you save it - you won't be able to access it again.
1455+
1456+
It creates a new personal access token.
1457+
1458+
```plaintext
1459+
POST /users/:user_id/personal_access_tokens
1460+
```
1461+
1462+
| Attribute | Type | Required | Description |
1463+
| ------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------ |
1464+
| `user_id` | integer | yes | The ID of the user |
1465+
| `name` | string | yes | The name of the personal access token |
1466+
| `expires_at` | date | no | The expiration date of the personal access token in ISO format (`YYYY-MM-DD`) |
1467+
| `scopes` | array | yes | The array of scopes of the personal access token (`api`, `read_user`, `read_api`, `read_repository`, `write_repository`) |
1468+
1469+
```shell
1470+
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "name=mytoken" --data "expires_at=2017-04-04" --data "scopes[]=api" "https://gitlab.example.com/api/v4/users/42/personal_access_tokens"
1471+
```
1472+
1473+
Example response:
1474+
1475+
```json
1476+
{
1477+
"id": 3,
1478+
"name": "mytoken",
1479+
"revoked": false,
1480+
"created_at": "2020-10-14T11:58:53.526Z",
1481+
"scopes": [
1482+
"api"
1483+
],
1484+
"user_id": 42,
1485+
"active": true,
1486+
"expires_at": "2020-12-31",
1487+
"token": "ggbfKkC4n-Lujy8jwCR2"
1488+
}
1489+
```
1490+
1491+
## Get user activities (admin only)
14451492

14461493
NOTE: **Note:**
14471494
This API endpoint is only available on 8.15 (EE) and 9.1 (CE) and above.
@@ -1546,3 +1593,22 @@ Example response:
15461593
},
15471594
]
15481595
```
1596+
1597+
## Enable or disable an administrator's ability to use the API to create personal access tokens **(CORE)**
1598+
1599+
An administrator's ability to create personal access tokens through the API is
1600+
deployed behind a feature flag that is **disabled by default**.
1601+
[GitLab administrators with access to the GitLab Rails console](../administration/feature_flags.md)
1602+
can enable it.
1603+
1604+
To enable it:
1605+
1606+
```ruby
1607+
Feature.enable(:pat_creation_api_for_admin)
1608+
```
1609+
1610+
To disable it:
1611+
1612+
```ruby
1613+
Feature.disable(:pat_creation_api_for_admin)
1614+
```

0 commit comments

Comments
 (0)