Skip to content

Commit 966bb31

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 8f6498a commit 966bb31

File tree

16 files changed

+213
-59
lines changed

16 files changed

+213
-59
lines changed

app/graphql/resolvers/work_items/widgets/custom_status_resolver.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ class CustomStatusResolver < BaseResolver
77
type ::Types::WorkItems::Widgets::CustomStatusType.connection_type, null: true
88

99
def resolve
10-
# Implement during https://gitlab.com/gitlab-org/gitlab/-/issues/498393
11-
[::WorkItems::Widgets::CustomStatus.new(nil), ::WorkItems::Widgets::CustomStatus.new(nil)]
10+
[]
1211
end
1312
end
1413
end
1514
end
1615
end
16+
17+
Resolvers::WorkItems::Widgets::CustomStatusResolver.prepend_mod

app/graphql/types/work_items/widgets/custom_status_type.rb

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,30 @@ class CustomStatusType < BaseObject
1212

1313
implements ::Types::WorkItems::WidgetInterface
1414

15-
# TODO change the ID to CustomStatus model ID while implementing
16-
# https://gitlab.com/gitlab-org/gitlab/-/issues/498393
17-
field :id, ::Types::GlobalIDType[::WorkItems::Widgets::CustomStatus],
18-
null: false,
15+
field :id, Types::GlobalIDType,
16+
null: true,
1917
experiment: { milestone: '17.8' },
20-
description: 'ID of the Custom Status.'
18+
description: 'ID of the custom status.'
2119

2220
field :name, GraphQL::Types::String,
2321
null: true,
2422
experiment: { milestone: '17.8' },
25-
description: 'Name of the Custom Status.'
23+
description: 'Name of the custom status.'
2624

2725
field :icon_name, GraphQL::Types::String,
2826
null: true,
2927
experiment: { milestone: '17.8' },
30-
description: 'Icon name of the Custom Status.'
28+
description: 'Icon name of the custom status.'
29+
30+
field :color, GraphQL::Types::String,
31+
null: true,
32+
experiment: { milestone: '17.10' },
33+
description: 'Color of the custom status.'
34+
35+
field :position, GraphQL::Types::Int,
36+
null: true,
37+
experiment: { milestone: '17.10' },
38+
description: 'Position of the custom status within its category.'
3139
end
3240
# rubocop:enable Graphql/AuthorizeTypes
3341
end

app/models/group.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,11 @@ def work_items_alpha_feature_flag_enabled?
10041004
feature_flag_enabled_for_self_or_ancestor?(:work_items_alpha)
10051005
end
10061006

1007+
def work_item_status_feature_available?
1008+
feature_flag_enabled_for_self_or_ancestor?(:work_item_status, type: :wip) &&
1009+
licensed_feature_available?(:work_item_custom_status)
1010+
end
1011+
10071012
def continue_indented_text_feature_flag_enabled?
10081013
feature_flag_enabled_for_self_or_ancestor?(:continue_indented_text, type: :wip)
10091014
end

app/models/project.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3313,6 +3313,11 @@ def work_items_alpha_feature_flag_enabled?
33133313
group&.work_items_alpha_feature_flag_enabled? || Feature.enabled?(:work_items_alpha)
33143314
end
33153315

3316+
def work_item_status_feature_available?
3317+
(group&.work_item_status_feature_available? || Feature.enabled?(:work_item_status, type: :wip)) &&
3318+
licensed_feature_available?(:work_item_custom_status)
3319+
end
3320+
33163321
def glql_integration_feature_flag_enabled?
33173322
group&.glql_integration_feature_flag_enabled? || Feature.enabled?(:glql_integration, self)
33183323
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: work_item_status
3+
feature_issue_url: https://gitlab.com/groups/gitlab-org/-/epics/5099
4+
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/182225
5+
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/521286
6+
milestone: '17.10'
7+
group: group::project management
8+
type: wip
9+
default_enabled: false

doc/administration/external_users.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: External users
88
{{< details >}}
99

1010
- Tier: Free, Premium, Ultimate
11-
- Offering: GitLab Self-Managed
11+
- Offering: GitLab Self-Managed, GitLab Dedicated
1212

1313
{{< /details >}}
1414

doc/administration/packages/container_registry_metadata_database.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ By using a database to store this data, many new features are possible, includin
3232
which removes old data automatically with zero downtime.
3333

3434
This database works in conjunction with the object storage already used by the registry, but does not replace object storage.
35-
You must continue to maintain an object storage solution even after migrating to a metadata database.
35+
You must continue to maintain an object storage solution even after migrating to the metadata database.
3636

3737
For Helm Charts installations, see [Manage the container registry metadata database](https://docs.gitlab.com/charts/charts/registry/metadata_database.html#create-the-database)
3838
in the Helm Charts documentation.
@@ -103,7 +103,7 @@ To enable the database:
103103
```
104104

105105
1. Save the file and [reconfigure GitLab](../restart_gitlab.md#reconfigure-a-linux-package-installation).
106-
1. [Apply schema migrations](#apply-schema-migrations).
106+
1. [Apply database migrations](#apply-database-migrations).
107107
1. Enable the database by editing `/etc/gitlab/gitlab.rb` and setting `enabled` to `true`:
108108

109109
```ruby
@@ -195,7 +195,7 @@ and your registry contains a relatively small amount of data.
195195
```
196196

197197
1. Save the file and [reconfigure GitLab](../restart_gitlab.md#reconfigure-a-linux-package-installation).
198-
1. [Apply schema migrations](#apply-schema-migrations) if you have not done so.
198+
1. [Apply database migrations](#apply-database-migrations) if you have not done so.
199199
1. Run the following command:
200200

201201
```shell
@@ -283,7 +283,7 @@ If you must halt the operation, you have to restart this step.
283283
```
284284

285285
1. Save the file and [reconfigure GitLab](../restart_gitlab.md#reconfigure-a-linux-package-installation).
286-
1. [Apply schema migrations](#apply-schema-migrations) if you have not done so.
286+
1. [Apply database migrations](#apply-database-migrations) if you have not done so.
287287
1. Run the first step to begin the migration:
288288

289289
```shell
@@ -389,43 +389,50 @@ delay ensures that online garbage collection does not interfere with image pushe
389389
Check out the [monitor online garbage collection](#online-garbage-collection-monitoring) section
390390
to see how to monitor the progress and health of the online garbage collector.
391391

392-
## Manage schema migrations
392+
## Database migrations
393393

394-
Use the following commands to run the schema migrations for the Container registry metadata database.
395-
The registry must be enabled and the configuration section must have the database section filled.
394+
The container registry supports two types of migrations:
396395

397-
### Apply schema migrations
396+
- **Regular schema migrations**: Changes to the database structure that must run before deploying new application code. These should be fast (no more than a few minutes) to avoid deployment delays.
397+
398+
- **Post-deployment migrations**: Changes to the database structure that can run while the application is running. Used for longer operations like creating indexes on large tables, avoiding startup delays and extended upgrade downtimes.
398399

399-
1. Run the registry database schema migrations
400+
By default, the registry applies both regular schema and post-deployment migrations simultaneously. To reduce downtime during upgrades, you can skip post-deployment migrations and apply them manually after the application starts.
401+
402+
### Apply database migrations
403+
404+
To apply both regular schema and post-deployment migrations before the application starts:
405+
406+
1. Run database migrations:
400407

401408
```shell
402409
sudo gitlab-ctl registry-database migrate up
403410
```
404411

405-
1. The registry must stop if it's running. Type `y` to confirm and wait for the process to finish.
406-
407-
{{< alert type="note" >}}
412+
To skip post-deployment migrations:
408413

409-
The `migrate up` command offers some extra flags that can be used to control how the migrations are applied.
410-
Run `sudo gitlab-ctl registry-database migrate up --help` for details.
414+
1. Run regular schema migrations only:
411415

412-
{{< /alert >}}
416+
```shell
417+
sudo gitlab-ctl registry-database migrate up --skip-post-deployment
418+
```
413419

414-
### Undo schema migrations
420+
As an alternative to the `--skip-post-deployment` flag, you can also set the `SKIP_POST_DEPLOYMENT_MIGRATIONS` environment variable to `true`:
415421

416-
You can undo schema migrations in case anything goes wrong, but this is a non-recoverable action.
417-
If you pushed new images while the database was in use, they will no longer be accessible
418-
after this.
422+
```shell
423+
SKIP_POST_DEPLOYMENT_MIGRATIONS=true sudo gitlab-ctl registry-database migrate up
424+
```
419425

420-
1. Undo the registry database schema migrations:
426+
1. After starting the application, apply any pending post-deployment migrations:
421427

422428
```shell
423-
sudo gitlab-ctl registry-database migrate down
429+
sudo gitlab-ctl registry-database migrate up
424430
```
425431

426432
{{< alert type="note" >}}
427433

428-
The `migrate down` command offers some extra flags. Run `sudo gitlab-ctl registry-database migrate down --help` for details.
434+
The `migrate up` command offers some extra flags that can be used to control how the migrations are applied.
435+
Run `sudo gitlab-ctl registry-database migrate up --help` for details.
429436

430437
{{< /alert >}}
431438

@@ -597,7 +604,7 @@ the registry fails to start with the following error message:
597604
FATA[0000] configuring application: there are pending database migrations, use the 'registry database migrate' CLI command to check and apply them
598605
```
599606

600-
To fix this issue, follow the steps to [apply schema migrations](#apply-schema-migrations).
607+
To fix this issue, follow the steps to [apply database migrations](#apply-database-migrations).
601608

602609
### Error: `offline garbage collection is no longer possible`
603610

@@ -617,7 +624,7 @@ You must either:
617624
618625
### Error: `cannot execute <STATEMENT> in a read-only transaction`
619626
620-
The registry could fail to [apply schema migrations](#apply-schema-migrations)
627+
The registry could fail to [apply database migrations](#apply-database-migrations)
621628
with the following error message:
622629
623630
```shell
@@ -658,7 +665,7 @@ If either of these values is set to `on`, you must disable it:
658665
```
659666
660667
1. Restart your Postgres server to apply these settings.
661-
1. Try to [apply schema migrations](#apply-schema-migrations) again, if applicable.
668+
1. Try to [apply database migrations](#apply-database-migrations) again, if applicable.
662669
1. Restart the registry `sudo gitlab-ctl restart registry`.
663670
664671
### Error: `cannot import all repositories while the tags table has entries`

doc/api/graphql/reference/_index.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39901,9 +39901,11 @@ Represents Custom Status widget.
3990139901

3990239902
| Name | Type | Description |
3990339903
| ---- | ---- | ----------- |
39904-
| <a id="workitemwidgetcustomstatusiconname"></a>`iconName` {{< icon name="warning-solid" >}} | [`String`](#string) | **Introduced** in GitLab 17.8. **Status**: Experiment. Icon name of the Custom Status. |
39905-
| <a id="workitemwidgetcustomstatusid"></a>`id` {{< icon name="warning-solid" >}} | [`WorkItemsWidgetsCustomStatusID!`](#workitemswidgetscustomstatusid) | **Introduced** in GitLab 17.8. **Status**: Experiment. ID of the Custom Status. |
39906-
| <a id="workitemwidgetcustomstatusname"></a>`name` {{< icon name="warning-solid" >}} | [`String`](#string) | **Introduced** in GitLab 17.8. **Status**: Experiment. Name of the Custom Status. |
39904+
| <a id="workitemwidgetcustomstatuscolor"></a>`color` {{< icon name="warning-solid" >}} | [`String`](#string) | **Introduced** in GitLab 17.10. **Status**: Experiment. Color of the custom status. |
39905+
| <a id="workitemwidgetcustomstatusiconname"></a>`iconName` {{< icon name="warning-solid" >}} | [`String`](#string) | **Introduced** in GitLab 17.8. **Status**: Experiment. Icon name of the custom status. |
39906+
| <a id="workitemwidgetcustomstatusid"></a>`id` {{< icon name="warning-solid" >}} | [`GlobalID`](#globalid) | **Introduced** in GitLab 17.8. **Status**: Experiment. ID of the custom status. |
39907+
| <a id="workitemwidgetcustomstatusname"></a>`name` {{< icon name="warning-solid" >}} | [`String`](#string) | **Introduced** in GitLab 17.8. **Status**: Experiment. Name of the custom status. |
39908+
| <a id="workitemwidgetcustomstatusposition"></a>`position` {{< icon name="warning-solid" >}} | [`Int`](#int) | **Introduced** in GitLab 17.10. **Status**: Experiment. Position of the custom status within its category. |
3990739909
| <a id="workitemwidgetcustomstatustype"></a>`type` | [`WorkItemWidgetType`](#workitemwidgettype) | Widget type. |
3990839910

3990939911
### `WorkItemWidgetDefinitionAssignees`
@@ -45393,12 +45395,6 @@ A `WorkItemsTypeID` is a global ID. It is encoded as a string.
4539345395

4539445396
An example `WorkItemsTypeID` is: `"gid://gitlab/WorkItems::Type/1"`.
4539545397

45396-
### `WorkItemsWidgetsCustomStatusID`
45397-
45398-
A `WorkItemsWidgetsCustomStatusID` is a global ID. It is encoded as a string.
45399-
45400-
An example `WorkItemsWidgetsCustomStatusID` is: `"gid://gitlab/WorkItems::Widgets::CustomStatus/1"`.
45401-
4540245398
## Abstract types
4540345399

4540445400
Abstract types (unions and interfaces) are ways the schema can represent

doc/user/application_security/dast/browser/configuration/requirements.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ title: Requirements
1919
- dast
2020
```
2121
22+
- A network connection between the runner and your target application.
23+
24+
How you connect depends on your DAST configuration:
25+
- If `DAST_TARGET_URL` and `DAST_AUTH_URL` specify port numbers, use those ports.
26+
- If ports are not specified, use the standard port numbers for HTTP and HTTPS.
27+
28+
You might need to open both an HTTP and HTTPS port. For example, if the target URL uses HTTP, but the application links to resources using HTTPS. Always test your connection when you configure a scan.
29+
2230
## Recommendations
2331

2432
- Take care if your pipeline is configured to deploy to the same web server in each run. Running a DAST scan while a server is being updated leads to inaccurate and non-deterministic results.

doc/user/application_security/vulnerabilities/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
stage: Security Risk Management
33
group: Security Insights
44
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
5-
title: Vulnerability Page
5+
title: Vulnerability details
66
---
77

88
{{< details >}}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
RSpec.describe Resolvers::WorkItems::Widgets::CustomStatusResolver, feature_category: :team_planning do
6+
include GraphqlHelpers
7+
8+
let_it_be(:group) { create(:group) }
9+
let_it_be(:project) { create(:project, group: group) }
10+
let_it_be(:current_user) { create(:user) }
11+
let_it_be(:task_type) { create(:work_item_type, :task) }
12+
let_it_be(:widget_definition) do
13+
create(:widget_definition, widget_type: :custom_status, work_item_type: task_type, name: 'TesT Widget')
14+
end
15+
16+
shared_examples 'does not return system defined statuses' do
17+
it 'returns an empty array' do
18+
expect(resolve_custom_statuses&.items).to eq([])
19+
end
20+
end
21+
22+
describe '#resolve' do
23+
let(:resource_parent) { group }
24+
25+
context 'with group' do
26+
it_behaves_like 'does not return system defined statuses'
27+
end
28+
29+
context 'with project' do
30+
let(:resource_parent) { project }
31+
32+
it_behaves_like 'does not return system defined statuses'
33+
end
34+
35+
context 'with unsupported namespace' do
36+
let(:resource_parent) { current_user.namespace }
37+
38+
it_behaves_like 'does not return system defined statuses'
39+
end
40+
41+
context 'with work_item_status feature flag disabled' do
42+
before do
43+
stub_feature_flags(work_item_status: false)
44+
end
45+
46+
it_behaves_like 'does not return system defined statuses'
47+
end
48+
end
49+
50+
def resolve_custom_statuses(args = {}, context = { current_user: current_user, resource_parent: resource_parent })
51+
resolve(described_class, obj: widget_definition, args: args, ctx: context)
52+
end
53+
end

spec/graphql/types/work_items/widgets/custom_status_type_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
require 'spec_helper'
44

5-
RSpec.describe Types::WorkItems::Widgets::CustomStatusType, feature_category: :service_desk do
5+
RSpec.describe Types::WorkItems::Widgets::CustomStatusType, feature_category: :team_planning do
66
it 'exposes the expected fields' do
7-
expected_fields = %i[id name icon_name]
7+
expected_fields = %i[id name icon_name color position]
88

99
expected_fields.each do |field|
1010
expect(described_class).to have_graphql_field(field)

spec/models/group_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4063,6 +4063,12 @@ def define_cache_expectations(cache_key)
40634063
end
40644064
end
40654065

4066+
describe '#work_item_status_feature_available?' do
4067+
subject { group.work_item_status_feature_available? }
4068+
4069+
it { is_expected.to be false }
4070+
end
4071+
40664072
describe '#continue_indented_text_feature_flag_enabled?' do
40674073
it_behaves_like 'checks self and root ancestor feature flag' do
40684074
let(:feature_flag) { :continue_indented_text }

spec/models/project_spec.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5767,9 +5767,9 @@ def has_external_wiki
57675767
end
57685768

57695769
describe '#predefined_project_variables' do
5770-
let_it_be(:project) { create(:project, :repository) }
5770+
let(:project_with_pre_defined_var) { create(:project, :repository) }
57715771

5772-
subject { project.predefined_project_variables.to_runner_variables }
5772+
subject { project_with_pre_defined_var.predefined_project_variables.to_runner_variables }
57735773

57745774
specify do
57755775
expect(subject).to include(
@@ -5779,7 +5779,7 @@ def has_external_wiki
57795779

57805780
context 'when ci config path is overridden' do
57815781
before do
5782-
project.update!(ci_config_path: 'random.yml')
5782+
project_with_pre_defined_var.update!(ci_config_path: 'random.yml')
57835783
end
57845784

57855785
it do
@@ -9164,6 +9164,14 @@ def has_external_wiki
91649164
end
91659165
end
91669166

9167+
describe '#work_item_status_feature_available?' do
9168+
let_it_be(:group_project) { create(:project, :in_subgroup) }
9169+
9170+
it "return false" do
9171+
expect(group_project.work_item_status_feature_available?).to be false
9172+
end
9173+
end
9174+
91679175
describe 'serialization' do
91689176
let(:object) { build(:project) }
91699177

0 commit comments

Comments
 (0)