Skip to content

Commit 13bd14b

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 3b1e5a9 commit 13bd14b

File tree

12 files changed

+55
-66
lines changed

12 files changed

+55
-66
lines changed

.rubocop_todo/layout/line_end_string_concatenation_indentation.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ Layout/LineEndStringConcatenationIndentation:
311311
- 'ee/spec/requests/users/registrations_identity_verification_controller_spec.rb'
312312
- 'ee/spec/serializers/integrations/field_entity_spec.rb'
313313
- 'ee/spec/services/boards/epic_lists/destroy_service_spec.rb'
314-
- 'ee/spec/services/ci/destroy_pipeline_service_spec.rb'
315314
- 'ee/spec/services/clusters/agent_tokens/create_service_audit_log_spec.rb'
316315
- 'ee/spec/services/clusters/agent_tokens/revoke_service_audit_log_spec.rb'
317316
- 'ee/spec/services/ee/auth/container_registry_authentication_service_spec.rb'

.rubocop_todo/rspec/context_wording.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,6 @@ RSpec/ContextWording:
23612361
- 'spec/services/ci/create_pipeline_service/tags_spec.rb'
23622362
- 'spec/services/ci/create_pipeline_service_spec.rb'
23632363
- 'spec/services/ci/create_web_ide_terminal_service_spec.rb'
2364-
- 'spec/services/ci/destroy_pipeline_service_spec.rb'
23652364
- 'spec/services/ci/destroy_secure_file_service_spec.rb'
23662365
- 'spec/services/ci/expire_pipeline_cache_service_spec.rb'
23672366
- 'spec/services/ci/find_exposed_artifacts_service_spec.rb'

.rubocop_todo/rspec/named_subject.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2937,7 +2937,6 @@ RSpec/NamedSubject:
29372937
- 'spec/services/ci/create_pipeline_service/parameter_content_spec.rb'
29382938
- 'spec/services/ci/create_web_ide_terminal_service_spec.rb'
29392939
- 'spec/services/ci/deployments/destroy_service_spec.rb'
2940-
- 'spec/services/ci/destroy_pipeline_service_spec.rb'
29412940
- 'spec/services/ci/destroy_secure_file_service_spec.rb'
29422941
- 'spec/services/ci/drop_pipeline_service_spec.rb'
29432942
- 'spec/services/ci/expire_pipeline_cache_service_spec.rb'

.rubocop_todo/rspec/scattered_let.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ RSpec/ScatteredLet:
191191
- 'spec/services/ci/create_downstream_pipeline_service_spec.rb'
192192
- 'spec/services/ci/create_pipeline_service/rules_spec.rb'
193193
- 'spec/services/ci/create_pipeline_service_spec.rb'
194-
- 'spec/services/ci/destroy_pipeline_service_spec.rb'
195194
- 'spec/services/design_management/delete_designs_service_spec.rb'
196195
- 'spec/services/design_management/save_designs_service_spec.rb'
197196
- 'spec/services/discussions/capture_diff_note_positions_service_spec.rb'

app/assets/stylesheets/framework/sidebar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@
774774
.reviewer-merge-icon,
775775
.assignee .merge-icon,
776776
.reviewer .merge-icon {
777-
color: $orange-400;
777+
color: var(--gl-status-warning-icon-color);
778778
position: absolute;
779779
bottom: -3px;
780780
right: -3px;

app/services/ci/destroy_pipeline_service.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ class DestroyPipelineService < BaseService
55
def execute(pipeline)
66
raise Gitlab::Access::AccessDeniedError unless can?(current_user, :destroy_pipeline, pipeline)
77

8+
unsafe_execute(pipeline)
9+
end
10+
11+
def unsafe_execute(pipeline)
812
Ci::ExpirePipelineCacheService.new.execute(pipeline, delete: true)
913

1014
# ensure cancellation happens sync so we accumulate compute minutes successfully

data/deprecations/17-3-codeclimate.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/471677 # (required) Link to the deprecation issue in GitLab
88
body: | # (required) Do not modify this line, instead modify the lines below.
99
In GitLab 18.0, we will remove CodeClimate-based Code Quality scanning.
10-
However, you'll still be able to import results from quality tools by [providing a report as an artifact](https://docs.gitlab.com/ee/ci/testing/code_quality.html#implement-a-custom-tool), just as you can today.
11-
In addition, you can also see this [epic](https://gitlab.com/groups/gitlab-org/-/epics/8790) for new directions considered for Code Quality.
10+
In its place, you should use quality tools directly in your CI/CD pipeline and [provide the tool's report as an artifact](https://docs.gitlab.com/ee/ci/testing/code_quality.html#import-code-quality-results-from-a-cicd-job).
11+
Many tools already support the required report format, and you can integrate them by following the [documented steps](https://docs.gitlab.com/ee/ci/testing/code_quality.html#integrate-common-tools-with-code-quality).
1212
1313
We expect to implement this change by:
1414
@@ -19,4 +19,4 @@
1919
After End of Support in GitLab 18.0, we won't provide further updates.
2020
However, we won't delete previously published container images or remove the ability to run them by using custom CI/CD pipeline job definitions.
2121
22-
For more details and required actions, see the [deprecation issue for this change](https://gitlab.com/gitlab-org/gitlab/-/issues/471677#action-required).
22+
For more details, see [Scan code for quality violations](https://docs.gitlab.com/ee/ci/testing/code_quality.html#scan-code-for-quality-violations).

doc/ci/testing/code_quality.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ You can also [integrate multiple tools](#integrate-multiple-tools).
4343
Many development teams already use linters, style checkers, or other tools in their CI/CD pipelines to automatically detect violations of coding standards.
4444
You can make the findings from these tools easier to see and fix by integrating them with Code Quality.
4545

46-
To integrate a tool with Code Quality:
46+
To see if your tool already has a documented integration, see [Integrate common tools with Code Quality](#integrate-common-tools-with-code-quality).
47+
48+
To integrate a different tool with Code Quality:
4749

4850
1. Add the tool to your CI/CD pipeline.
4951
1. Configure the tool to output a report as a file.
@@ -76,19 +78,6 @@ You can capture results from multiple tools in a single pipeline.
7678
For example, you can run a code linter to scan your code along with a language linter to scan your documentation, or you can use a standalone tool along with CodeClimate-based scanning.
7779
Code Quality combines all of the reports so you see all of them when you [view results](#view-code-quality-results).
7880

79-
Here is an example that returns ESLint output in the necessary format:
80-
81-
```yaml
82-
eslint:
83-
image: node:18-alpine
84-
script:
85-
- npm ci
86-
- npx eslint --format gitlab .
87-
artifacts:
88-
reports:
89-
codequality: gl-code-quality-report.json
90-
```
91-
9281
## View Code Quality results
9382

9483
Code Quality results are shown in the:

doc/update/deprecations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ This is one small step towards moving away from CI/CD templates in preference of
209209
</div>
210210

211211
In GitLab 18.0, we will remove CodeClimate-based Code Quality scanning.
212-
However, you'll still be able to import results from quality tools by [providing a report as an artifact](https://docs.gitlab.com/ee/ci/testing/code_quality.html#implement-a-custom-tool), just as you can today.
213-
In addition, you can also see this [epic](https://gitlab.com/groups/gitlab-org/-/epics/8790) for new directions considered for Code Quality.
212+
In its place, you should use quality tools directly in your CI/CD pipeline and [provide the tool's report as an artifact](https://docs.gitlab.com/ee/ci/testing/code_quality.html#import-code-quality-results-from-a-cicd-job).
213+
Many tools already support the required report format, and you can integrate them by following the [documented steps](https://docs.gitlab.com/ee/ci/testing/code_quality.html#integrate-common-tools-with-code-quality).
214214

215215
We expect to implement this change by:
216216

@@ -221,7 +221,7 @@ Effective immediately, CodeClimate-based scanning will receive only [limited upd
221221
After End of Support in GitLab 18.0, we won't provide further updates.
222222
However, we won't delete previously published container images or remove the ability to run them by using custom CI/CD pipeline job definitions.
223223

224-
For more details and required actions, see the [deprecation issue for this change](https://gitlab.com/gitlab-org/gitlab/-/issues/471677#action-required).
224+
For more details, see [Scan code for quality violations](https://docs.gitlab.com/ee/ci/testing/code_quality.html#scan-code-for-quality-violations).
225225

226226
</div>
227227

doc/user/compliance/license_scanning_of_cyclonedx_files/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ DETAILS:
1414
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/385176) in GitLab 16.4. Feature flags `license_scanning_sbom_scanner` and `package_metadata_synchronization` removed.
1515
> - The legacy License Compliance analyzer (`License-Scanning.gitlab-ci.yml`) was [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/439162) in GitLab 17.0.
1616
> - In GitLab 17.5 we introduced the ability to use a CycloneDX report artifact as a source of data for license information behind the feature flag `license_scanning_with_sbom_licenses`, disabled by default.
17+
> - In GitLab 17.6 the ability to use a CycloneDX report artifact as a source of data for license information has been enabled by default. The feature flag `license_scanning_with_sbom_licenses` is still present to disable the feature if necessary.
1718
1819
To detect the licenses in use, License Compliance relies on running the
1920
[Dependency Scanning CI Jobs](../../application_security/dependency_scanning/index.md),
@@ -210,14 +211,16 @@ CycloneDX reports for licenses. For more information, see the offline [quick sta
210211

211212
## Use CycloneDX report as a source of license information
212213

213-
The ability to use a CI report artifact as a source of license information data was introduced in GitLab 17.5 behind the feature flag `license_scanning_with_sbom_licenses`.
214+
The ability to use a CI report artifact as a source of license information data was introduced in GitLab 17.5 behind the feature flag `license_scanning_with_sbom_licenses` and enabled by default in 17.6.
214215

215216
When the feature flag `license_scanning_with_sbom_licenses` is enabled, the License Scanning uses the [licenses](https://cyclonedx.org/use-cases/#license-compliance) field of the CycloneDX JSON SBOM when available. If the license information is unavailable, the license information imported from the external license database will be used(current behavior).
216217
License information can be provided using a valid SPDX identifier or a license name. However, providing a license using an SPDX License Expression is not supported.
217218
More information about the license field format can be found on the [CycloneDX](https://cyclonedx.org/use-cases/#license-compliance) specification.
218219

219220
Compatible CycloneDX SBOM generators that provide the licenses field can be found in the [CycloneDX Tool Center](https://cyclonedx.org/tool-center/).
220221

222+
Only licenses providing an SPDX identifier are currently supported. Extending this feature beyond SDPX licenses is tracked in [issue 505677](https://gitlab.com/gitlab-org/gitlab/-/issues/505677).
223+
221224
## Troubleshooting
222225

223226
### A CycloneDX file is not being scanned and appears to provide no results

doc/user/duo_workflow/index.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,6 @@ Other risks to be aware of when using Duo Workflow:
9999
goals or messages, as there is a chance it might end up using those in code
100100
or other API calls.
101101

102-
## Duo Workflow use cases
103-
104-
Automate tasks and help increase productivity in your development workflow by using GitLab Duo Workflow.
105-
GitLab Duo Workflow, currently only in your IDE, takes the information you provide
106-
and uses AI to walk you through an implementation plan.
107-
108-
GitLab Duo Workflow supports a wide variety of use cases. Here are a few examples:
109-
110-
- Bootstrap a new project
111-
- Write tests
112-
- Fix a failed pipeline
113-
- Implement a proof of concept for an existing issue
114-
- Comment on a merge request with suggestions
115-
- Optimize CI configuration
116-
117-
These are examples of successful use cases, but it can be used for many more.
118-
119102
## Prerequisites
120103

121104
Before you can use GitLab Duo Workflow:

spec/services/ci/destroy_pipeline_service_spec.rb

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44

55
RSpec.describe ::Ci::DestroyPipelineService, feature_category: :continuous_integration do
66
let_it_be(:project) { create(:project, :repository) }
7+
let_it_be_with_refind(:pipeline) { create(:ci_pipeline, :success, project: project, sha: project.commit.id) }
78

8-
let!(:pipeline) { create(:ci_pipeline, :success, project: project, sha: project.commit.id) }
9-
10-
subject { described_class.new(project, user).execute(pipeline) }
11-
12-
context 'user is owner' do
13-
let(:user) { project.first_owner }
9+
let(:service) { described_class.new(project, user) }
1410

11+
shared_examples 'unsafe_execute' do
1512
it 'destroys the pipeline' do
16-
subject
13+
response
1714

1815
expect { pipeline.reload }.to raise_error(ActiveRecord::RecordNotFound)
1916
end
@@ -23,7 +20,7 @@
2320

2421
expect(project.pipeline_status.has_status?).to be_truthy
2522

26-
subject
23+
response
2724

2825
# We need to reset lazy_latest_pipeline cache to simulate a new request
2926
BatchLoader::Executor.clear_current
@@ -33,22 +30,22 @@
3330
end
3431

3532
it 'does not log an audit event' do
36-
expect { subject }.not_to change { AuditEvent.count }
33+
expect { response }.not_to change { AuditEvent.count }
3734
end
3835

3936
context 'when the pipeline has jobs' do
4037
let!(:build) { create(:ci_build, project: project, pipeline: pipeline) }
4138

4239
it 'destroys associated jobs' do
43-
subject
40+
response
4441

4542
expect { build.reload }.to raise_error(ActiveRecord::RecordNotFound)
4643
end
4744

4845
it 'destroys associated stages' do
4946
stages = pipeline.stages
5047

51-
subject
48+
response
5249

5350
expect(stages).to all(raise_error(ActiveRecord::RecordNotFound))
5451
end
@@ -57,35 +54,34 @@
5754
let!(:artifact) { create(:ci_job_artifact, :archive, job: build) }
5855

5956
it 'destroys associated artifacts' do
60-
subject
57+
response
6158

6259
expect { artifact.reload }.to raise_error(ActiveRecord::RecordNotFound)
6360
end
6461

6562
it 'inserts deleted objects for object storage files' do
66-
expect { subject }.to change { Ci::DeletedObject.count }
63+
expect { response }.to change { Ci::DeletedObject.count }
6764
end
6865
end
6966

7067
context 'when job has trace chunks' do
71-
let(:connection_params) { Gitlab.config.artifacts.object_store.connection.symbolize_keys }
72-
let(:connection) { ::Fog::Storage.new(connection_params) }
73-
7468
before do
7569
stub_object_storage(connection_params: connection_params, remote_directory: 'artifacts')
7670
stub_artifacts_object_storage
7771
end
7872

73+
let(:connection_params) { Gitlab.config.artifacts.object_store.connection.symbolize_keys }
74+
let(:connection) { ::Fog::Storage.new(connection_params) }
7975
let!(:trace_chunk) { create(:ci_build_trace_chunk, :fog_with_data, build: build) }
8076

8177
it 'destroys associated trace chunks' do
82-
subject
78+
response
8379

8480
expect { trace_chunk.reload }.to raise_error(ActiveRecord::RecordNotFound)
8581
end
8682

8783
it 'removes data from object store' do
88-
expect { subject }.to change { Ci::BuildTraceChunks::Fog.new.data(trace_chunk) }
84+
expect { response }.to change { Ci::BuildTraceChunks::Fog.new.data(trace_chunk) }
8985
end
9086
end
9187
end
@@ -104,16 +100,34 @@
104100

105101
expect(cancel_pipeline_service).to receive(:force_execute)
106102

107-
subject
103+
response
108104
end
109105
end
110106
end
111107

112-
context 'user is not owner' do
113-
let(:user) { create(:user) }
108+
describe '#execute' do
109+
subject(:response) { service.execute(pipeline) }
110+
111+
context 'when user is owner' do
112+
let(:user) { project.first_owner }
114113

115-
it 'raises an exception' do
116-
expect { subject }.to raise_error(Gitlab::Access::AccessDeniedError)
114+
it_behaves_like 'unsafe_execute'
117115
end
116+
117+
context 'when user is not owner' do
118+
let(:user) { create(:user) }
119+
120+
it 'raises an exception' do
121+
expect { response }.to raise_error(Gitlab::Access::AccessDeniedError)
122+
end
123+
end
124+
end
125+
126+
describe '#unsafe_execute' do
127+
subject(:response) { service.unsafe_execute(pipeline) }
128+
129+
let(:user) { nil }
130+
131+
it_behaves_like 'unsafe_execute'
118132
end
119133
end

0 commit comments

Comments
 (0)