Skip to content

Commit 0abfd0b

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 4e7abe5 commit 0abfd0b

29 files changed

+464
-145
lines changed

.gitlab/ci/database.gitlab-ci.yml

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
include:
22
- local: .gitlab/ci/rails/shared.gitlab-ci.yml
33

4+
db:rollback single-db-ci-connection:
5+
extends:
6+
- db:rollback
7+
- .single-db-ci-connection
8+
- .rails:rules:single-db-ci-connection
9+
10+
db:migrate:reset single-db-ci-connection:
11+
extends:
12+
- db:migrate:reset
13+
- .single-db-ci-connection
14+
- .rails:rules:single-db-ci-connection
15+
16+
db:check-schema-single-db-ci-connection:
17+
extends:
18+
- db:check-schema
19+
- .single-db-ci-connection
20+
- .rails:rules:single-db-ci-connection
21+
22+
db:post_deployment_migrations_validator-single-db-ci-connection:
23+
extends:
24+
- db:post_deployment_migrations_validator
25+
- .single-db-ci-connection
26+
- .rails:rules:db:check-migrations-single-db-ci-connection
27+
28+
db:backup_and_restore single-db-ci-connection:
29+
extends:
30+
- db:backup_and_restore
31+
- .single-db-ci-connection
32+
- .rails:rules:db-backup
33+
434
db:rollback:
535
extends:
636
- .db-job-base
@@ -97,7 +127,7 @@ db:backup_and_restore:
97127
GITLAB_ASSUME_YES: "1"
98128
script:
99129
- . scripts/prepare_build.sh
100-
- bundle exec rake db:drop db:create db:structure:load db:seed_fu
130+
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
101131
- mkdir -p tmp/tests/public/uploads tmp/tests/{artifacts,pages,lfs-objects,terraform_state,registry,packages}
102132
- bundle exec rake gitlab:backup:create
103133
- date

.gitlab/ci/rails.gitlab-ci.yml

+36
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,18 @@ rspec background_migration pg12 single-db:
105105
- .single-db-rspec
106106
- .rails:rules:single-db
107107

108+
rspec migration pg12 single-db-ci-connection:
109+
extends:
110+
- rspec migration pg12
111+
- .single-db-rspec
112+
- .rails:rules:single-db-ci-connection
113+
114+
rspec background_migration pg12 single-db-ci-connection:
115+
extends:
116+
- rspec background_migration pg12
117+
- .single-db-rspec
118+
- .rails:rules:single-db-ci-connection
119+
108120
rspec migration pg12 praefect:
109121
extends:
110122
- rspec migration pg12
@@ -428,6 +440,18 @@ rspec background_migration pg12-as-if-foss single-db:
428440
- .single-db-rspec
429441
- .rails:rules:single-db
430442

443+
rspec migration pg12-as-if-foss single-db-ci-connection:
444+
extends:
445+
- rspec migration pg12-as-if-foss
446+
- .single-db-rspec
447+
- .rails:rules:single-db-ci-connection
448+
449+
rspec background_migration pg12-as-if-foss single-db-ci-connection:
450+
extends:
451+
- rspec background_migration pg12-as-if-foss
452+
- .single-db-rspec
453+
- .rails:rules:single-db-ci-connection
454+
431455
rspec unit pg12-as-if-foss:
432456
extends:
433457
- .rspec-base-pg12-as-if-foss
@@ -520,6 +544,18 @@ rspec-ee background_migration pg12 single-db:
520544
- .single-db-rspec
521545
- .rails:rules:single-db
522546

547+
rspec-ee migration pg12 single-db-ci-connection:
548+
extends:
549+
- rspec-ee migration pg12
550+
- .single-db-rspec
551+
- .rails:rules:single-db-ci-connection
552+
553+
rspec-ee background_migration pg12 single-db-ci-connection:
554+
extends:
555+
- rspec-ee background_migration pg12
556+
- .single-db-rspec
557+
- .rails:rules:single-db-ci-connection
558+
523559
rspec-ee migration pg12 praefect:
524560
extends:
525561
- rspec migration pg12

.gitlab/ci/rails/shared.gitlab-ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,17 @@ include:
3636
variables:
3737
DECOMPOSED_DB: "false"
3838

39+
.single-db-ci-connection:
40+
extends: .single-db
41+
variables:
42+
CI_CONNECTION_DB: "true"
43+
3944
.single-db-rspec:
4045
extends: .single-db
4146

47+
.single-db-ci-connection-rspec:
48+
extends: .single-db-ci-connection
49+
4250
.praefect-with-db:
4351
variables:
4452
GITALY_PRAEFECT_WITH_DB: '1'

.gitlab/ci/rules.gitlab-ci.yml

+13
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,19 @@
12381238
- <<: *if-merge-request
12391239
changes: *db-patterns
12401240

1241+
.rails:rules:single-db-ci-connection:
1242+
rules:
1243+
- <<: *if-merge-request-labels-run-single-db
1244+
- <<: *if-merge-request
1245+
changes: *db-patterns
1246+
- <<: *if-default-branch-schedule-nightly
1247+
1248+
.rails:rules:db:check-migrations-single-db-ci-connection:
1249+
rules:
1250+
- <<: *if-merge-request-labels-run-single-db
1251+
- <<: *if-merge-request
1252+
changes: *db-patterns
1253+
12411254
.rails:rules:db-backup:
12421255
rules:
12431256
- <<: *if-merge-request-labels-run-all-rspec

.rubocop_todo/rake/require.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Rake/Require:
33
Details: grace period
44
Exclude:
5-
- 'lib/tasks/gitlab/assets.rake'
65
- 'lib/tasks/gitlab/docs/redirect.rake'
76
- 'lib/tasks/gitlab/graphql.rake'
87
- 'lib/tasks/gitlab/lfs/migrate.rake'

app/assets/javascripts/editor/constants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const EXTENSION_MARKDOWN_BUTTONS = [
114114
},
115115
{
116116
id: 'link',
117-
label: sprintf(s__('MarkdownEditor|Add a link (%{modifier_key}K)'), {
117+
label: sprintf(s__('MarkdownEditor|Add a link (%{modifierKey}K)'), {
118118
modifierKey,
119119
}),
120120
data: {

app/assets/javascripts/editor/extensions/source_editor_markdown_ext.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { insertMarkdownText } from '~/lib/utils/text_markdown';
2-
import { EDITOR_TOOLBAR_RIGHT_GROUP, EXTENSION_MARKDOWN_BUTTONS } from '../constants';
2+
import { EDITOR_TOOLBAR_LEFT_GROUP, EXTENSION_MARKDOWN_BUTTONS } from '../constants';
33

44
export class EditorMarkdownExtension {
55
static get extensionName() {
@@ -24,7 +24,7 @@ export class EditorMarkdownExtension {
2424
return {
2525
...btn,
2626
icon: btn.id,
27-
group: EDITOR_TOOLBAR_RIGHT_GROUP,
27+
group: EDITOR_TOOLBAR_LEFT_GROUP,
2828
category: 'tertiary',
2929
onClick: (e) => instance.insertMarkdown(e),
3030
};

app/finders/milestones_finder.rb

+21
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ def execute
3030
items = by_groups_and_projects(items)
3131
items = by_title(items)
3232
items = by_search_title(items)
33+
items = by_search(items)
3334
items = by_state(items)
3435
items = by_timeframe(items)
3536
items = containing_date(items)
37+
items = by_updated_at(items)
38+
items = by_iids(items)
3639

3740
order(items)
3841
end
@@ -67,6 +70,12 @@ def by_search_title(items)
6770
end
6871
end
6972

73+
def by_search(items)
74+
return items if params[:search].blank?
75+
76+
items.search(params[:search])
77+
end
78+
7079
def by_state(items)
7180
Milestone.filter_by_state(items, params[:state])
7281
end
@@ -84,4 +93,16 @@ def order(items)
8493
def sort_by_expired_last?(sort_by)
8594
EXPIRED_LAST_SORTS.include?(sort_by)
8695
end
96+
97+
def by_updated_at(items)
98+
items = items.updated_before(params[:updated_before]) if params[:updated_before].present?
99+
items = items.updated_after(params[:updated_after]) if params[:updated_after].present?
100+
items
101+
end
102+
103+
def by_iids(items)
104+
return items unless params[:iids].present? && !params[:include_parent_milestones]
105+
106+
items.by_iid(params[:iids])
107+
end
87108
end

app/models/badge.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def rendered_image_url(project = nil)
4242
private
4343

4444
def build_rendered_url(url, project = nil)
45-
return url unless valid? && project
45+
return url unless project
4646

4747
Gitlab::StringPlaceholderReplacer.replace_string_placeholders(url, PLACEHOLDERS_REGEX) do |arg|
4848
replace_placeholder_action(PLACEHOLDERS[arg], project)

app/models/milestone.rb

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Milestone < ApplicationRecord
88
include FromUnion
99
include Importable
1010
include IidRoutes
11+
include UpdatedAtFilterable
1112

1213
prepend_mod_with('Milestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
1314

@@ -26,6 +27,7 @@ class Predefined
2627

2728
has_many :events, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
2829

30+
scope :by_iid, ->(iid) { where(iid: iid) }
2931
scope :active, -> { with_state(:active) }
3032
scope :started, -> { active.where('milestones.start_date <= CURRENT_DATE') }
3133
scope :not_started, -> { active.where('milestones.start_date > CURRENT_DATE') }

doc/api/group_milestones.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ GET /groups/:id/milestones?state=active
2121
GET /groups/:id/milestones?state=closed
2222
GET /groups/:id/milestones?title=1.0
2323
GET /groups/:id/milestones?search=version
24+
GET /groups/:id/milestones?updated_before=2013-10-02T09%3A24%3A18Z
25+
GET /groups/:id/milestones?updated_after=2013-10-02T09%3A24%3A18Z
2426
```
2527

2628
Parameters:
@@ -32,7 +34,9 @@ Parameters:
3234
| `state` | string | no | Return only `active` or `closed` milestones |
3335
| `title` | string | no | Return only the milestones having the given `title` |
3436
| `search` | string | no | Return only milestones with a title or description matching the provided string |
35-
| `include_parent_milestones` | boolean | optional | Include milestones from parent group and its ancestors. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196066) in GitLab 13.4 |
37+
| `include_parent_milestones` | boolean | no | Include milestones from parent group and its ancestors. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196066) in GitLab 13.4 |
38+
| `updated_before` | datetime | no | Return only milestones updated before the given datetime. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). Introduced in GitLab 15.10 |
39+
| `updated_after` | datetime | no | Return only milestones updated after the given datetime. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). Introduced in GitLab 15.10 |
3640

3741
```shell
3842
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/milestones"

doc/api/milestones.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,22 @@ GET /projects/:id/milestones?state=active
2121
GET /projects/:id/milestones?state=closed
2222
GET /projects/:id/milestones?title=1.0
2323
GET /projects/:id/milestones?search=version
24+
GET /projects/:id/milestones?updated_before=2013-10-02T09%3A24%3A18Z
25+
GET /projects/:id/milestones?updated_after=2013-10-02T09%3A24%3A18Z
2426
```
2527

2628
Parameters:
2729

2830
| Attribute | Type | Required | Description |
2931
| ---------------------------- | ------ | -------- | ----------- |
3032
| `id` | integer or string | yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
31-
| `iids[]` | integer array | optional | Return only the milestones having the given `iid` (Note: ignored if `include_parent_milestones` is set as `true`) |
32-
| `state` | string | optional | Return only `active` or `closed` milestones |
33-
| `title` | string | optional | Return only the milestones having the given `title` |
34-
| `search` | string | optional | Return only milestones with a title or description matching the provided string |
35-
| `include_parent_milestones` | boolean | optional | Include group milestones from parent group and its ancestors. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196066) in GitLab 13.4 |
33+
| `iids[]` | integer array | no | Return only the milestones having the given `iid` (Note: ignored if `include_parent_milestones` is set as `true`) |
34+
| `state` | string | no | Return only `active` or `closed` milestones |
35+
| `title` | string | no | Return only the milestones having the given `title` |
36+
| `search` | string | no | Return only milestones with a title or description matching the provided string |
37+
| `include_parent_milestones` | boolean | no | Include group milestones from parent group and its ancestors. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196066) in GitLab 13.4 |
38+
| `updated_before` | datetime | no | Return only milestones updated before the given datetime. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). Introduced in GitLab 15.10 |
39+
| `updated_after` | datetime | no | Return only milestones updated after the given datetime. Expected in ISO 8601 format (`2019-03-15T08:00:00Z`). Introduced in GitLab 15.10 |
3640

3741
```shell
3842
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/milestones"

doc/ci/yaml/includes.md

-7
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ To include a single configuration file, use either of these syntax options:
2020
include: '/templates/.after-script-template.yml'
2121
```
2222
23-
- `include` with a single file, and you specify the `include` type:
24-
25-
```yaml
26-
include:
27-
remote: 'https://gitlab.com/awesome-project/raw/main/.before-script-template.yml'
28-
```
29-
3023
## Include an array of configuration files
3124
3225
You can include an array of configuration files:

doc/user/group/manage.md

+71
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,77 @@ To enable group file templates:
549549
1. Choose a project to act as the template repository.
550550
1. Select **Save changes**.
551551

552+
## Group merge checks settings **(PREMIUM)**
553+
554+
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/372040) in GitLab 15.9 [with a flag](../../administration/feature_flags.md) name `support_group_level_merge_checks_setting`. Disabled by default.
555+
556+
FLAG:
557+
On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to
558+
[enable the feature flag](../../administration/feature_flags.md) named `support_group_level_merge_checks_setting`. On GitLab.com, this feature is not
559+
available.
560+
561+
Group owners can set up merge request checks on a top-level group, which apply to all subgroups and projects.
562+
563+
If the settings are inherited by a subgroup or project, they cannot be changed in the subgroup or project
564+
that inherited them.
565+
566+
### Require a successful pipeline for merge
567+
568+
You can configure all child projects in your group to require a complete and successful pipeline before
569+
merge.
570+
571+
See also [the project-level setting](../project/merge_requests/merge_when_pipeline_succeeds.md#require-a-successful-pipeline-for-merge).
572+
573+
Prerequisites:
574+
575+
- You must be the owner of the group.
576+
577+
To enable this setting:
578+
579+
1. On the top bar, select **Main menu > Groups** and find your group.
580+
1. On the left sidebar, select **Settings > General**.
581+
1. Expand **Merge requests**.
582+
1. Under **Merge checks**, select **Pipelines must succeed**.
583+
This setting also prevents merge requests from being merged if there is no pipeline.
584+
1. Select **Save changes**.
585+
586+
#### Allow merge after skipped pipelines
587+
588+
You can configure [skipped pipelines](../../ci/pipelines/index.md#skip-a-pipeline) from preventing merge requests from being merged.
589+
590+
See also [the project-level setting](../project/merge_requests/merge_when_pipeline_succeeds.md#allow-merge-after-skipped-pipelines).
591+
592+
Prerequisite:
593+
594+
- You must be the owner of the group.
595+
596+
To change this behavior:
597+
598+
1. On the top bar, select **Main menu > Groups** and find your group.
599+
1. On the left sidebar, select **Settings > General**.
600+
1. Expand **Merge requests**.
601+
1. Under **Merge checks**:
602+
- Select **Pipelines must succeed**.
603+
- Select **Skipped pipelines are considered successful**.
604+
1. Select **Save changes**.
605+
606+
### Prevent merge unless all threads are resolved
607+
608+
You can prevent merge requests from being merged until all threads are resolved. When this setting is enabled, for all child projects in your group, the
609+
**Unresolved threads** count in a merge request is shown in orange when at least one thread remains unresolved.
610+
611+
Prerequisite:
612+
613+
- You must be the owner of the group.
614+
615+
To enable this setting:
616+
617+
1. On the top bar, select **Main menu > Groups** and find your group.
618+
1. On the left sidebar, select **Settings > General**.
619+
1. Expand **Merge requests**.
620+
1. Under **Merge checks**, select **All threads must be resolved**.
621+
1. Select **Save changes**.
622+
552623
## Group merge request approval settings **(PREMIUM)**
553624

554625
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/285458) in GitLab 13.9. [Deployed behind the `group_merge_request_approval_settings_feature_flag` flag](../../administration/feature_flags.md), disabled by default.

0 commit comments

Comments
 (0)