Skip to content

Commit c0bb2c0

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 380d41a commit c0bb2c0

File tree

32 files changed

+257
-131
lines changed

32 files changed

+257
-131
lines changed

app/assets/stylesheets/framework/emojis.scss

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
gl-emoji {
22
font-style: normal;
3-
display: inline-flex;
3+
display: inline-block;
44
vertical-align: baseline;
55
font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
66
font-size: 1.2em;
77
line-height: 1;
88

99
img {
10-
width: 1.2em;
11-
height: 1.2em;
12-
position: relative;
13-
top: 0.25em;
10+
width: 1em;
11+
object-fit: scale-down;
12+
height: 1em;
1413
}
1514
}
1615

app/assets/stylesheets/framework/variables.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,8 @@ $board-swimlanes-headers-height: 64px;
508508
/*
509509
Source Editor theme overrides
510510
*/
511-
$source-editor-hover-light-text-color: #ececef;
512-
$source-editor-hover-dark-text-color: #333238;
511+
$source-editor-hover-light-text-color: $gl-color-neutral-50;
512+
$source-editor-hover-dark-text-color: $gl-color-neutral-900;
513513

514514
/**
515515
Bootstrap 4.2.0 introduced new icons for validating forms.

app/models/packages/npm/metadatum.rb

-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ class Packages::Npm::Metadatum < ApplicationRecord
1515

1616
scope :package_id_in, ->(package_ids) { where(package_id: package_ids) }
1717

18-
def package_json_scripts
19-
package_json.try(:[], 'scripts')
20-
end
21-
2218
private
2319

2420
def ensure_npm_package_type

app/services/loose_foreign_keys/batch_cleaner_service.rb

+17-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,20 @@ class BatchCleanerService
55
CLEANUP_ATTEMPTS_BEFORE_RESCHEDULE = 3
66
CONSUME_AFTER_RESCHEDULE = 5.minutes
77

8-
def initialize(parent_table:, loose_foreign_key_definitions:, deleted_parent_records:, connection:, modification_tracker: LooseForeignKeys::ModificationTracker.new)
8+
def initialize(
9+
parent_table:,
10+
loose_foreign_key_definitions:,
11+
deleted_parent_records:,
12+
connection:,
13+
logger: Sidekiq.logger,
14+
modification_tracker: LooseForeignKeys::ModificationTracker.new
15+
)
916
@parent_table = parent_table
1017
@loose_foreign_key_definitions = loose_foreign_key_definitions
1118
@deleted_parent_records = deleted_parent_records
1219
@modification_tracker = modification_tracker
1320
@connection = connection
21+
@logger = logger
1422
@deleted_records_counter = Gitlab::Metrics.counter(
1523
:loose_foreign_key_processed_deleted_records,
1624
'The number of processed loose foreign key deleted records'
@@ -54,7 +62,7 @@ def execute
5462

5563
private
5664

57-
attr_reader :parent_table, :loose_foreign_key_definitions, :deleted_parent_records, :modification_tracker, :deleted_records_counter, :deleted_records_rescheduled_count, :deleted_records_incremented_count, :connection
65+
attr_reader :parent_table, :loose_foreign_key_definitions, :deleted_parent_records, :modification_tracker, :deleted_records_counter, :deleted_records_rescheduled_count, :deleted_records_incremented_count, :connection, :logger
5866

5967
def handle_over_limit
6068
records_to_reschedule = []
@@ -82,6 +90,9 @@ def record_result(cleaner, result)
8290
modification_tracker.add_deletions(result[:table], result[:affected_rows])
8391
elsif cleaner.async_nullify?
8492
modification_tracker.add_updates(result[:table], result[:affected_rows])
93+
else
94+
logger.error("Invalid on_delete argument for definition: #{result[:table]}")
95+
false
8596
end
8697
end
8798

@@ -104,14 +115,15 @@ def run_cleaner_service(loose_foreign_key_definition, with_skip_locked:)
104115
loose_foreign_key_definition: loose_foreign_key_definition,
105116
connection: base_model.connection,
106117
deleted_parent_records: deleted_parent_records,
107-
with_skip_locked: with_skip_locked
118+
with_skip_locked: with_skip_locked,
119+
logger: logger
108120
)
109121

110122
loop do
111123
result = cleaner.execute
112-
record_result(cleaner, result)
124+
recorded = record_result(cleaner, result)
113125

114-
break if modification_tracker.over_limit? || result[:affected_rows] == 0
126+
break if modification_tracker.over_limit? || result[:affected_rows] == 0 || !recorded
115127
end
116128
end
117129
end

app/services/loose_foreign_keys/cleaner_service.rb

+7-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ class CleanerService
66
DELETE_LIMIT = 1000
77
UPDATE_LIMIT = 500
88

9-
def initialize(loose_foreign_key_definition:, connection:, deleted_parent_records:, with_skip_locked: false)
9+
def initialize(loose_foreign_key_definition:, connection:, deleted_parent_records:, logger: Sidekiq.logger, with_skip_locked: false)
1010
@loose_foreign_key_definition = loose_foreign_key_definition
1111
@connection = connection
1212
@deleted_parent_records = deleted_parent_records
1313
@with_skip_locked = with_skip_locked
14+
@logger = logger
1415
end
1516

1617
def execute
@@ -29,19 +30,21 @@ def async_nullify?
2930

3031
private
3132

32-
attr_reader :loose_foreign_key_definition, :connection, :deleted_parent_records, :with_skip_locked
33+
attr_reader :loose_foreign_key_definition, :connection, :deleted_parent_records, :with_skip_locked, :logger
3334

3435
def build_query
3536
query = if async_delete?
3637
delete_query
3738
elsif async_nullify?
3839
update_query
3940
else
40-
raise "Invalid on_delete argument: #{loose_foreign_key_definition.on_delete}"
41+
logger.error("Invalid on_delete argument: #{loose_foreign_key_definition.on_delete}")
42+
return ""
4143
end
4244

4345
unless query.include?(%{"#{loose_foreign_key_definition.column}" IN (})
44-
raise("FATAL: foreign key condition is missing from the generated query: #{query}")
46+
logger.error("FATAL: foreign key condition is missing from the generated query: #{query}")
47+
return ""
4548
end
4649

4750
query

app/services/loose_foreign_keys/process_deleted_records_service.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ module LooseForeignKeys
44
class ProcessDeletedRecordsService
55
BATCH_SIZE = 1000
66

7-
def initialize(connection:, modification_tracker: LooseForeignKeys::ModificationTracker.new)
7+
def initialize(connection:, logger: Sidekiq.logger, modification_tracker: LooseForeignKeys::ModificationTracker.new)
88
@connection = connection
99
@modification_tracker = modification_tracker
10+
@logger = logger
1011
end
1112

1213
def execute
@@ -31,6 +32,7 @@ def execute
3132
loose_foreign_key_definitions: loose_foreign_key_definitions,
3233
deleted_parent_records: records,
3334
connection: connection,
35+
logger: logger,
3436
modification_tracker: modification_tracker)
3537
.execute
3638

@@ -55,7 +57,7 @@ def execute
5557

5658
private
5759

58-
attr_reader :connection, :modification_tracker
60+
attr_reader :connection, :logger, :modification_tracker
5961

6062
def db_config_name
6163
::Gitlab::Database.db_config_name(connection)

app/services/packages/npm/check_manifest_coherence_service.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ class CheckManifestCoherenceService
99
MANIFEST_NOT_COHERENT_ERROR = 'Package manifest is not coherent'
1010
VERSION_NOT_COMPLIANT_ERROR = 'Version in package.json is not SemVer compliant'
1111

12-
delegate :npm_metadatum, to: :package, private: true
13-
delegate :package_json_scripts, to: :npm_metadatum, private: true, allow_nil: true
14-
1512
def initialize(package, package_json_entry)
1613
@package = package
1714
@package_json_entry = package_json_entry
@@ -31,8 +28,7 @@ def execute
3128

3229
def coherent?(package_json)
3330
package_json['name'] == package.name &&
34-
same_version?(package_json['version'], package.version) &&
35-
(package_json['scripts'] || {}) == (package_json_scripts || {})
31+
same_version?(package_json['version'], package.version)
3632
end
3733

3834
def same_version?(version1, version2)

app/views/admin/spam_logs/index.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
= render @spam_logs
1717
= paginate_collection @spam_logs
1818
- else
19-
%h4= _('There are no Spam Logs')
19+
%h4= _('There are no spam logs')

app/workers/loose_foreign_keys/cleanup_worker.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def perform
2222
in_lock(self.class.name.underscore, ttl: lock_ttl, retries: 0) do
2323
stats = ProcessDeletedRecordsService.new(
2424
connection: base_model.connection,
25-
modification_tracker: modification_tracker
25+
modification_tracker: modification_tracker,
26+
logger: Sidekiq.logger
2627
).execute
2728
stats[:connection] = connection_name
2829
stats[:turbo_mode] = turbo_mode

db/docs/sbom_sources.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ feature_categories:
77
description: Stores information about where an SBoM component originated from
88
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90812
99
milestone: '15.2'
10-
gitlab_schema: gitlab_main
10+
gitlab_schema: gitlab_sec
1111
sharding_key_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/457096
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
class AddScanStatusToScanResultPolicyViolation < Gitlab::Database::Migration[2.2]
4+
milestone '17.2'
5+
6+
def up
7+
with_lock_retries do
8+
add_column :scan_result_policy_violations,
9+
:status, :integer, null: false, limit: 2, default: 1
10+
end
11+
end
12+
13+
def down
14+
with_lock_retries do
15+
remove_column :scan_result_policy_violations,
16+
:status, :integer
17+
end
18+
end
19+
end

db/schema_migrations/20240708074520

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1100281c2adaaeaa03d97f6a6b43a1bbe2d29bb1702e0ff541d29a15926d1faa

db/structure.sql

+2-3
Original file line numberDiff line numberDiff line change
@@ -17192,7 +17192,8 @@ CREATE TABLE scan_result_policy_violations (
1719217192
created_at timestamp with time zone NOT NULL,
1719317193
updated_at timestamp with time zone NOT NULL,
1719417194
violation_data jsonb,
17195-
approval_policy_rule_id bigint
17195+
approval_policy_rule_id bigint,
17196+
status smallint DEFAULT 1 NOT NULL
1719617197
);
1719717198

1719817199
CREATE SEQUENCE scan_result_policy_violations_id_seq
@@ -21208,8 +21209,6 @@ ALTER TABLE ONLY p_catalog_resource_sync_events ALTER COLUMN id SET DEFAULT next
2120821209

2120921210
ALTER TABLE ONLY p_ci_builds_metadata ALTER COLUMN id SET DEFAULT nextval('ci_builds_metadata_id_seq'::regclass);
2121021211

21211-
ALTER TABLE ONLY p_ci_job_annotations ALTER COLUMN id SET DEFAULT nextval('p_ci_job_annotations_id_seq'::regclass);
21212-
2121321212
ALTER TABLE ONLY packages_build_infos ALTER COLUMN id SET DEFAULT nextval('packages_build_infos_id_seq'::regclass);
2121421213

2121521214
ALTER TABLE ONLY packages_composer_cache_files ALTER COLUMN id SET DEFAULT nextval('packages_composer_cache_files_id_seq'::regclass);

doc/administration/review_spam_logs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ View and resolve spam logs to moderate user activity in your instance.
2323
To view spam logs:
2424

2525
1. On the left sidebar, at the bottom, select **Admin area**.
26-
1. Select **Spam Logs**.
26+
1. Select **Spam logs**.
2727
1. Optional. To resolve a spam log, select **More actions** (**{ellipsis_v}**), then **Remove user**, **Block user**, **Remove log**, or **Trust user**.
2828

2929
### Resolving spam logs

doc/ci/yaml/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ to a pipeline with `include`. Use `include:inputs` to define the values to use w
848848

849849
Use the inputs to customize the behavior of the configuration when included in CI/CD configuration.
850850

851-
Use the interpolation format `$[[ input.input-id ]]` to reference the values outside of the header section.
851+
Use the interpolation format `$[[ inputs.input-id ]]` to reference the values outside of the header section.
852852
Inputs are evaluated and interpolated when the configuration is fetched during pipeline creation, but before the
853853
configuration is merged with the contents of the `.gitlab-ci.yml` file.
854854

doc/development/documentation/styleguide/word_list.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -879,13 +879,6 @@ do not say:
879879

880880
You can use **GA** to indicate general availability if you spell it out on first use.
881881

882-
## Git suggestions
883-
884-
Use sentence case for **Git suggestions**.
885-
886-
On first mention on a page, use **GitLab Duo Git suggestions**.
887-
Thereafter, use **Git suggestions** by itself.
888-
889882
## GitLab
890883

891884
Do not make **GitLab** possessive (GitLab's). This guidance follows [GitLab Trademark Guidelines](https://handbook.gitlab.com/handbook/marketing/brand-and-product-marketing/brand/brand-activation/trademark-guidelines/).
@@ -916,7 +909,7 @@ the following are the names of GitLab Duo features:
916909
- GitLab Duo Vulnerability explanation
917910
- GitLab Duo Vulnerability resolution
918911
- GitLab Duo Test generation
919-
- GitLab Duo Git suggestions
912+
- GitLab Duo for the CLI
920913
- GitLab Duo Root cause analysis
921914
- GitLab Duo Issue description generation
922915

doc/development/spam_protection_and_captcha/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ The possible values include:
5050
- [Spam and CAPTCHA support in the GraphQL API](../../api/graphql/index.md#resolve-mutations-detected-as-spam)
5151
- [Spam and CAPTCHA support in the REST API](../../api/rest/index.md#resolve-requests-detected-as-spam)
5252
- [reCAPTCHA Spam and Anti-bot Protection](../../integration/recaptcha.md)
53-
- [Akismet and Spam Logs](../../integration/akismet.md)
53+
- [Akismet and spam logs](../../integration/akismet.md)

doc/development/spam_protection_and_captcha/model_and_services.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ To do this:
5757

5858
The `SpammableActions::AkismetMarkAsSpamAction` module adds support for a `#mark_as_spam` action
5959
to a controller. This controller allows administrators to manage spam for the associated
60-
`Spammable` model in the [Spam Log section](../../integration/akismet.md) of the Admin area page.
60+
`Spammable` model in the [**Spam log** section](../../integration/akismet.md) of the Admin area page.
6161

6262
1. Include the `SpammableActions::AkismetMarkAsSpamAction` module in the controller.
6363

doc/integration/akismet.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spam issues on public projects. Issues created through the web UI or the API can
1515
Akismet for review, and instance administrators can
1616
[mark snippets as spam](../user/snippets.md#mark-snippet-as-spam).
1717

18-
Detected spam is rejected, and an entry is added in the **Spam Log** section of the
18+
Detected spam is rejected, and an entry is added in the **Spam log** section of the
1919
Admin area.
2020

2121
Privacy note: GitLab submits the user's IP and user agent to Akismet.
@@ -56,12 +56,12 @@ DETAILS:
5656
To better differentiate between spam and ham, you can train the Akismet
5757
filter whenever there is a false positive or false negative.
5858

59-
When an entry is recognized as spam, it is rejected and added to the Spam Logs.
59+
When an entry is recognized as spam, it is rejected and added to the spam logs.
6060
From here you can review if entries are really spam. If one of them is not really
6161
spam, you can use the **Submit as ham** button to tell Akismet that it falsely
6262
recognized an entry as spam.
6363

64-
![Screenshot of Spam Logs](img/spam_log.png)
64+
![Screenshot of spam logs](img/spam_log.png)
6565

6666
If an entry that is actually spam was not recognized as such, you can also submit
6767
this information to Akismet. The **Submit as spam** button is only displayed

doc/security/hardening_nist_800_53.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ requirements:
161161
FedRAMP requires organizations to monitor accounts for atypical use
162162
(AC-2(12)). GitLab empowers users to flag abuse in abuse reports,
163163
where administrators can remove access pending investigation. Spam
164-
logs are consolidated in the Spam Logs section of the Admin area.
164+
logs are consolidated in the **Spam logs** section of the Admin area.
165165
Administrators can remove, block, or trust users flagged in that
166166
area.
167167

doc/tutorials/observability/observability_rails_tutorial.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ To create an application:
9797

9898
1. Find your group ID:
9999
1. On the left sidebar, select **Search or go to** and find the top-level group with the `animal` project. For example, if your project URL is `https://gitlab.com/tankui/observability/animal`, the top-level group is `tanuki`.
100-
1. On the group overview page, in the upper-right corner, select **Actions ({ellipsis_v})**.
100+
1. On the group overview page, in the upper-right corner, select **Actions** (**{ellipsis_v}**).
101101
1. Select **Copy group ID**. Save the copied ID for later.
102102
1. Find your project ID:
103-
1. On the `animal` project overview page, in the upper-right corner, select **Actions ({ellipsis_v})**.
103+
1. On the `animal` project overview page, in the upper-right corner, select **Actions** (**{ellipsis_v}**).
104104
1. Select **Copy project ID**. Save the copied ID for later.
105105

106106
1. Edit `.env` and add the following code:

lib/gitlab/themes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def available_themes
2626
Theme.new(8, s_('NavigationTheme|Light Green'), 'ui-light-green', '#1b653f'),
2727
Theme.new(9, s_('NavigationTheme|Red'), 'ui-red', '#580d02'),
2828
Theme.new(10, s_('NavigationTheme|Light Red'), 'ui-light-red', '#a02e1c'),
29-
Theme.new(2, s_('NavigationTheme|Gray'), 'ui-gray', '#333238'),
29+
Theme.new(2, s_('NavigationTheme|Gray'), 'ui-gray', '#28272d'),
3030
Theme.new(3, s_('NavigationTheme|Neutral'), 'ui-neutral', '#ececef')
3131
]
3232
end

locale/gitlab.pot

+3-3
Original file line numberDiff line numberDiff line change
@@ -53647,9 +53647,6 @@ msgstr ""
5364753647
msgid "There are no SSH keys with access to your account."
5364853648
msgstr ""
5364953649

53650-
msgid "There are no Spam Logs"
53651-
msgstr ""
53652-
5365353650
msgid "There are no approval rules for the given `represent_as` parameter. Use a valid User/Group/Role name instead."
5365453651
msgstr ""
5365553652

@@ -53716,6 +53713,9 @@ msgstr ""
5371653713
msgid "There are no secure files yet."
5371753714
msgstr ""
5371853715

53716+
msgid "There are no spam logs"
53717+
msgstr ""
53718+
5371953719
msgid "There are no topics to show"
5372053720
msgstr ""
5372153721

0 commit comments

Comments
 (0)