Skip to content

Commit a50b8ce

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 1185bb8 commit a50b8ce

File tree

20 files changed

+264
-19
lines changed

20 files changed

+264
-19
lines changed

.rubocop_todo/layout/argument_alignment.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Cop supports --autocorrect.
33
Layout/ArgumentAlignment:
44
Exclude:
5-
- 'ee/app/services/ee/keys/create_service.rb'
65
- 'ee/app/services/ee/projects/create_from_template_service.rb'
76
- 'ee/app/services/ee/projects/gitlab_projects_import_service.rb'
87
- 'ee/app/services/ee/search/snippet_service.rb'

GITLAB_KAS_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c4214a8f59358bcca78e06f5e4d5bbb8e19cc03b
1+
eee36c7f647a6ecbc1398349520fce14a021008e
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# frozen_string_literal: true
2+
3+
module Mutations
4+
module Branches # rubocop:disable Gitlab/BoundedContexts -- Existing module
5+
class Delete < BaseMutation
6+
graphql_name 'BranchDelete'
7+
8+
include FindsProject
9+
10+
argument :project_path, GraphQL::Types::ID,
11+
required: true,
12+
description: 'Project full path the branch is associated with.'
13+
14+
argument :name, GraphQL::Types::String,
15+
required: true,
16+
description: 'Name of the branch.'
17+
18+
field :branch,
19+
Types::BranchType,
20+
null: true,
21+
description: 'Branch after mutation.'
22+
23+
authorize :push_code
24+
25+
def resolve(project_path:, name:)
26+
project = authorized_find!(project_path)
27+
28+
result = ::Branches::DeleteService.new(project, current_user).execute(name)
29+
30+
{
31+
branch: (result.payload[:branch] if result.error?),
32+
errors: result.errors
33+
}
34+
end
35+
end
36+
end
37+
end

app/graphql/types/mutation_type.rb

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class MutationType < BaseObject
4040
mount_mutation Mutations::Boards::Lists::Update
4141
mount_mutation Mutations::Boards::Lists::Destroy
4242
mount_mutation Mutations::Branches::Create, calls_gitaly: true
43+
mount_mutation Mutations::Branches::Delete, calls_gitaly: true
4344
mount_mutation Mutations::Clusters::Agents::Create
4445
mount_mutation Mutations::Clusters::Agents::Delete
4546
mount_mutation Mutations::Clusters::AgentTokens::Create

app/models/diff_note.rb

+11
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,17 @@ def shas
131131
end
132132
end
133133

134+
def latest_diff_file_path
135+
latest_diff_file.file_path
136+
end
137+
138+
def raw_truncated_diff_lines
139+
discussion
140+
.truncated_diff_lines(highlight: false)
141+
.map(&:text)
142+
.join("\n")
143+
end
144+
134145
private
135146

136147
def enqueue_diff_file_creation_job

app/services/branches/delete_service.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ def execute(branch_name)
2424
ServiceResponse.success(message: 'Branch was deleted')
2525
else
2626
ServiceResponse.error(
27+
payload: { branch: branch },
2728
message: 'Failed to remove branch',
2829
http_status: 400)
2930
end
3031
rescue Gitlab::Git::PreReceiveError, Gitlab::Git::CommandError => ex
31-
ServiceResponse.error(message: ex.message, http_status: 400)
32+
ServiceResponse.error(payload: { branch: branch }, message: ex.message, http_status: 400)
3233
end
3334

3435
private

config/sidekiq_queues.yml

+2
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@
541541
- 1
542542
- - merge_requests_delete_source_branch
543543
- 1
544+
- - merge_requests_duo_code_review_chat
545+
- 1
544546
- - merge_requests_execute_approval_hooks
545547
- 1
546548
- - merge_requests_fetch_suggested_reviewers
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
- title: "Updated tooling to release CI/CD components to the Catalog"
2+
announcement_milestone: "17.7"
3+
removal_milestone: "18.0"
4+
breaking_change: true
5+
reporter: dhershkovitch
6+
stage: verify
7+
issue_url: https://gitlab.com/groups/gitlab-org/-/epics/12788
8+
window: 3 # Can be 1, 2, or 3 - The window when the breaking change will be deployed on GitLab.com
9+
# Use the impact calculator https://gitlab-com.gitlab.io/gl-infra/breaking-change-impact-calculator/?
10+
impact: high # Can be one of: [critical, high, medium, low]
11+
scope: # Can be one or a combination of: [instance, group, project]
12+
resolution_role: Developer # Can be one of: [Admin, Owner, Maintainer, Developer]
13+
manual_task: true # Can be true or false. Use this to denote whether a resolution action must be performed manually (true), or if it can be automated by using the API or other automation (false).
14+
body: | # (required) Don't change this line.
15+
Starting in GitLab 18.0, the internal process that releases CI/CD components to the Catalog will be changed.
16+
If you use the [recommended CI/CD component release process](https://docs.gitlab.com/ee/ci/components/#publish-a-new-release), which makes use of the `release` keyword and the `registry.gitlab.com/gitlab-org/release-cli:latest` container image, you do not need to make any changes.
17+
The `latest` version of this container image (`v0.20.0`) contains [GLab](https://gitlab.com/gitlab-org/cli/) `v1.50.0`, which will be used for all releases to the CI/CD Catalog in GitLab 18.0 and later.
18+
In other cases:
19+
20+
- If you need to pin the container image to a specific version, use `v0.20.0` or later (`registry.gitlab.com/gitlab-org/release-cli:v0.20.0`),
21+
to ensure GLab is available for the release process.
22+
- If you've manually installed the Release CLI tool on your runners, you must install GLab `v1.50.0` or later on those runners.
23+
24+
# ==============================
25+
# OPTIONAL END-OF-SUPPORT FIELDS
26+
# ==============================
27+
#
28+
# If an End of Support period applies:
29+
# 1) Share this announcement in the `#spt_managers` Support channel in Slack
30+
# 2) Mention `@gitlab-com/support` in this merge request.
31+
#
32+
# When support for this feature ends, in XX.YY milestone format.
33+
end_of_support_milestone:
34+
# Array of tiers the feature is currently available to,
35+
# like [Free, Silver, Gold, Core, Premium, Ultimate]
36+
tiers:
37+
# Links to documentation and thumbnail image
38+
documentation_url:
39+
image_url:
40+
# Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg
41+
video_url:

doc/api/graphql/reference/index.md

+20
Original file line numberDiff line numberDiff line change
@@ -2784,6 +2784,26 @@ Input type: `BoardListUpdateLimitMetricsInput`
27842784
| <a id="mutationboardlistupdatelimitmetricserrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. |
27852785
| <a id="mutationboardlistupdatelimitmetricslist"></a>`list` | [`BoardList`](#boardlist) | Updated list. |
27862786

2787+
### `Mutation.branchDelete`
2788+
2789+
Input type: `BranchDeleteInput`
2790+
2791+
#### Arguments
2792+
2793+
| Name | Type | Description |
2794+
| ---- | ---- | ----------- |
2795+
| <a id="mutationbranchdeleteclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
2796+
| <a id="mutationbranchdeletename"></a>`name` | [`String!`](#string) | Name of the branch. |
2797+
| <a id="mutationbranchdeleteprojectpath"></a>`projectPath` | [`ID!`](#id) | Project full path the branch is associated with. |
2798+
2799+
#### Fields
2800+
2801+
| Name | Type | Description |
2802+
| ---- | ---- | ----------- |
2803+
| <a id="mutationbranchdeletebranch"></a>`branch` | [`Branch`](#branch) | Branch after mutation. |
2804+
| <a id="mutationbranchdeleteclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
2805+
| <a id="mutationbranchdeleteerrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. |
2806+
27872807
### `Mutation.branchRuleApprovalProjectRuleCreate`
27882808

27892809
DETAILS:

doc/update/breaking_windows.md

+1
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,6 @@ This window takes place on May 5 - 7, 2025 from 09:00 UTC to 22:00 UTC.
7474
| [`ciJobTokenScopeAddProject` GraphQL mutation is deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/474175) | Low | Govern | Project |
7575
| [Guest users can pull packages from private projects on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/336622) | High | Package | Project |
7676
| [Removal of `migrationState` field in `ContainerRepository` GraphQL API](https://gitlab.com/gitlab-org/gitlab/-/issues/459869) | Low | Package | Project |
77+
| [Updated tooling to release CI/CD components to the Catalog](https://gitlab.com/groups/gitlab-org/-/epics/12788) | High | Verify | |
7778
| [Increased default security for use of pipeline variables](https://gitlab.com/gitlab-org/gitlab/-/issues/502382) | Medium | Verify | Project |
7879
| [Remove `previousStageJobsOrNeeds` from GraphQL](https://gitlab.com/gitlab-org/gitlab/-/issues/424417) | | Verify | |

doc/update/deprecations.md

+23
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,29 @@ Toggling notes confidentiality with REST and GraphQL APIs is being deprecated. U
11981198

11991199
<div class="deprecation breaking-change" data-milestone="18.0">
12001200

1201+
### Updated tooling to release CI/CD components to the Catalog
1202+
1203+
<div class="deprecation-notes">
1204+
1205+
- Announced in GitLab <span class="milestone">17.7</span>
1206+
- Removal in GitLab <span class="milestone">18.0</span> ([breaking change](https://docs.gitlab.com/ee/update/terminology.html#breaking-change))
1207+
- To discuss this change or learn more, see the [deprecation issue](https://gitlab.com/groups/gitlab-org/-/epics/12788).
1208+
1209+
</div>
1210+
1211+
Starting in GitLab 18.0, the internal process that releases CI/CD components to the Catalog will be changed.
1212+
If you use the [recommended CI/CD component release process](https://docs.gitlab.com/ee/ci/components/#publish-a-new-release), which makes use of the `release` keyword and the `registry.gitlab.com/gitlab-org/release-cli:latest` container image, you do not need to make any changes.
1213+
The `latest` version of this container image (`v0.20.0`) contains [GLab](https://gitlab.com/gitlab-org/cli/) `v1.50.0`, which will be used for all releases to the CI/CD Catalog in GitLab 18.0 and later.
1214+
In other cases:
1215+
1216+
- If you need to pin the container image to a specific version, use `v0.20.0` or later (`registry.gitlab.com/gitlab-org/release-cli:v0.20.0`),
1217+
to ensure GLab is available for the release process.
1218+
- If you've manually installed the Release CLI tool on your runners, you must install GLab `v1.50.0` or later on those runners.
1219+
1220+
</div>
1221+
1222+
<div class="deprecation breaking-change" data-milestone="18.0">
1223+
12011224
### Workspaces `editor` GraphQL field is deprecated
12021225

12031226
<div class="deprecation-notes">

doc/user/analytics/ai_impact_analytics.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group: Optimize
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
55
---
66

7-
# AI Impact analytics
7+
# AI impact analytics
88

99
DETAILS:
1010
**Tier:** Ultimate with GitLab Duo Enterprise - [Start a trial](https://about.gitlab.com/solutions/gitlab-duo-pro/sales/?type=free-trial)
@@ -14,20 +14,20 @@ DETAILS:
1414
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/451873) in GitLab 17.2. Feature flag `ai_impact_analytics_dashboard` removed.
1515
> - Changed to require GitLab Duo add-on in GitLab 17.6.
1616
17-
AI Impact analytics displays software development lifecycle (SDLC) metrics for a project or group in the month-to-date and the past six months.
17+
AI impact analytics displays software development lifecycle (SDLC) metrics for a project or group in the month-to-date and the past six months.
1818

19-
Use AI Impact analytics to:
19+
Use AI impact analytics to:
2020

2121
- Measure the effectiveness and impact of AI on SDLC metrics.
2222
- Visualize which metrics improved as a result of investments in AI.
2323
- Track the progress of AI adoption.
2424
- Compare the performance of teams that are using AI against teams that are not using AI.
2525

26-
For a click-through demo, see the [AI Impact analytics product tour](https://gitlab.navattic.com/ai-impact).
26+
For a click-through demo, see the [AI impact analytics product tour](https://gitlab.navattic.com/ai-impact).
2727

28-
## AI Impact metrics
28+
## AI impact metrics
2929

30-
AI Impact analytics displays key metrics and metric trends for a project or group.
30+
AI impact analytics displays key metrics and metric trends for a project or group.
3131

3232
### Key metrics
3333

@@ -52,14 +52,14 @@ The **Metric trends** table displays metrics for the last six months, with month
5252
**Code Suggestions usage**: Monthly user engagement with AI Code Suggestions.
5353

5454
- The month-over-month comparison of the AI Usage unique users rate gives a more accurate indication of this metric, as it eliminates factors such as developer experience level and project type or complexity.
55-
- The baseline for the AI Usage trend is the total number of code contributors, not just users with GitLab Duo seats. This baseline gives a more accurate representation of AI usage by team members. To learn more about AI Impact analytics, see the blog post [Developing GitLab Duo: AI Impact analytics dashboard measures the ROI of AI](https://about.gitlab.com/blog/2024/05/15/developing-gitlab-duo-ai-impact-analytics-dashboard-measures-the-roi-of-ai/).
56-
- To analyze the performance of teams that use AI versus teams that don't, you can create a custom [Value Streams Dashboard Scheduled Report](https://gitlab.com/explore/catalog/components/vsd-reports-generator) based on the AI Impact view of projects and groups with and without GitLab Duo.
55+
- The baseline for the AI Usage trend is the total number of code contributors, not just users with GitLab Duo seats. This baseline gives a more accurate representation of AI usage by team members. To learn more about AI impact analytics, see the blog post [Developing GitLab Duo: AI impact analytics dashboard measures the ROI of AI](https://about.gitlab.com/blog/2024/05/15/developing-gitlab-duo-ai-impact-analytics-dashboard-measures-the-roi-of-ai/).
56+
- To analyze the performance of teams that use AI versus teams that don't, you can create a custom [Value Streams Dashboard Scheduled Report](https://gitlab.com/explore/catalog/components/vsd-reports-generator) based on the AI impact view of projects and groups with and without GitLab Duo.
5757

5858
NOTE:
5959
Usage rate for Code Suggestions is calculated with data starting from GitLab 16.11.
6060
For more information, see [epic 12978](https://gitlab.com/groups/gitlab-org/-/epics/12978).
6161

62-
## View AI Impact analytics
62+
## View AI impact analytics
6363

6464
Prerequisites:
6565

@@ -70,9 +70,9 @@ Prerequisites:
7070
1. Select **Analyze > Analytics Dashboards**.
7171
1. Select **AI impact analytics**.
7272

73-
To retrieve AI Impact metrics, you can also use the following GraphQL APIs:
73+
To retrieve AI impact metrics, you can also use the following GraphQL APIs:
7474

75-
- [`AiUserMetrics`](../../api/graphql/reference/index.md#aiusermetrics)
75+
- [`AiUserMetrics`](../../api/graphql/reference/index.md#aiusermetrics)
7676
- Requires ClickHouse
7777
- Ultimate with GitLab Duo Pro or Enterprise
7878
- [`AiUsageData`](../../api/graphql/reference/index.md#aiusagedata) - Does not require ClickHouse

doc/user/permissions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Project permissions for [analytics](../user/analytics/index.md) features includi
8282
| View [DORA metrics](analytics/ci_cd_analytics.md) | | ||||| |
8383
| View [merge request analytics](analytics/merge_request_analytics.md) | | ||||| |
8484
| View [repository analytics](analytics/repository_analytics.md) | | ||||| |
85-
| View [Value Streams Dashboard & AI Impact analytics](analytics/value_streams_dashboard.md) | | ||||| |
85+
| View [Value Streams Dashboard & AI impact analytics](analytics/value_streams_dashboard.md) | | ||||| |
8686

8787
### Application security
8888

locale/gitlab.pot

+2-2
Original file line numberDiff line numberDiff line change
@@ -6717,7 +6717,7 @@ msgstr ""
67176717
msgid "Analytics|Invalid visualization configuration"
67186718
msgstr ""
67196719

6720-
msgid "Analytics|Learn more about %{docsLinkStart}AI Impact analytics%{docsLinkEnd} and %{subscriptionLinkStart}GitLab Duo Pro seats usage%{subscriptionLinkEnd}."
6720+
msgid "Analytics|Learn more about %{docsLinkStart}AI impact analytics%{docsLinkEnd} and %{subscriptionLinkStart}GitLab Duo Pro seat usage%{subscriptionLinkEnd}."
67216721
msgstr ""
67226722

67236723
msgid "Analytics|Line chart"
@@ -20565,7 +20565,7 @@ msgstr ""
2056520565
msgid "DuoCodeReview|I have encountered some issues while I was reviewing. Please try again later."
2056620566
msgstr ""
2056720567

20568-
msgid "DuoEnterpriseDiscover|AI Impact analytics dashboard measures the ROI of AI"
20568+
msgid "DuoEnterpriseDiscover|AI Impact Dashboard measures the ROI of AI"
2056920569
msgstr ""
2057020570

2057120571
msgid "DuoEnterpriseDiscover|AI-assisted root cause analysis for CI/CD job failures, and suggested fixes to quickly remedy broken pipelines."

qa/qa/page/merge_request/show.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,9 @@ def merged?
347347
end
348348

349349
match_when_negated do |page|
350-
page.has_no_element?('merge-button', disabled: false)
350+
has_css?('.mr-widget-section', text: 'Merge blocked') || # Merge widget indicates merge is blocked
351+
page.has_no_element?('merge-button') || # No merge button
352+
page.find_element('merge-button').disabled? == true # There is a merge button, but it is disabled
351353
end
352354
end
353355

qa/qa/resource/project.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def wait_for_pull_mirroring
540540
return if mirror_succeeded
541541

542542
mirror_error = api_resource[:import_error] || 'Did not complete within 360 seconds'
543-
raise "Mirroring was not successful: #{mirror_error}}"
543+
raise "Mirroring was not successful: #{mirror_error}"
544544
end
545545

546546
def remove_via_api!

spec/models/diff_note_spec.rb

+26
Original file line numberDiff line numberDiff line change
@@ -633,4 +633,30 @@
633633
end
634634
end
635635
end
636+
637+
describe '#latest_diff_file_path' do
638+
let(:diff_note) { create(:diff_note_on_merge_request, noteable: merge_request, project: project) }
639+
640+
it 'returns the file_path of latest_diff_file' do
641+
expect(diff_note.latest_diff_file_path).to eq(diff_note.latest_diff_file.file_path)
642+
end
643+
end
644+
645+
describe '#raw_truncated_diff_lines' do
646+
let(:diff_note) { build_stubbed(:diff_note_on_merge_request, noteable: merge_request, project: project) }
647+
648+
before do
649+
allow(diff_note)
650+
.to receive_message_chain(:discussion, :truncated_diff_lines)
651+
.and_return([
652+
instance_double(Gitlab::Diff::Line, text: "+line 1"),
653+
instance_double(Gitlab::Diff::Line, text: "+line 2"),
654+
instance_double(Gitlab::Diff::Line, text: "-line 3")
655+
])
656+
end
657+
658+
it 'returns raw truncated diff lines' do
659+
expect(diff_note.raw_truncated_diff_lines).to eq("+line 1\n+line 2\n-line 3")
660+
end
661+
end
636662
end

0 commit comments

Comments
 (0)