Skip to content

Commit 658dd27

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent fcb6fb0 commit 658dd27

File tree

18 files changed

+305
-74
lines changed

18 files changed

+305
-74
lines changed

app/assets/javascripts/vue_shared/components/upload_dropzone/upload_dropzone.vue

+4-5
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export default {
208208
>
209209
<slot>
210210
<button
211-
class="card upload-dropzone-card upload-dropzone-border gl-mb-0 gl-h-full gl-w-full gl-items-center gl-justify-center gl-px-5 gl-py-4"
211+
class="upload-dropzone-card upload-dropzone-border gl-mb-0 gl-h-full gl-w-full gl-items-center gl-justify-center gl-bg-default gl-px-5 gl-py-4"
212212
type="button"
213213
@click="openFileUpload"
214214
@mouseenter="onMouseEnter"
@@ -257,18 +257,17 @@ export default {
257257
<transition name="upload-dropzone-fade">
258258
<div
259259
v-show="showDropzoneOverlay"
260-
class="card gl-absolute gl-flex gl-h-full gl-w-full gl-items-center gl-justify-center gl-p-4"
260+
class="gl-absolute gl-flex gl-h-full gl-w-full gl-items-center gl-justify-center gl-p-4"
261261
:class="{
262-
'design-upload-dropzone-overlay gl-z-200 gl-border-1 gl-border-dashed gl-border-blue-500':
263-
showUploadDesignOverlay && isDragDataValid,
262+
'design-upload-dropzone-overlay gl-z-200': showUploadDesignOverlay && isDragDataValid,
264263
'upload-dropzone-overlay upload-dropzone-border': !showUploadDesignOverlay,
265264
}"
266265
>
267266
<!-- Design Upload Overlay Style for Work Items -->
268267
<template v-if="showUploadDesignOverlay">
269268
<div
270269
v-if="isDragDataValid && !hideUploadTextOnDragging"
271-
class="gl-absolute gl-bottom-6 gl-flex gl-items-center gl-rounded-base gl-bg-blue-950 gl-px-3 gl-py-2 gl-text-white"
270+
class="gl-absolute gl-bottom-6 gl-flex gl-items-center gl-rounded-base gl-bg-feedback-strong gl-px-3 gl-py-2 gl-text-feedback-strong gl-shadow-sm"
272271
data-testid="design-upload-overlay"
273272
>
274273
<gl-animated-upload-icon :is-on="true" name="upload" />

app/assets/javascripts/work_items/components/create_work_item.vue

+17
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import {
6060
WIDGET_TYPE_CUSTOM_FIELDS,
6161
CUSTOM_FIELDS_TYPE_NUMBER,
6262
CUSTOM_FIELDS_TYPE_TEXT,
63+
WORK_ITEM_TYPE_NAME_ISSUE,
6364
} from '../constants';
6465
import createWorkItemMutation from '../graphql/create_work_item.mutation.graphql';
6566
import namespaceWorkItemTypesQuery from '../graphql/namespace_work_item_types.query.graphql';
@@ -353,6 +354,14 @@ export default {
353354
return false;
354355
}
355356
357+
// Hide Parent widget on Epic or Issue creation according to license permissions
358+
if (
359+
this.selectedWorkItemTypeName === WORK_ITEM_TYPE_NAME_ISSUE ||
360+
this.selectedWorkItemTypeName === WORK_ITEM_TYPE_NAME_EPIC
361+
) {
362+
if (!this.validateAllowedParentTypes(this.selectedWorkItemTypeName).length) return false;
363+
}
364+
356365
return Boolean(this.workItemHierarchy);
357366
},
358367
workItemCrmContacts() {
@@ -578,6 +587,14 @@ export default {
578587
updateTitle(newValue) {
579588
this.workItemTitle = newValue;
580589
},
590+
validateAllowedParentTypes(selectedWorkItemType) {
591+
return (
592+
this.workItemTypes
593+
?.find((type) => type.name === selectedWorkItemType)
594+
?.widgetDefinitions.find((widget) => widget.type === WIDGET_TYPE_HIERARCHY)
595+
.allowedParentTypes?.nodes || []
596+
);
597+
},
581598
isWidgetSupported(widgetType) {
582599
const widgetDefinitions =
583600
this.selectedWorkItemType?.widgetDefinitions?.flatMap((i) => i.type) || [];

app/assets/stylesheets/components/upload_dropzone/upload_dropzone.scss

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313

1414
.upload-dropzone-border {
1515
border: 0;
16-
@include dropzone-background($gray-400, 2);
16+
@include dropzone-background($gl-border-color-default, 2);
1717
border-radius: $gl-border-radius-base;
1818
}
1919

2020
.upload-dropzone-card {
2121
@apply gl-transition-[background,border];
22-
22+
stroke: $gl-border-color-default;
2323
@apply gl-text-default;
2424

2525
&:hover,
2626
&:focus,
2727
&:focus-within,
2828
&:active {
2929
outline: none;
30-
@include dropzone-background($blue-500);
30+
@include dropzone-background($gl-color-blue-500);
3131
@apply gl-text-default;
3232
}
3333

@@ -37,9 +37,6 @@
3737
@apply gl-focus;
3838
}
3939

40-
&:hover {
41-
border-color: $gray-300;
42-
}
4340
}
4441

4542
.upload-dropzone-overlay,
@@ -48,15 +45,18 @@
4845
left: 0;
4946
pointer-events: none;
5047
opacity: 1;
48+
border: 0;
5149
}
5250

5351
.upload-dropzone-overlay {
54-
background-color: $blue-50;
55-
@include dropzone-background($blue-500);
52+
@apply gl-bg-feedback-info;
53+
@include dropzone-background($gl-color-blue-500);
5654
}
5755

5856
.design-upload-dropzone-overlay {
59-
background-color: rgba($blue-500, 0.24);
57+
background-color: color-mix(in srgb, var(--gl-color-blue-500) 24%, transparent);
58+
@include dropzone-background($gl-color-blue-500);
59+
border-radius: $gl-border-radius-base;
6060
}
6161

6262
// These are composite classes for use with Vue Transition

app/views/admin/runners/_project.html.haml

+12-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33

44
%li
55
.gl-flex.gl-gap-3
6-
.gl-w-6
7-
- if assigned
6+
- if assigned
7+
.gl-min-w-6.gl-w-6
88
= sprite_icon('status-success', variant: 'success', css_class: 'gl-mt-3')
9+
- else
10+
.gl-hidden.md:gl-block.gl-w-6
11+
912
= render Pajamas::AvatarComponent.new(project, size: 32, avatar_options: { aria: { hidden: "true" } })
10-
.gl-flex.gl-flex-col.gl-gap-1.gl-grow
11-
%h3.gl-text-base.gl-mt-1.gl-mb-0
13+
.gl-grow.gl-self-center
14+
%h3.gl-m-0.gl-text-base
1215
= project.full_name
13-
%p.gl-text-sm.gl-text-subtle.gl-mb-0
14-
= project.description
15-
= yield
16+
- if project.description
17+
%p.gl-mb-0.gl-text-sm.gl-text-subtle
18+
= project.description
19+
.gl-self-start
20+
= yield
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
4+
# for more information on how to write migrations for GitLab.
5+
6+
class ScheduleRmIndexMergeRequestDiffsOnProjectId < Gitlab::Database::Migration[2.2]
7+
INDEX_NAME = 'index_merge_request_diffs_on_project_id'
8+
9+
milestone '17.11'
10+
11+
def up
12+
prepare_async_index_removal :merge_request_diffs, :project_id, name: INDEX_NAME
13+
end
14+
15+
def down
16+
unprepare_async_index :merge_request_diffs, :project_id, name: INDEX_NAME
17+
end
18+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
class CreateAsyncIndexOnMergeRequestDiffFilesProjectId < Gitlab::Database::Migration[2.2]
4+
disable_ddl_transaction!
5+
6+
milestone '17.11'
7+
8+
INDEX_NAME = 'index_merge_request_diff_files_on_project_id'
9+
10+
# rubocop:disable Migration/PreventIndexCreation -- https://gitlab.com/gitlab-org/gitlab/-/issues/512949
11+
def up
12+
add_concurrent_index :merge_request_diff_files, :project_id, name: INDEX_NAME
13+
end
14+
15+
def down
16+
remove_concurrent_index_by_name :merge_request_diff_files, INDEX_NAME
17+
end
18+
end
19+
# rubocop:enable Migration/PreventIndexCreation

db/schema_migrations/20250320203919

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6b5fd827691104b82d1e7e25ef95b91eb9597d11ad386b7d7e0103f76e1c5b68

db/schema_migrations/20250403212841

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4664c89faa69430f14b458988b619c5ec93d267317dcfb304576aec13f4119ad

db/structure.sql

+2
Original file line numberDiff line numberDiff line change
@@ -35754,6 +35754,8 @@ CREATE INDEX index_merge_request_diff_details_on_verification_state ON merge_req
3575435754

3575535755
CREATE INDEX index_merge_request_diff_details_pending_verification ON merge_request_diff_details USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0);
3575635756

35757+
CREATE INDEX index_merge_request_diff_files_on_project_id ON merge_request_diff_files USING btree (project_id);
35758+
3575735759
CREATE INDEX index_merge_request_diffs_by_id_partial ON merge_request_diffs USING btree (id) WHERE ((files_count > 0) AND ((NOT stored_externally) OR (stored_externally IS NULL)));
3575835760

3575935761
CREATE INDEX index_merge_request_diffs_on_external_diff ON merge_request_diffs USING btree (external_diff);

doc/development/database/database_lab.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ You must have `AllFeaturesUser` [`psql` access](#access-database-lab-engine) to
142142

143143
To access the database lab instances, you must:
144144

145-
- File an [access request](https://handbook.gitlab.com/handbook/it/end-user-services/onboarding-access-requests/access-requests/#individual-or-bulk-access-request).
145+
- File an [access request](https://handbook.gitlab.com/handbook/it/end-user-services/onboarding-access-requests/access-requests/#individual-or-bulk-access-request), requesting the following:
146+
- `AllFeaturesUser` role in Postgres.ai
147+
- `db-lab` role in `chef-repo`
146148
- Have a user data bag entry in [chef-repo](https://gitlab.com/gitlab-com/gl-infra/chef-repo) with your SSH key and the `db-lab` role.
147149
- Configure `ssh` as follows:
148150

doc/user/application_security/sast/_index.md

+49-21
Original file line numberDiff line numberDiff line change
@@ -513,33 +513,63 @@ For example, to scan a Rust application, you must:
513513
# include any other file extensions you need to scan from the semgrep-sast template: Jobs/SAST.gitlab-ci.yml
514514
```
515515

516-
### Pre-compilation
516+
### Using pre-compilation with SpotBugs analyzer
517517

518-
Most GitLab SAST analyzers directly scan your source code without compiling it first.
519-
However, for technical reasons, the SpotBugs-based analyzer scans compiled bytecode.
520-
521-
By default, the SpotBugs-based analyzer automatically attempts to fetch dependencies and compile your code so it can be scanned.
518+
The SpotBugs-based analyzer scans compiled bytecode for `Groovy` projects. By default, it automatically attempts to fetch dependencies and compile your code so it can be scanned.
522519
Automatic compilation can fail if:
523520

524-
- your project requires custom build configurations.
525-
- you use language versions that aren't built into the analyzer.
521+
- your project requires custom build configurations
522+
- you use language versions that aren't built into the analyzer
526523

527524
To resolve these issues, you should skip the analyzer's compilation step and directly provide artifacts from an earlier stage in your pipeline instead.
528525
This strategy is called _pre-compilation_.
529526

530-
To use pre-compilation:
527+
#### Sharing pre-compiled artifacts
528+
529+
1. Use a compilation job (typically named `build`) to compile your project and store the compiled output as a `job artifact` using [`artifacts: paths`](../../../ci/yaml/_index.md#artifactspaths).
531530

532-
1. Output your project's dependencies to a directory in the project's working directory, then save that directory as an artifact by [setting the `artifacts: paths` configuration](../../../ci/yaml/_index.md#artifactspaths).
533-
1. Provide the `COMPILE: "false"` CI/CD variable to the analyzer job to disable automatic compilation.
534-
1. Add your compilation stage as a dependency for the analyzer job.
531+
- For `Maven` projects, the output folder is usually the `target` directory
532+
- For `Gradle` projects, it's typically the `build` directory
533+
- If your project uses a custom output location, set the artifacts path accordingly
535534

536-
To allow the analyzer to recognize the compiled artifacts, you must explicitly specify the path to
537-
the vendored directory.
538-
This configuration can vary depending on how the project is set up.
539-
For Maven projects, you can use `MAVEN_REPO_PATH`.
540-
See [Analyzer settings](#analyzer-settings) for the complete list of available options.
535+
1. Disable automatic compilation by setting the `COMPILE: "false"` CI/CD variable in the `spotbugs-sast` job.
541536

542-
The following example pre-compiles a Maven project and provides it to the SpotBugs-based SAST analyzer:
537+
1. Ensure the `spotbugs-sast` job depends on the compilation job by setting the `dependencies` keyword. This allows the `spotbugs-sast` job to download and use the artifacts created in the compilation job.
538+
539+
The following example pre-compiles a Gradle project and provides the compiled bytecode to the analyzer:
540+
541+
```yaml
542+
stages:
543+
- build
544+
- test
545+
546+
include:
547+
- template: Jobs/SAST.gitlab-ci.yml
548+
549+
build:
550+
image: gradle:7.6-jdk8
551+
stage: build
552+
script:
553+
- gradle build
554+
artifacts:
555+
paths:
556+
- build/
557+
558+
spotbugs-sast:
559+
dependencies:
560+
- build
561+
variables:
562+
COMPILE: "false"
563+
SECURE_LOG_LEVEL: debug
564+
```
565+
566+
#### Specifying dependencies (Maven only)
567+
568+
If your project requires external dependencies to be recognized by the analyzer and you're using Maven, you can specify the location of the local repository by using the `MAVEN_REPO_PATH` variable.
569+
570+
Specifying dependencies is only supported for Maven-based projects. Other build tools (for example, Gradle) do not have an equivalent mechanism for specifying dependencies. In that case, ensure that your compiled artifacts include all necessary dependencies.
571+
572+
The following example pre-compiles a Maven project and provides the compiled bytecode along with the dependencies to the analyzer:
543573

544574
```yaml
545575
stages:
@@ -565,9 +595,7 @@ spotbugs-sast:
565595
variables:
566596
MAVEN_REPO_PATH: $CI_PROJECT_DIR/.m2/repository
567597
COMPILE: "false"
568-
artifacts:
569-
reports:
570-
sast: gl-sast-report.json
598+
SECURE_LOG_LEVEL: debug
571599
```
572600

573601
### Running jobs in merge request pipelines
@@ -796,7 +824,7 @@ Some analyzers can be customized with CI/CD variables.
796824
| `FAIL_NEVER` | SpotBugs | Set to `1` to ignore compilation failure. |
797825
| `SAST_SEMGREP_METRICS` | Semgrep | Set to `"false"` to disable sending anonymized scan metrics to [r2c](https://semgrep.dev). Default: `true`. |
798826
| `SAST_SCANNER_ALLOWED_CLI_OPTS` | Semgrep | CLI options (arguments with value, or flags) that are passed to the underlying security scanner when running scan operation. Only a limited set of [options](#security-scanner-configuration) are accepted. Separate a CLI option and its value using either a blank space or equals (`=`) character. For example: `name1 value1` or `name1=value1`. Multiple options must be separated by blank spaces. For example: `name1 value1 name2 value2`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/368565) in GitLab 15.3. |
799-
| `SAST_RULESET_GIT_REFERENCE` | All | Defines a path to a custom ruleset configuration. If a project has a `.gitlab/sast-ruleset.toml` file committed, that local configuration takes precedence and the file from `SAST_RULESET_GIT_REFERENCE` isnt used. This variable is available for the Ultimate tier only.|
827+
| `SAST_RULESET_GIT_REFERENCE` | All | Defines a path to a custom ruleset configuration. If a project has a `.gitlab/sast-ruleset.toml` file committed, that local configuration takes precedence and the file from `SAST_RULESET_GIT_REFERENCE` isn't used. This variable is available for the Ultimate tier only.|
800828
| `SECURE_ENABLE_LOCAL_CONFIGURATION` | All | Enables the option to use custom ruleset configuration. If `SECURE_ENABLE_LOCAL_CONFIGURATION` is set to `false`, the project's custom ruleset configuration file at `.gitlab/sast-ruleset.toml` is ignored and the file from `SAST_RULESET_GIT_REFERENCE` or the default configuration takes precedence. |
801829

802830
#### Security scanner configuration

doc/user/application_security/sast/troubleshooting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ The SpotBugs-based analyzer is only used for scanning Groovy code, but it may tr
134134
The solution depends on whether you need to scan Groovy code:
135135

136136
- If you don't have any Groovy code, or don't need to scan it, you should [disable the SpotBugs analyzer](analyzers.md#disable-specific-default-analyzers).
137-
- If you do need to scan Groovy code, you should use [pre-compilation](_index.md#pre-compilation).
137+
- If you do need to scan Groovy code, you should use [pre-compilation](_index.md#using-pre-compilation-with-spotbugs-analyzer).
138138
Pre-compilation avoids these failures by scanning an artifact you've already built in your pipeline, rather than trying to compile it in the `spotbugs-sast` job.
139139

140140
### Java out of memory error

doc/user/compliance/compliance_frameworks.md

+10
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ compliance frameworks to a project.
7272
If you create compliance frameworks on subgroups with GraphQL, the framework is created on the root ancestor if the user
7373
has the correct permissions. The GitLab UI presents a read-only view to discourage this behavior.
7474

75+
To apply a compliance framework to a project through a compliance framework:
76+
77+
1. On the left sidebar, select **Search or go to** and find your group.
78+
1. Select **Secure > Compliance center**.
79+
1. On the page, select the **Projects** tab.
80+
1. Hover over a compliance framework, select the **Edit Framework** tab.
81+
1. Select **Projects** section.
82+
1. Select projects from the list.
83+
1. Select **Update Framework**.
84+
7585
## Default compliance frameworks
7686

7787
{{< history >}}

spec/features/work_items/create_issue_work_item_spec.rb

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
expect(page).to have_selector('[data-testid="work-item-assignees"]')
2525
expect(page).to have_selector('[data-testid="work-item-labels"]')
2626
expect(page).to have_selector('[data-testid="work-item-milestone"]')
27-
expect(page).to have_selector('[data-testid="work-item-parent"]')
2827

2928
send_keys 'I am a new issue'
3029
click_button 'Create issue'

0 commit comments

Comments
 (0)