Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2024-02-05 03:10:47 +00:00
parent f16e67abfc
commit 8abc28a4a6
38 changed files with 217 additions and 534 deletions

View File

@ -184,7 +184,7 @@ export default {
<h5 class="gl-mt-0!">{{ $options.translations.newTokenMessage }}</h5>
<gl-form-group>
<template #description>
<div class="deploy-token-help-block gl-mt-2">
<div class="gl-mt-2">
<gl-sprintf
:message="$options.translations.newTokenUsernameDescription"
:placeholders="placeholders.link"
@ -211,7 +211,7 @@ export default {
</gl-form-group>
<gl-form-group class="gl-mb-0">
<template #description>
<div class="deploy-token-help-block gl-mt-2">
<div class="gl-mt-2">
<gl-sprintf
:message="$options.translations.newTokenDescription"
:placeholders="placeholders.i"

View File

@ -79,7 +79,7 @@ async function loadEmojiWithNames() {
export async function loadCustomEmojiWithNames() {
const emojiData = { emojis: {}, names: [] };
if (document.body?.dataset?.groupFullPath && window.gon?.features?.customEmoji) {
if (document.body?.dataset?.groupFullPath) {
const client = createApolloClient();
const { data } = await client.query({
query: customEmojiQuery,

View File

@ -233,17 +233,6 @@
}
}
.btn-clipboard {
border: 0;
padding: 0 5px;
svg {
top: auto;
width: 16px;
height: 16px;
}
}
.input-group-prepend,
.input-group-append {
.btn {
@ -256,11 +245,6 @@
&:active {
outline: none;
}
&.btn-clipboard {
padding-left: 15px;
padding-right: 15px;
}
}
.active {

View File

@ -463,10 +463,6 @@
}
}
.btn-clipboard:hover {
color: $gl-text-color;
}
.issuable-sidebar {
height: 100%;
@ -654,26 +650,6 @@
display: none;
}
.btn-clipboard {
/*
This change should be temporary, because the DOM currently gets
generated from a ruby definition in `app/helpers/button_helper.rb`.
As soon as the `copy to clipboard` button will be transferred to
Vue this should be adjusted as well.
*/
flex: 1;
align-self: stretch;
padding: 0;
border: 0;
background: transparent;
color: $gl-text-color-secondary;
&:hover {
color: $gl-text-color;
}
}
&.multiple-users {
display: flex;
justify-content: center;

View File

@ -127,12 +127,6 @@ $comparison-empty-state-height: 62px;
top: 2px;
}
}
.btn-clipboard {
margin-right: 5px;
padding: 0;
background: transparent;
}
}
.merge-request-select {

View File

@ -500,10 +500,6 @@ $system-note-icon-m-left: $avatar-m-left + $icon-size-diff / $avatar-m-ratio;
&:hover {
background-color: $gray-light;
}
.btn-clipboard {
top: 10px;
}
}
.line_content {

View File

@ -58,12 +58,6 @@
}
}
.created-personal-access-token-container {
.btn-clipboard {
border: 1px solid $border-color;
}
}
.codes {
padding-top: 14px;
}

View File

@ -33,23 +33,6 @@
max-width: px-to-rem(500px);
}
.created-deploy-token-container {
.deploy-token-field {
width: 90%;
display: inline;
}
.btn-clipboard {
background-color: var(--white, $white);
border: 1px solid var(--gray-100, $gray-100);
}
.deploy-token-help-block {
display: block;
margin-bottom: 0;
}
}
.deploy-freeze-table {
@media(max-width: map-get($grid-breakpoints, lg)-1) {
.truncated-container {

View File

@ -4,9 +4,5 @@ module Groups
class CustomEmojiController < Groups::ApplicationController
feature_category :code_review_workflow
urgency :low
before_action do
render_404 unless Feature.enabled?(:custom_emoji)
end
end
end

View File

@ -33,16 +33,9 @@ class AwardEmojisFinder
def validate_params
return unless params.present?
validate_name_param unless Feature.enabled?(:custom_emoji)
validate_awarded_by_param
end
def validate_name_param
return unless params[:name]
raise ArgumentError, 'Invalid name param' unless TanukiEmoji.find_by_alpha_code(params[:name].to_s)
end
def validate_awarded_by_param
return unless params[:awarded_by]

View File

@ -12,8 +12,6 @@ module Groups
end
def execute
return CustomEmoji.none if Feature.disabled?(:custom_emoji, group)
return CustomEmoji.for_resource(group) unless params[:include_ancestor_groups]
CustomEmoji.for_namespaces(group_ids_for(group))

View File

@ -28,10 +28,6 @@ module Mutations
description: 'Location of the emoji file.'
def resolve(group_path:, **args)
if Feature.disabled?(:custom_emoji)
raise Gitlab::Graphql::Errors::ResourceNotAvailable, 'Custom emoji feature is disabled'
end
group = authorized_find!(group_path: group_path)
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37911#note_444682238
args[:external] = true

View File

@ -17,10 +17,6 @@ module Mutations
description: 'Global ID of the custom emoji to destroy.'
def resolve(id:)
if Feature.disabled?(:custom_emoji)
raise Gitlab::Graphql::Errors::ResourceNotAvailable, 'Custom emoji feature is disabled'
end
custom_emoji = authorized_find!(id: id)
custom_emoji.destroy!

View File

@ -71,67 +71,6 @@ module ButtonHelper
end
end
# Output a "Copy to Clipboard" button
# Note: This is being replaced by a Pajamas-compliant helper that renders the button
# via ::Pajamas::ButtonComponent. Please use clipboard_button instead.
#
# data - Data attributes passed to `content_tag` (default: {}):
# :text - Text to copy (optional)
# :gfm - GitLab Flavored Markdown to copy, if different from `text` (optional)
# :target - Selector for target element to copy from (optional)
#
# Examples:
#
# # Define the clipboard's text
# clipboard_button(text: "Foo")
# # => "<button class='...' data-clipboard-text='Foo'>...</button>"
#
# # Define the target element
# clipboard_button(target: "div#foo")
# # => "<button class='...' data-clipboard-target='div#foo'>...</button>"
#
# See http://clipboardjs.com/#usage
def deprecated_clipboard_button(data = {})
css_class = data.delete(:class) || 'btn-clipboard gl-button btn-default-tertiary btn-icon btn-sm'
title = data.delete(:title) || _('Copy')
button_text = data[:button_text] || nil
hide_tooltip = data[:hide_tooltip] || false
hide_button_icon = data[:hide_button_icon] || false
item_prop = data[:itemprop] || nil
# This supports code in app/assets/javascripts/copy_to_clipboard.js that
# works around ClipboardJS limitations to allow the context-specific copy/pasting of plain text or GFM.
if text = data.delete(:text)
data[:clipboard_text] =
if gfm = data.delete(:gfm)
{ text: text, gfm: gfm }
else
text
end
end
target = data.delete(:target)
data[:clipboard_target] = target if target
unless hide_tooltip
data = { toggle: 'tooltip', placement: 'bottom', container: 'body' }.merge(data)
end
button_attributes = {
class: "btn #{css_class}",
data: data,
type: :button,
title: title,
aria: { label: title, live: 'polite' },
itemprop: item_prop
}
content_tag :button, button_attributes do
concat(sprite_icon('copy-to-clipboard', css_class: ['gl-icon', *('gl-button-icon' unless button_text.nil?)].join(' '))) unless hide_button_icon
concat(content_tag(:span, button_text, class: 'gl-button-text')) unless button_text.nil?
end
end
def http_clone_button(container, append_link: true)
protocol = gitlab_config.protocol.upcase
dropdown_description = http_dropdown_description(protocol)

View File

@ -196,7 +196,6 @@ module GroupsHelper
end
def new_custom_emoji_path(group)
return unless Feature.enabled?(:custom_emoji)
return unless group
return unless can?(current_user, :create_custom_emoji, group)

View File

@ -48,7 +48,7 @@ class CustomEmoji < ApplicationRecord
alias_attribute :url, :file # this might need a change in https://gitlab.com/gitlab-org/gitlab/-/issues/230467
scope :for_resource, -> (resource) do
return none if resource.nil? || Feature.disabled?(:custom_emoji, resource)
return none if resource.nil?
return none unless resource.is_a?(Group)
resource.custom_emoji

View File

@ -5,7 +5,7 @@
= render Pajamas::ButtonComponent.new(icon: 'ellipsis_v', category: :tertiary, button_options: { class: 'note-action-button more-actions-toggle has-tooltip', data: { title: 'More actions', toggle: 'dropdown', container: 'body', testid: 'more-actions-dropdown' }})
%ul.dropdown-menu.more-actions-dropdown.dropdown-open-left
%li
= clipboard_button(text: noteable_note_url(note), title: _('Copy reference'), button_text: _('Copy link'), class: 'btn-clipboard gl-rounded-0!', size: :medium, hide_tooltip: true, hide_button_icon: true)
= clipboard_button(text: noteable_note_url(note), title: _('Copy reference'), button_text: _('Copy link'), class: 'gl-rounded-0!', size: :medium, hide_tooltip: true, hide_button_icon: true)
- unless is_current_user
.gl-ml-n2
.js-report-abuse-dropdown-item{ data: { report_abuse_path: add_category_abuse_reports_path, reported_user_id: note.author.id, reported_from_url: noteable_note_url(note) } }

View File

@ -1,8 +0,0 @@
---
name: custom_emoji
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37911
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/231317
milestone: '13.6'
type: development
group: group::project management
default_enabled: true

View File

@ -8,4 +8,4 @@
body: | # (required) Don't change this line.
GitLab 17.0 drops Dependency Scanning support for Maven versions below 3.8.8.
Maven versions below 3.6.3 have reached their end-of-life. Users are advised to upgrade to 3.8.8 or greater.
Users are advised to upgrade to 3.8.8 or greater.

View File

@ -775,7 +775,7 @@ The following configuration example:
- [Uses the new configuration structure](../../../update/versions/gitlab_16_changes.md#gitaly-configuration-structure-change) required from GitLab 16.0.
- Ignores five common check failures.
[The Gitaly documentation has more details](../../gitaly/configure_gitaly.md#repository-consistency-checks)
[The Gitaly documentation has more details](../../gitaly/consistency_checks.md)
about other Git check failures and older versions of GitLab.
```ruby

View File

@ -1122,150 +1122,6 @@ sum(rate(gitaly_catfile_cache_total{type="hit"}[5m])) / sum(rate(gitaly_catfile_
Configure the `cat-file` cache in the [Gitaly configuration file](reference.md).
## Repository consistency checks
Gitaly runs repository consistency checks:
- When triggering a repository check.
- When changes are fetched from a mirrored repository.
- When users push changes into repository.
These consistency checks verify that a repository has all required objects and
that these objects are valid objects. They can be categorized as:
- Basic checks that assert that a repository doesn't become corrupt. This
includes connectivity checks and checks that objects can be parsed.
- Security checks that recognize objects that are suitable to exploit past
security-related bugs in Git.
- Cosmetic checks that verify that all object metadata is valid. Older Git
versions and other Git implementations may have produced objects with invalid
metadata, but newer versions can interpret these malformed objects.
Removing malformed objects that fail the consistency checks requires a
rewrite of the repository's history, which often can't be done. Therefore,
Gitaly by default disables consistency checks for a range of cosmetic issues
that don't negatively impact repository consistency.
By default, Gitaly doesn't disable basic or security-related checks so
to not distribute objects that can trigger known vulnerabilities in Git
clients. This also limits the ability to import repositories containing such
objects even if the project doesn't have malicious intent.
### Override repository consistency checks
Instance administrators can override consistency checks if they must
process repositories that do not pass consistency checks.
For Linux package installations, edit `/etc/gitlab/gitlab.rb` and set the
following keys (in this example, to disable the `hasDotgit` consistency check):
- In [GitLab 15.10](https://gitlab.com/gitlab-org/gitaly/-/issues/4754) and later:
```ruby
ignored_blobs = "/etc/gitlab/instance_wide_ignored_git_blobs.txt"
gitaly['configuration'] = {
# ...
git: {
# ...
config: [
# Populate a file with one unabbreviated SHA-1 per line.
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-fsckskipList
{ key: "fsck.skipList", value: ignored_blobs },
{ key: "fetch.fsck.skipList", value: ignored_blobs },
{ key: "receive.fsck.skipList", value: ignored_blobs },
{ key: "fsck.hasDotgit", value: "ignore" },
{ key: "fetch.fsck.hasDotgit", value: "ignore" },
{ key: "receive.fsck.hasDotgit", value: "ignore" },
{ key: "fsck.missingSpaceBeforeEmail", value: "ignore" },
],
},
}
```
- In [GitLab 15.3](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6800) to GitLab 15.9:
```ruby
ignored_blobs = "/etc/gitlab/instance_wide_ignored_git_blobs.txt"
gitaly['gitconfig'] = [
# Populate a file with one unabbreviated SHA-1 per line.
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-fsckskipList
{ key: "fsck.skipList", value: ignored_blobs },
{ key: "fetch.fsck.skipList", value: ignored_blobs },
{ key: "receive.fsck.skipList", value: ignored_blobs },
{ key: "fsck.hasDotgit", value: "ignore" },
{ key: "fetch.fsck.hasDotgit", value: "ignore" },
{ key: "receive.fsck.hasDotgit", value: "ignore" },
{ key: "fsck.missingSpaceBeforeEmail", value: "ignore" },
]
```
- In GitLab 15.2 and earlier (legacy method):
```ruby
ignored_git_errors = [
"hasDotgit = ignore",
"missingSpaceBeforeEmail = ignore",
]
omnibus_gitconfig['system'] = {
# Populate a file with one unabbreviated SHA-1 per line.
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-fsckskipList
"fsck.skipList" => ignored_blobs
"fetch.fsck.skipList" => ignored_blobs,
"receive.fsck.skipList" => ignored_blobs,
"fsck" => ignored_git_errors,
"fetch.fsck" => ignored_git_errors,
"receive.fsck" => ignored_git_errors,
}
```
For self-compiled installations, edit the Gitaly configuration (`gitaly.toml`) to do the
equivalent:
```toml
[[git.config]]
key = "fsck.hasDotgit"
value = "ignore"
[[git.config]]
key = "fetch.fsck.hasDotgit"
value = "ignore"
[[git.config]]
key = "receive.fsck.hasDotgit"
value = "ignore"
[[git.config]]
key = "fsck.missingSpaceBeforeEmail"
value = "ignore"
[[git.config]]
key = "fetch.fsck.missingSpaceBeforeEmail"
value = "ignore"
[[git.config]]
key = "receive.fsck.missingSpaceBeforeEmail"
value = "ignore"
[[git.config]]
key = "fsck.skipList"
value = "/etc/gitlab/instance_wide_ignored_git_blobs.txt"
[[git.config]]
key = "fetch.fsck.skipList"
value = "/etc/gitlab/instance_wide_ignored_git_blobs.txt"
[[git.config]]
key = "receive.fsck.skipList"
value = "/etc/gitlab/instance_wide_ignored_git_blobs.txt"
```
## Configure commit signing for GitLab UI commits
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/19185) in GitLab 15.4.

View File

@ -0,0 +1,175 @@
---
stage: Systems
group: Gitaly
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
---
# Repository consistency checks
Gitaly runs repository consistency checks:
- When triggering a repository check.
- When changes are fetched from a mirrored repository.
- When users push changes into repository.
These consistency checks verify that a repository has all required objects and
that these objects are valid objects. They can be categorized as:
- Basic checks that assert that a repository doesn't become corrupt. This
includes connectivity checks and checks that objects can be parsed.
- Security checks that recognize objects that are suitable to exploit past
security-related bugs in Git.
- Cosmetic checks that verify that all object metadata is valid. Older Git
versions and other Git implementations may have produced objects with invalid
metadata, but newer versions can interpret these malformed objects.
Removing malformed objects that fail the consistency checks requires a
rewrite of the repository's history, which often can't be done. Therefore,
Gitaly by default [disables consistency checks for a range of cosmetic issues](#disabled-checks)
that don't negatively impact repository consistency.
By default, Gitaly doesn't disable basic or security-related checks so
to not distribute objects that can trigger known vulnerabilities in Git
clients. This also limits the ability to import repositories containing such
objects even if the project doesn't have malicious intent.
## Override repository consistency checks
Instance administrators can override consistency checks if they must
process repositories that do not pass consistency checks.
For Linux package installations, edit `/etc/gitlab/gitlab.rb` and set the
following keys (in this example, to disable the `hasDotgit` consistency check):
- In [GitLab 15.10](https://gitlab.com/gitlab-org/gitaly/-/issues/4754) and later:
```ruby
ignored_blobs = "/etc/gitlab/instance_wide_ignored_git_blobs.txt"
gitaly['configuration'] = {
# ...
git: {
# ...
config: [
# Populate a file with one unabbreviated SHA-1 per line.
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-fsckskipList
{ key: "fsck.skipList", value: ignored_blobs },
{ key: "fetch.fsck.skipList", value: ignored_blobs },
{ key: "receive.fsck.skipList", value: ignored_blobs },
{ key: "fsck.hasDotgit", value: "ignore" },
{ key: "fetch.fsck.hasDotgit", value: "ignore" },
{ key: "receive.fsck.hasDotgit", value: "ignore" },
{ key: "fsck.missingSpaceBeforeEmail", value: "ignore" },
],
},
}
```
- In [GitLab 15.3](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6800) to GitLab 15.9:
```ruby
ignored_blobs = "/etc/gitlab/instance_wide_ignored_git_blobs.txt"
gitaly['gitconfig'] = [
# Populate a file with one unabbreviated SHA-1 per line.
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-fsckskipList
{ key: "fsck.skipList", value: ignored_blobs },
{ key: "fetch.fsck.skipList", value: ignored_blobs },
{ key: "receive.fsck.skipList", value: ignored_blobs },
{ key: "fsck.hasDotgit", value: "ignore" },
{ key: "fetch.fsck.hasDotgit", value: "ignore" },
{ key: "receive.fsck.hasDotgit", value: "ignore" },
{ key: "fsck.missingSpaceBeforeEmail", value: "ignore" },
]
```
- In GitLab 15.2 and earlier (legacy method):
```ruby
ignored_git_errors = [
"hasDotgit = ignore",
"missingSpaceBeforeEmail = ignore",
]
omnibus_gitconfig['system'] = {
# Populate a file with one unabbreviated SHA-1 per line.
# See https://git-scm.com/docs/git-config#Documentation/git-config.txt-fsckskipList
"fsck.skipList" => ignored_blobs
"fetch.fsck.skipList" => ignored_blobs,
"receive.fsck.skipList" => ignored_blobs,
"fsck" => ignored_git_errors,
"fetch.fsck" => ignored_git_errors,
"receive.fsck" => ignored_git_errors,
}
```
For self-compiled installations, edit the Gitaly configuration (`gitaly.toml`) to do the
equivalent:
```toml
[[git.config]]
key = "fsck.hasDotgit"
value = "ignore"
[[git.config]]
key = "fetch.fsck.hasDotgit"
value = "ignore"
[[git.config]]
key = "receive.fsck.hasDotgit"
value = "ignore"
[[git.config]]
key = "fsck.missingSpaceBeforeEmail"
value = "ignore"
[[git.config]]
key = "fetch.fsck.missingSpaceBeforeEmail"
value = "ignore"
[[git.config]]
key = "receive.fsck.missingSpaceBeforeEmail"
value = "ignore"
[[git.config]]
key = "fsck.skipList"
value = "/etc/gitlab/instance_wide_ignored_git_blobs.txt"
[[git.config]]
key = "fetch.fsck.skipList"
value = "/etc/gitlab/instance_wide_ignored_git_blobs.txt"
[[git.config]]
key = "receive.fsck.skipList"
value = "/etc/gitlab/instance_wide_ignored_git_blobs.txt"
```
## Disabled checks
So that Gitaly can still work with repositories with certain malformed characteristics that don't impact security or
Gitaly clients, Gitaly disables a
[subset of cosmetic checks](https://gitlab.com/gitlab-org/gitaly/-/blob/79643229c351d39a7b16d90b6023ebe5f8108c16/internal/git/command_description.go#L483-524)
by default.
For the full list of consistency checks, see the [Git documentation](https://git-scm.com/docs/git-fsck#_fsck_messages).
### `badTimezone`
The `badTimezone` check is disabled because there was a bug in Git that caused users to create commits with invalid
timezones. As a result, some Git logs contain commits that do not match the specification. Because Gitaly runs `fsck`
on received `packfiles` by default, any push containing such commits would be rejected.
### `missingSpaceBeforeDate`
The `missingSpaceBeforeDate` check is disabled because `git-fsck(1)` fails when a signature does not have a space
between the mail and the date, or the date is completely missing. This could be caused by a variety of issues, including
misbehaving Git clients.
### `zeroPaddedFilemode`
The `zeroPaddedFilemode` check is disabled because older Git versions used to zero-pad some file modes. For
example, instead of a file mode of `40000`, the tree object would have encoded the file mode as `040000`.

View File

@ -20,6 +20,10 @@ committed to a repository. GitLab administrators can:
`git fsck` against all repositories and generate repository checksums, as a way to compare repositories on different
servers.
Checks that aren't manually run on the command line are executed through a Gitaly node. For information on Gitaly
repository consistency checks, some disabled checks, and how to configure consistency checks, see
[Repository consistency checks](gitaly/consistency_checks.md).
## Check a project's repository using GitLab UI
To check a project's repository using GitLab UI:

View File

@ -13,10 +13,7 @@ DETAILS:
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37911) in GitLab 13.6 [with a flag](../../administration/feature_flags.md) named `custom_emoji`. Disabled by default.
> - Enabled on GitLab.com in GitLab 14.0.
> - [Enabled on self-managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138969) in GitLab 16.7.
FLAG:
On self-managed GitLab, by default this feature is available. To hide the feature, an administrator can [disable the feature flag](../../administration/feature_flags.md) named `custom_emoji`.
This feature is ready for production use.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/) in GitLab 16.9. Feature flag `custom_emoji` removed.
To use [custom emoji](../../user/emoji_reactions.md) in comments and descriptions, you can add them to a top-level group using the GraphQL API.

View File

@ -698,21 +698,18 @@ paths:
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
required:
- branch
- ref
properties:
branch:
type: string
description: The name of the branch
ref:
type: string
description: Create branch from commit sha or existing branch
- name: branch
in: query
description: The name of the branch
required: true
schema:
type: string
- name: ref
in: query
description: Create branch from commit sha or existing branch
required: true
schema:
type: string
responses:
201:
description: Create branch

View File

@ -526,7 +526,7 @@ Users are advised to use [License scanning of CycloneDX files](https://docs.gitl
GitLab 17.0 drops Dependency Scanning support for Maven versions below 3.8.8.
Maven versions below 3.6.3 have reached their end-of-life. Users are advised to upgrade to 3.8.8 or greater.
Users are advised to upgrade to 3.8.8 or greater.
</div>

View File

@ -52,11 +52,7 @@ To remove an emoji reaction, select the emoji again.
> - Enabled on GitLab.com in GitLab 14.0.
> - UI to add emoji [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/333095) in GitLab 16.2.
> - [Enabled on self-managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138969) in GitLab 16.7.
FLAG:
On self-managed GitLab, by default this feature is available. To hide the feature, an administrator can [disable the feature flag](../administration/feature_flags.md) named `custom_emoji`.
On GitLab.com, this feature is available.
This feature is ready for production use.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/) in GitLab 16.9. Feature flag `custom_emoji` removed.
Custom emoji show in the emoji picker everywhere you can react with emoji.

View File

@ -79,7 +79,6 @@ module Gitlab
push_frontend_feature_flag(:ui_for_organizations, current_user)
# To be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/399248
push_frontend_feature_flag(:remove_monitor_metrics)
push_frontend_feature_flag(:custom_emoji)
push_frontend_feature_flag(:encoding_logs_tree)
push_frontend_feature_flag(:group_user_saml)
end

View File

@ -12,23 +12,7 @@ RSpec.describe AwardEmojisFinder do
let_it_be(:issue_2_thumbsup) { create(:award_emoji, name: 'thumbsup', awardable: issue_2) }
let_it_be(:issue_2_thumbsdown) { create(:award_emoji, name: 'thumbsdown', awardable: issue_2) }
before do
stub_feature_flags(custom_emoji: false)
end
describe 'param validation' do
it 'raises an error if `name` is invalid' do
expect { described_class.new(issue_1, { name: 'invalid' }).execute }.to raise_error(
ArgumentError,
'Invalid name param'
)
end
it 'does not raise an error if `name` is numeric' do
subject = described_class.new(issue_1, { name: 100 })
expect { subject.execute }.not_to raise_error
end
it 'raises an error if `awarded_by` is invalid' do
expectation = [ArgumentError, 'Invalid awarded_by param']

View File

@ -920,18 +920,6 @@ describe('emoji', () => {
createMockEmojiClient();
});
describe('flag disabled', () => {
beforeEach(() => {
window.gon = {};
});
it('returns empty emoji data', async () => {
const result = await loadCustomEmojiWithNames();
expect(result).toEqual({ emojis: {}, names: [] });
});
});
describe('when not in a group', () => {
beforeEach(() => {
delete document.body.dataset.groupFullPath;

View File

@ -244,74 +244,6 @@ RSpec.describe ButtonHelper do
end
end
describe 'deprecated_clipboard_button' do
include IconsHelper
let(:user) { create(:user) }
let(:project) { build_stubbed(:project) }
def element(data = {})
element = helper.deprecated_clipboard_button(data)
Nokogiri::HTML::DocumentFragment.parse(element).first_element_child
end
before do
allow(helper).to receive(:current_user).and_return(user)
end
context 'with default options' do
context 'when no `text` attribute is not provided' do
it 'shows copy to clipboard button with default configuration and no text set to copy' do
expect(element.attr('class')).to eq('btn btn-clipboard gl-button btn-default-tertiary btn-icon btn-sm')
expect(element.attr('title')).to eq('Copy')
expect(element.attr('type')).to eq('button')
expect(element.attr('aria-label')).to eq('Copy')
expect(element.attr('aria-live')).to eq('polite')
expect(element.attr('data-toggle')).to eq('tooltip')
expect(element.attr('data-placement')).to eq('bottom')
expect(element.attr('data-container')).to eq('body')
expect(element.attr('data-clipboard-text')).to eq(nil)
expect(element.attr('itemprop')).to eq(nil)
expect(element.inner_text).to eq("")
expect(element.to_html).to include sprite_icon('copy-to-clipboard', css_class: 'gl-icon')
end
end
context 'when `text` attribute is provided' do
it 'shows copy to clipboard button with provided `text` to copy' do
expect(element(text: 'Hello World!').attr('data-clipboard-text')).to eq('Hello World!')
end
end
context 'when `title` attribute is provided' do
it 'shows copy to clipboard button with provided `title` as tooltip' do
expect(element(title: 'Copy to my clipboard!').attr('aria-label')).to eq('Copy to my clipboard!')
end
end
end
context 'with `hide_tooltip` attribute provided' do
it 'shows copy to clipboard button without tooltip support' do
expect(element(hide_tooltip: true).attr('data-placement')).to eq(nil)
expect(element(hide_tooltip: true).attr('data-toggle')).to eq(nil)
expect(element(hide_tooltip: true).attr('data-container')).to eq(nil)
end
end
context 'with `hide_button_icon` attribute provided' do
it 'shows copy to clipboard button without tooltip support' do
expect(element(hide_button_icon: true).to_html).not_to include sprite_icon('duplicate')
end
end
context 'with `itemprop` attribute provided' do
it 'shows copy to clipboard button with `itemprop` attribute' do
expect(element(itemprop: "identifier").attr('itemprop')).to eq("identifier")
end
end
end
describe '#link_button_to', feature_category: :design_system do
let(:content) { 'Button content' }
let(:href) { '#' }

View File

@ -569,38 +569,28 @@ RSpec.describe GroupsHelper, feature_category: :groups_and_projects do
let_it_be(:group) { create(:group) }
context 'with feature flag disabled' do
context 'with nil group' do
let(:group) { nil }
it { is_expected.to eq(nil) }
end
context 'with current_user who has no permissions' do
before do
stub_feature_flags(custom_emoji: false)
allow(helper).to receive(:current_user).and_return(create(:user))
end
it { is_expected.to eq(nil) }
end
context 'with feature flag enabled' do
context 'with nil group' do
let(:group) { nil }
it { is_expected.to eq(nil) }
context 'with current_user who has permissions' do
before do
user = create(:user)
group.add_owner(user)
allow(helper).to receive(:current_user).and_return(user)
end
context 'with current_user who has no permissions' do
before do
allow(helper).to receive(:current_user).and_return(create(:user))
end
it { is_expected.to eq(nil) }
end
context 'with current_user who has permissions' do
before do
user = create(:user)
group.add_owner(user)
allow(helper).to receive(:current_user).and_return(user)
end
it { is_expected.to eq(new_group_custom_emoji_path(group)) }
end
it { is_expected.to eq(new_group_custom_emoji_path(group)) }
end
end

View File

@ -329,18 +329,6 @@ RSpec.describe AwardEmoji, feature_category: :team_planning do
expect(new_award.url).to eq(custom_emoji.url)
end
end
context 'feature flag disabled' do
before do
stub_feature_flags(custom_emoji: false)
end
it 'does not query' do
new_award = build_award(custom_emoji.name)
expect(ActiveRecord::QueryRecorder.new { new_award.url }.count).to be_zero
end
end
end
describe '#to_ability_name' do

View File

@ -53,14 +53,6 @@ RSpec.describe CustomEmoji do
let_it_be(:group) { create(:group) }
let_it_be(:custom_emoji) { create(:custom_emoji, namespace: group) }
context 'when custom_emoji feature flag is disabled' do
before do
stub_feature_flags(custom_emoji: false)
end
it { expect(described_class.for_resource(group)).to eq([]) }
end
context 'when group is nil' do
let_it_be(:group) { nil }

View File

@ -10,7 +10,6 @@ RSpec.describe 'getting custom emoji within namespace', feature_category: :share
let_it_be(:custom_emoji) { create(:custom_emoji, group: group) }
before do
stub_feature_flags(custom_emoji: true)
group.add_developer(current_user)
end
@ -35,16 +34,6 @@ RSpec.describe 'getting custom emoji within namespace', feature_category: :share
expect(graphql_data['group']['customEmoji']['nodes'].first['name']).to eq(custom_emoji.name)
end
it 'returns empty array when the custom_emoji feature flag is disabled' do
stub_feature_flags(custom_emoji: false)
post_graphql(custom_emoji_query(group), current_user: current_user)
expect(response).to have_gitlab_http_status(:ok)
expect(graphql_data['group']).to be_present
expect(graphql_data['group']['customEmoji']['nodes']).to eq([])
end
it 'returns nil group when unauthorised' do
user = create(:user)
post_graphql(custom_emoji_query(group), current_user: user)

View File

@ -39,19 +39,5 @@ RSpec.describe 'Creation of a new Custom Emoji', feature_category: :shared do
expect(gql_response['customEmoji']['name']).to eq(attributes[:name])
expect(gql_response['customEmoji']['url']).to eq(attributes[:url])
end
context 'when the custom_emoji feature flag is disabled' do
before do
stub_feature_flags(custom_emoji: false)
end
it 'does nothing and returns and error' do
expect do
post_graphql_mutation(mutation, current_user: current_user)
end.to not_change(CustomEmoji, :count)
expect_graphql_errors_to_include('Custom emoji feature is disabled')
end
end
end
end

View File

@ -68,20 +68,6 @@ RSpec.describe 'Deletion of custom emoji', feature_category: :shared do
end
it_behaves_like 'deletes custom emoji'
context 'when the custom_emoji feature flag is disabled' do
before do
stub_feature_flags(custom_emoji: false)
end
it_behaves_like 'does not delete custom emoji'
it 'returns an error' do
post_graphql_mutation(mutation, current_user: current_user)
expect_graphql_errors_to_include('Custom emoji feature is disabled')
end
end
end
end
end

View File

@ -6,22 +6,10 @@ RSpec.describe Groups::CustomEmojiController, feature_category: :code_review_wor
let_it_be(:group) { create(:group) }
describe 'GET #index' do
context 'with custom_emoji feature flag disabled' do
before do
stub_feature_flags(custom_emoji: false)
get group_custom_emoji_index_url(group)
end
it { expect(response).to have_gitlab_http_status(:not_found) }
before do
get group_custom_emoji_index_url(group)
end
context 'with custom_emoji feature flag enabled' do
before do
get group_custom_emoji_index_url(group)
end
it { expect(response).to have_gitlab_http_status(:ok) }
end
it { expect(response).to have_gitlab_http_status(:ok) }
end
end