Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-08-01 12:10:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-08-01 12:10:08 +0300
commit1fb5861e0a89e67369a6ab36ffa6dd29d2445bff (patch)
tree801201c3902dea6be771e811830f18e4c4ea4563
parentadc17b84d11174d88a945d51a575292046a51a2c (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/custom_emoji/components/list.vue135
-rw-r--r--app/assets/javascripts/custom_emoji/pages/index.vue60
-rw-r--r--app/assets/javascripts/custom_emoji/queries/custom_emojis.query.graphql19
-rw-r--r--app/controllers/organizations/application_controller.rb2
-rwxr-xr-xbin/feature-flag4
-rw-r--r--doc/development/feature_flags/index.md4
-rw-r--r--doc/development/sql.md5
-rw-r--r--doc/development/testing_guide/best_practices.md4
-rw-r--r--doc/tutorials/build_application.md2
-rw-r--r--doc/tutorials/learn_git.md3
-rw-r--r--doc/tutorials/update_commit_messages/index.md209
-rw-r--r--doc/user/project/web_ide/index.md13
-rw-r--r--locale/gitlab.pot9
-rw-r--r--spec/frontend/custom_emoji/components/__snapshots__/list_spec.js.snap220
-rw-r--r--spec/frontend/custom_emoji/components/list_spec.js45
-rw-r--r--spec/frontend/custom_emoji/mock_data.js8
-rw-r--r--spec/models/ci/bridge_spec.rb2
-rw-r--r--spec/requests/api/npm_group_packages_spec.rb3
-rw-r--r--spec/requests/organizations/organizations_controller_spec.rb8
-rw-r--r--spec/support/shared_contexts/requests/api/npm_packages_shared_context.rb2
-rw-r--r--spec/support/shared_examples/ci/deployable_shared_examples.rb2
21 files changed, 742 insertions, 17 deletions
diff --git a/app/assets/javascripts/custom_emoji/components/list.vue b/app/assets/javascripts/custom_emoji/components/list.vue
new file mode 100644
index 00000000000..82d5f3320b4
--- /dev/null
+++ b/app/assets/javascripts/custom_emoji/components/list.vue
@@ -0,0 +1,135 @@
+<script>
+import { GlLoadingIcon, GlTableLite, GlTabs, GlTab, GlBadge, GlKeysetPagination } from '@gitlab/ui';
+import { __ } from '~/locale';
+import { formatDate } from '~/lib/utils/datetime/date_format_utility';
+
+export default {
+ components: {
+ GlTableLite,
+ GlLoadingIcon,
+ GlTabs,
+ GlTab,
+ GlBadge,
+ GlKeysetPagination,
+ },
+ props: {
+ loading: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
+ customEmojis: {
+ type: Array,
+ required: true,
+ },
+ pageInfo: {
+ type: Object,
+ required: true,
+ },
+ count: {
+ type: Number,
+ required: true,
+ },
+ },
+ methods: {
+ prevPage() {
+ this.$emit('input', {
+ before: this.pageInfo.startCursor,
+ });
+ },
+ nextPage() {
+ this.$emit('input', {
+ after: this.pageInfo.endCursor,
+ });
+ },
+ formatDate(date) {
+ return formatDate(date, 'mmmm d, yyyy');
+ },
+ },
+ primaryAction: {
+ text: __('New custom emoji'),
+ attributes: {
+ variant: 'info',
+ to: '/new',
+ },
+ },
+ fields: [
+ {
+ key: 'emoji',
+ label: __('Image'),
+ thClass: 'gl-border-t-0!',
+ tdClass: 'gl-vertical-align-middle!',
+ columnWidth: '70px',
+ },
+ {
+ key: 'name',
+ label: __('Name'),
+ thClass: 'gl-border-t-0!',
+ tdClass: 'gl-vertical-align-middle! gl-font-monospace',
+ },
+ {
+ key: 'created_at',
+ label: __('Created date'),
+ thClass: 'gl-border-t-0!',
+ tdClass: 'gl-vertical-align-middle!',
+ columnWidth: '25%',
+ },
+ {
+ key: 'action',
+ label: '',
+ thClass: 'gl-border-t-0!',
+ columnWidth: '64px',
+ },
+ ],
+};
+</script>
+
+<template>
+ <div>
+ <gl-loading-icon v-if="loading" size="lg" />
+ <template v-else>
+ <gl-tabs content-class="gl-pt-0" :action-primary="$options.primaryAction">
+ <gl-tab>
+ <template #title>
+ {{ __('Emoji') }}
+ <gl-badge size="sm" class="gl-tab-counter-badge">{{ count }}</gl-badge>
+ </template>
+ <gl-table-lite
+ :items="customEmojis"
+ :fields="$options.fields"
+ table-class="gl-table-layout-fixed"
+ >
+ <template #table-colgroup="scope">
+ <col
+ v-for="field in scope.fields"
+ :key="field.key"
+ :style="{ width: field.columnWidth }"
+ />
+ </template>
+ <template #cell(emoji)="data">
+ <gl-emoji
+ :data-name="data.item.name"
+ :data-fallback-src="data.item.url"
+ data-unicode-version="custom"
+ />
+ </template>
+ <template #cell(action)> </template>
+ <template #cell(created_at)="data">
+ {{ formatDate(data.item.createdAt) }}
+ </template>
+ <template #cell(name)="data">
+ <strong class="gl-str-truncated">:{{ data.item.name }}:</strong>
+ </template>
+ </gl-table-lite>
+ <gl-keyset-pagination
+ v-if="pageInfo.hasPreviousPage || pageInfo.hasNextPage"
+ v-bind="pageInfo"
+ class="gl-mt-4"
+ @prev="prevPage"
+ @next="nextPage"
+ />
+ </gl-tab>
+ </gl-tabs>
+ </template>
+ </div>
+</template>
diff --git a/app/assets/javascripts/custom_emoji/pages/index.vue b/app/assets/javascripts/custom_emoji/pages/index.vue
index 6d32ba41eae..b8e9f0a62d7 100644
--- a/app/assets/javascripts/custom_emoji/pages/index.vue
+++ b/app/assets/javascripts/custom_emoji/pages/index.vue
@@ -1,7 +1,63 @@
<script>
-export default {};
+import { fetchPolicies } from '~/lib/graphql';
+import customEmojisQuery from '../queries/custom_emojis.query.graphql';
+import List from '../components/list.vue';
+
+export default {
+ apollo: {
+ customEmojis: {
+ fetchPolicy: fetchPolicies.NETWORK_ONLY,
+ query: customEmojisQuery,
+ update: (r) => r.group?.customEmoji?.nodes,
+ variables() {
+ return {
+ groupPath: this.groupPath,
+ ...this.pagination,
+ };
+ },
+ result({ data }) {
+ const pageInfo = data.group?.customEmoji?.pageInfo;
+ this.count = data.group?.customEmoji?.count;
+
+ if (pageInfo) {
+ this.pageInfo = pageInfo;
+ }
+ },
+ },
+ },
+ components: {
+ List,
+ },
+ inject: {
+ groupPath: {
+ default: '',
+ },
+ },
+ data() {
+ return {
+ customEmojis: [],
+ count: 0,
+ pageInfo: {},
+ pagination: {},
+ };
+ },
+ methods: {
+ refetchCustomEmojis() {
+ this.$apollo.queries.customEmojis.refetch();
+ },
+ changePage(pageInfo) {
+ this.pagination = pageInfo;
+ },
+ },
+};
</script>
<template>
- <div></div>
+ <list
+ :count="count"
+ :loading="$apollo.queries.customEmojis.loading"
+ :page-info="pageInfo"
+ :custom-emojis="customEmojis"
+ @input="changePage"
+ />
</template>
diff --git a/app/assets/javascripts/custom_emoji/queries/custom_emojis.query.graphql b/app/assets/javascripts/custom_emoji/queries/custom_emojis.query.graphql
new file mode 100644
index 00000000000..5f8af6cf42d
--- /dev/null
+++ b/app/assets/javascripts/custom_emoji/queries/custom_emojis.query.graphql
@@ -0,0 +1,19 @@
+#import "~/graphql_shared/fragments/page_info.fragment.graphql"
+
+query getCustomEmojis($groupPath: ID!, $after: String = "", $before: String = "") {
+ group(fullPath: $groupPath) {
+ id
+ customEmoji(after: $after, before: $before) {
+ count
+ pageInfo {
+ ...PageInfo
+ }
+ nodes {
+ id
+ name
+ url
+ createdAt
+ }
+ }
+ }
+}
diff --git a/app/controllers/organizations/application_controller.rb b/app/controllers/organizations/application_controller.rb
index 43cc7014f62..cce76395cbd 100644
--- a/app/controllers/organizations/application_controller.rb
+++ b/app/controllers/organizations/application_controller.rb
@@ -16,7 +16,7 @@ module Organizations
strong_memoize_attr :organization
def authorize_action!(action)
- access_denied! if Feature.disabled?(:ui_for_organizations)
+ access_denied! if Feature.disabled?(:ui_for_organizations, current_user)
access_denied! unless can?(current_user, action, organization)
end
end
diff --git a/bin/feature-flag b/bin/feature-flag
index be32c80aeab..415adfad9a0 100755
--- a/bin/feature-flag
+++ b/bin/feature-flag
@@ -78,7 +78,7 @@ class FeatureFlagOptionParser
options.dry_run = value
end
- opts.on('-g', '--group [string]', String, "The group introducing a feature flag, like: `group::apm`") do |value|
+ opts.on('-g', '--group [string]', String, "The group introducing a feature flag, like: `group::project management`") do |value|
options.group = value if value.start_with?('group::')
end
@@ -112,7 +112,7 @@ class FeatureFlagOptionParser
def read_group
$stdout.puts
- $stdout.puts ">> Specify the group introducing the feature flag, like `group::apm`:"
+ $stdout.puts ">> Specify the group introducing the feature flag, like `group::project management`:"
loop do
group = Readline.readline('?> ', false)&.strip
diff --git a/doc/development/feature_flags/index.md b/doc/development/feature_flags/index.md
index 7c3b6ff439f..ef453bf873e 100644
--- a/doc/development/feature_flags/index.md
+++ b/doc/development/feature_flags/index.md
@@ -199,7 +199,7 @@ Only feature flags that have a YAML definition file can be used when running the
```shell
$ bin/feature-flag my_feature_flag
->> Specify the group introducing the feature flag, like `group::apm`:
+>> Specify the group introducing the feature flag, like `group::project management`:
?> group::application performance
>> URL of the MR introducing the feature flag (enter to skip):
@@ -557,6 +557,8 @@ to ensure the feature works properly. If automated tests are not included for bo
with the untested code path should be manually tested before deployment to production.
When using the testing environment, all feature flags are enabled by default.
+Flags can be disabled by default in the [`spec/spec_helper.rb` file](https://gitlab.com/gitlab-org/gitlab/-/blob/b61fba42eea2cf5bb1ca64e80c067a07ed5d1921/spec/spec_helper.rb#L274).
+Please add a comment inline to explain why the flag needs to be disabled. You can also attach the issue URL for reference if possible.
WARNING:
This does not apply to end-to-end (QA) tests, which [do not enable feature flags by default](#end-to-end-qa-tests). There is a different [process for using feature flags in end-to-end tests](../testing_guide/end_to_end/feature_flags.md).
diff --git a/doc/development/sql.md b/doc/development/sql.md
index e98d563f31b..1e3e5c7d0f6 100644
--- a/doc/development/sql.md
+++ b/doc/development/sql.md
@@ -354,7 +354,10 @@ values (the new column is missing), because the values are cached within the `Ac
cache. These values are usually populated when the application boots up.
At this point, the only fix would be a full application restart so that the schema cache gets
-updated.
+updated. Since [GitLab 16.1](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121957),
+the schema cache will be automatically reset so that subsequent queries
+will succeed. This reset can be disabled by disabling the `ops` feature
+flag `reset_column_information_on_statement_invalid`.
The problem can be avoided if we always use `SELECT users.*` or we always explicitly define the
columns.
diff --git a/doc/development/testing_guide/best_practices.md b/doc/development/testing_guide/best_practices.md
index 5a4ac99f5c5..4cae8425d58 100644
--- a/doc/development/testing_guide/best_practices.md
+++ b/doc/development/testing_guide/best_practices.md
@@ -488,7 +488,9 @@ We collect information about tests duration in [`rspec_profiling_stats`](https:/
With [issue](https://gitlab.com/gitlab-org/gitlab/-/issues/375983) we defined thresholds for tests duration that can act a guide.
-For tests that are not meeting the thresholds it is recommended to create issues and improve the tests duration.
+For tests that are not meeting the thresholds, we create [issues](https://gitlab.com/gitlab-org/gitlab/-/issues/?sort=created_date&state=opened&label_name%5B%5D=rspec%3Aslow%20test&first_page_size=100) automatically in order to improve them.
+
+For tests that are slow for a legitimate reason and to skip issue creation, add `allowed_to_be_slow: true`.
| Date | Feature tests | Controllers and Requests tests | Unit | Other | Method |
| :-: | :-: | :-: | :-: | :-: | :-: |
diff --git a/doc/tutorials/build_application.md b/doc/tutorials/build_application.md
index 8e53f1ccc6b..2160d8ffd2d 100644
--- a/doc/tutorials/build_application.md
+++ b/doc/tutorials/build_application.md
@@ -38,4 +38,4 @@ Use GitLab Pages to publish a static website directly from your project.
|-------|-------------|--------------------|
| [Create a Pages website from a CI/CD template](../user/project/pages/getting_started/pages_ci_cd_template.md) | Quickly generate a Pages website for your project using a CI/CD template for a popular Static Site Generator (SSG). | **{star}** |
| [Create a Pages website from scratch](../user/project/pages/getting_started/pages_from_scratch.md) | Create all the components of a Pages website from a blank project. | |
-| [Build, test, and deploy your Hugo site with GitLab](/ee/tutorials/hugo/index.md) | Generate your Hugo site using a CI/CD template and GitLab Pages. | **{star}** |
+| [Build, test, and deploy your Hugo site with GitLab](../tutorials/hugo/index.md) | Generate your Hugo site using a CI/CD template and GitLab Pages. | **{star}** |
diff --git a/doc/tutorials/learn_git.md b/doc/tutorials/learn_git.md
index 6df9b3944b7..afc4ef90ffc 100644
--- a/doc/tutorials/learn_git.md
+++ b/doc/tutorials/learn_git.md
@@ -13,5 +13,6 @@ the most out of GitLab.
|-------|-------------|--------------------|
| [Make your first Git commit](make_first_git_commit/index.md) | Create a project, edit a file, and commit changes to a Git repository from the command line. | **{star}** |
| [Start using Git on the command line](../gitlab-basics/start-using-git.md) | Learn how to set up Git, clone repositories, and work with branches. | **{star}** |
-| [Take advantage of Git rebase](https://about.gitlab.com/blog/2022/10/06/take-advantage-of-git-rebase/)| Learn how to use the `rebase` command in your workflow. | |
+| [Take advantage of Git rebase](https://about.gitlab.com/blog/2022/10/06/take-advantage-of-git-rebase/) | Learn how to use the `rebase` command in your workflow. | |
+| [Update Git commit messages](update_commit_messages/index.md) | Learn how to update commit messages and push the changes to GitLab. | |
| [Git cheat sheet](https://about.gitlab.com/images/press/git-cheat-sheet.pdf) | Download a PDF of common Git commands. | |
diff --git a/doc/tutorials/update_commit_messages/index.md b/doc/tutorials/update_commit_messages/index.md
new file mode 100644
index 00000000000..6c316873f4b
--- /dev/null
+++ b/doc/tutorials/update_commit_messages/index.md
@@ -0,0 +1,209 @@
+---
+stage: Create
+group: Source Code
+info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments"
+---
+
+# Tutorial: How to update Git commit messages **(FREE)**
+
+Occasionally, after you've made a few commits to your branch, you realize you need
+to update one or more commit messages. Perhaps you found a typo, or some automation warned you
+that your commit message didn't completely align with a project's
+[commit message guidelines](../../development/contributing/merge_request_workflow.md#commit-messages-guidelines).
+
+Updating the message can be tricky if you don't have much practice with using Git
+from the command line interface (CLI). But don't worry, even if you have only ever worked in
+the GitLab UI, we'll walk you through the steps to use the CLI.
+
+This tutorial explains how to rewrite commit messages in both cases:
+
+- If you work from just the GitLab UI, start at step 1.
+- If you already have your repository cloned locally, you can skip to step 2.
+
+To rewrite any number of commit messages:
+
+1. [Clone your project's repository to your local machine](#clone-your-repository-to-your-local-machine).
+1. [Fetch and check out your branch locally](#fetch-and-check-out-your-branch).
+1. [Update the commit messages](#update-the-commit-messages).
+1. [Push the changes up to GitLab](#push-the-changes-up-to-gitlab).
+
+## Prerequisites
+
+You must have:
+
+- A GitLab project with a Git branch containing commits that you want to update.
+- Git [installed on your local machine](../../topics/git/how_to_install_git/index.md).
+- The ability to get to your local machine's command line interface (CLI). In macOS,
+ you can use Terminal. In Windows, you can use PowerShell. Linux users are probably
+ already familiar with their system's CLI.
+- Familiarity with your system's default editor. This tutorial assumes your editor is Vim,
+ but any text editor should work. If you are unfamiliar with Vim, step 1 to 2 of
+ [Getting started with Vim](https://opensource.com/article/19/3/getting-started-vim)
+ explains all the commands used later in this tutorial.
+- Permission to overwrite the commit messages. If you are working with multiple people in the same branch,
+ you should first verify with them that it's OK to update the commits. Some organizations might
+ have rules against rewriting commits, as it is considered a destructive change.
+
+You need to authenticate with GitLab to overwrite the commit messages in the final step.
+If your GitLab account uses basic username and password authentication, you must have
+[two factor authentication (2FA)](../../user/profile/account/two_factor_authentication.md)
+disabled to authenticate from the CLI. Alternatively, you can [use an SSH key to authenticate with GitLab](../../user/ssh.md).
+
+## Clone your repository to your local machine
+
+The first thing you need to do is get the repository on your local machine:
+
+1. In GitLab, on your project's overview page, on the top right, select **Clone**.
+1. In the dropdown list, copy the URL for your repository by selecting **{copy-to-clipboard}** next to:
+ - **Clone with HTTPS** if your GitLab account uses basic username and password authentication.
+ - **Clone with SSH** if you use SSH to authenticate with GitLab.
+1. Now switch to the CLI (Terminal, PowerShell, or similar) on your local machine, and go to
+ the directory where you want to clone the repository. For example, `/users/my-username/my-projects/`.
+1. Run `git clone` and paste the URL you copied earlier, for example:
+
+ ```shell
+ git clone https://gitlab.com/my-username/my-awesome-project.git
+ ```
+
+ This clones the repository into a new directory called `my-awesome-project/`.
+
+Now your repository is on your computer, ready for your Git CLI commands!
+
+## Fetch and check out your branch
+
+Next we need to check out the branch that contains the commits to update.
+
+1. Assuming you are still at the same place in the CLI as the previous step,
+ change to your project directory with `cd`:
+
+ ```shell
+ cd my-awesome-project
+ ```
+
+1. Optional. If you've just cloned the repository, your branch should already be
+ on your computer too. But if you've previously cloned the repository and skipped
+ to this step, you might need to fetch your branch with:
+
+ ```shell
+ git fetch origin my-branch-name
+ ```
+
+1. Now that you know for sure that the branch is on your local system, switch to it:
+
+ ```shell
+ git checkout my-branch-name
+ ```
+
+1. Verify that it's the correct branch with `git log` and check that the most recent commits
+ match the commits in your branch on GitLab. To exit the log, use `q`.
+
+## Update the commit messages
+
+Now we are ready to update the commit messages:
+
+1. In GitLab, see how far back in the commit history you need to go:
+
+ - If you already have a merge request open for your branch, you can check the
+ **Commits** tab and use the total number of commits.
+ - If you are working from a branch only:
+ 1. Go to **Code > Commits**.
+ 1. Select the dropdown list in the top left and find your branch.
+ 1. Find the oldest commit you want to update, and count how far back that commit is.
+ For example, if you want to update the second and fourth commit, the count would be 4.
+
+1. From the CLI, start an interactive rebase, which is the Git process to update commits.
+ Add the count of commits from the previous step to the end of `HEAD~`, for example:
+
+ ```shell
+ git rebase -i HEAD~4
+ ```
+
+ In this example, Git selects the four most recent commits in the branch to update.
+
+1. Git launches a text editor and lists the selected commits.
+ For example, it should look similar to:
+
+ ```shell
+ pick a0cea50 Fix broken link
+ pick bb84712 Update milestone-plan.md
+ pick ce11fad Add list of maintainers
+ pick d211d03 update template.md
+
+ # Rebase 1f5ec88..d211d03 onto 1f5ec88 (4 commands)
+ #
+ # Commands:
+ # p, pick <commit> = use commit
+ # r, reword <commit> = use commit, but edit the commit message
+ # e, edit <commit> = use commit, but stop for amending
+ # s, squash <commit> = use commit, but meld into previous commit
+ # f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
+ # commit's log message, unless -C is used, in which case
+ # [and so on...]
+ ```
+
+1. The `pick` command tells Git to use the commits without change. You must change
+ the command from `pick` to `reword` for the commits you want to update.
+ Type `i` to enter `INSERT` mode, and then start editing the text.
+
+ For example, to update the text of the second and fourth commits in the sample above,
+ edit it to look like:
+
+ ```shell
+ pick a0cea50 Fix broken link
+ reword bb84712 Update milestone-plan.md
+ pick ce11fad Add list of maintainers
+ reword d211d03 update template.md
+ ```
+
+1. Save the edited text. Press <kbd>Escape</kbd> to exit `INSERT` mode,
+ then type `:wq` and <kbd>Enter</kbd> to save and exit.
+
+1. Git now goes through each commit one at a time and applies the commands we selected.
+ Any commits with `pick` are added back to the branch unchanged. When Git reaches a commit
+ with `reword`, it stops and again opens up the text editor. Now it's time to finally update
+ the text of the commit message!
+
+ - If you only need a one line commit message, update the text as needed. For example:
+
+ ```plaintext
+ Update the monthly milestone plan
+ ```
+
+ - If the commit message needs a title and a body, separate these with a blank line. For example:
+
+ ```plaintext
+ Update the monthly milestone plan
+
+ Make the milestone plan clearer by listing the responsibilities
+ of each maintainer.
+ ```
+
+ After you save and exit, Git updates the commit message, and processes the next
+ commits in order. You should see the message `Successfully rebased and update refs/heads/my-branch-name`
+ when finished.
+
+1. Optional. To verify that the commit messages were updated, you can run `git log`
+ and scroll down to see the commit messages.
+
+## Push the changes up to GitLab
+
+Now all that's left is to push these changes up to GitLab:
+
+1. From the CLI, force push the changes to overwrite what exists in the branch in GitLab.
+
+ ```shell
+ git push -f origin
+ ```
+
+ Your terminal might prompt you for your username and password before overwriting
+ the commit messages in GitLab.
+
+1. In your project in GitLab, verify that the commits have been updated:
+
+ - If you already have a merge request open for your branch, check the **Commits** tab.
+ - If you are working from a branch only:
+ 1. Go to **Code > Commits**.
+ 1. Select the dropdown list in the top left and find your branch.
+ 1. Verify that the relevant commits in the list are now updated.
+
+Congratulations, you have successfully updated your commit messages and pushed them to GitLab!
diff --git a/doc/user/project/web_ide/index.md b/doc/user/project/web_ide/index.md
index 45abcd867c0..72ddd43f72f 100644
--- a/doc/user/project/web_ide/index.md
+++ b/doc/user/project/web_ide/index.md
@@ -217,3 +217,16 @@ You cannot use interactive web terminals to interact with a runner.
However, you can use a terminal to install dependencies and compile and debug code.
For more information about configuring a workspace that supports interactive web terminals, see [remote development](../remote_development/index.md).
+
+## Troubleshooting
+
+When working with the Web IDE, you might encounter the following issues.
+
+### Character offset in the Web IDE
+
+When you type in the Web IDE, you might get a four-character offset. To resolve the issue, do one of the following:
+
+- Add `"editor.disableMonospaceOptimizations": true` to your settings.
+- Modify your `"editor.font"` setting.
+
+For more information, see [VS Code issue 80170](https://github.com/microsoft/vscode/issues/80170).
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index c103a0aafba..ed098833a0d 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -17412,6 +17412,9 @@ msgstr ""
msgid "Embed"
msgstr ""
+msgid "Emoji"
+msgstr ""
+
msgid "Empty file"
msgstr ""
@@ -23567,6 +23570,9 @@ msgstr ""
msgid "Ignored"
msgstr ""
+msgid "Image"
+msgstr ""
+
msgid "ImageDiffViewer|2-up"
msgstr ""
@@ -30672,6 +30678,9 @@ msgstr ""
msgid "New confidential issue title"
msgstr ""
+msgid "New custom emoji"
+msgstr ""
+
msgid "New deploy key"
msgstr ""
diff --git a/spec/frontend/custom_emoji/components/__snapshots__/list_spec.js.snap b/spec/frontend/custom_emoji/components/__snapshots__/list_spec.js.snap
new file mode 100644
index 00000000000..4e87d4d8192
--- /dev/null
+++ b/spec/frontend/custom_emoji/components/__snapshots__/list_spec.js.snap
@@ -0,0 +1,220 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Custom emoji settings list component renders table of custom emoji 1`] = `
+<div>
+ <div
+ class="tabs gl-tabs"
+ >
+ <!---->
+ <div
+ class=""
+ >
+ <ul
+ class="nav gl-tabs-nav"
+ role="tablist"
+ >
+ <div
+ class="gl-actions-tabs-start"
+ data-testid="actions-tabs-start"
+ >
+ <a
+ class="btn btn-info btn-md gl-button"
+ data-testid="action-primary"
+ href="/new"
+ to="/new"
+ >
+ <!---->
+
+ <!---->
+
+ <span
+ class="gl-button-text"
+ >
+
+ New custom emoji
+
+ </span>
+ </a>
+
+ <!---->
+
+ <!---->
+ </div>
+ <div
+ class="gl-actions-tabs-end"
+ data-testid="actions-tabs-end"
+ >
+ <a
+ class="btn btn-info btn-md gl-button"
+ data-testid="action-primary"
+ href="/new"
+ to="/new"
+ >
+ <!---->
+
+ <!---->
+
+ <span
+ class="gl-button-text"
+ >
+
+ New custom emoji
+
+ </span>
+ </a>
+
+ <!---->
+
+ <!---->
+ </div>
+ </ul>
+ </div>
+ <div
+ class="tab-content gl-pt-0 gl-tab-content"
+ >
+ <transition-stub
+ css="true"
+ enteractiveclass=""
+ enterclass=""
+ entertoclass="show"
+ leaveactiveclass=""
+ leaveclass="show"
+ leavetoclass=""
+ mode="out-in"
+ name=""
+ >
+ <div
+ aria-hidden="true"
+ class="tab-pane"
+ role="tabpanel"
+ style="display: none;"
+ >
+
+ <table
+ aria-busy=""
+ aria-colcount="4"
+ class="table b-table gl-table gl-table-layout-fixed"
+ role="table"
+ >
+ <!---->
+ <colgroup>
+ <col
+ style="width: 70px;"
+ />
+ <col />
+ <col
+ style="width: 25%;"
+ />
+ <col
+ style="width: 64px;"
+ />
+ </colgroup>
+ <thead
+ class=""
+ role="rowgroup"
+ >
+ <!---->
+ <tr
+ class=""
+ role="row"
+ >
+ <th
+ aria-colindex="1"
+ class="gl-border-t-0!"
+ role="columnheader"
+ scope="col"
+ >
+ <div>
+ Image
+ </div>
+ </th>
+ <th
+ aria-colindex="2"
+ class="gl-border-t-0!"
+ role="columnheader"
+ scope="col"
+ >
+ <div>
+ Name
+ </div>
+ </th>
+ <th
+ aria-colindex="3"
+ class="gl-border-t-0!"
+ role="columnheader"
+ scope="col"
+ >
+ <div>
+ Created date
+ </div>
+ </th>
+ <th
+ aria-colindex="4"
+ aria-label="Action"
+ class="gl-border-t-0!"
+ role="columnheader"
+ scope="col"
+ >
+ <div />
+ </th>
+ </tr>
+ </thead>
+ <tbody
+ role="rowgroup"
+ >
+ <!---->
+ <tr
+ class=""
+ role="row"
+ >
+ <td
+ aria-colindex="1"
+ class="gl-vertical-align-middle!"
+ role="cell"
+ >
+ <gl-emoji
+ data-fallback-src="https://gitlab.com/custom_emoji/custom_emoji/-/raw/main/img/confused_husky.gif"
+ data-name="confused_husky"
+ data-unicode-version="custom"
+ />
+ </td>
+ <td
+ aria-colindex="2"
+ class="gl-vertical-align-middle! gl-font-monospace"
+ role="cell"
+ >
+ <strong
+ class="gl-str-truncated"
+ >
+ :confused_husky:
+ </strong>
+ </td>
+ <td
+ aria-colindex="3"
+ class="gl-vertical-align-middle!"
+ role="cell"
+ >
+
+ created-at
+
+ </td>
+ <td
+ aria-colindex="4"
+ class=""
+ role="cell"
+ />
+ </tr>
+ <!---->
+ <!---->
+ </tbody>
+ <!---->
+ </table>
+
+ <!---->
+ </div>
+ </transition-stub>
+ <!---->
+ </div>
+ </div>
+</div>
+`;
diff --git a/spec/frontend/custom_emoji/components/list_spec.js b/spec/frontend/custom_emoji/components/list_spec.js
new file mode 100644
index 00000000000..ac5219e375b
--- /dev/null
+++ b/spec/frontend/custom_emoji/components/list_spec.js
@@ -0,0 +1,45 @@
+import Vue from 'vue';
+import { mountExtended } from 'helpers/vue_test_utils_helper';
+import List from '~/custom_emoji/components/list.vue';
+import { CUSTOM_EMOJI } from '../mock_data';
+
+jest.mock('~/lib/utils/datetime/date_format_utility', () => ({
+ formatDate: (date) => date,
+}));
+
+Vue.config.ignoredElements = ['gl-emoji'];
+
+let wrapper;
+
+function createComponent(propsData = {}) {
+ wrapper = mountExtended(List, {
+ propsData: {
+ customEmojis: CUSTOM_EMOJI,
+ pageInfo: {},
+ count: CUSTOM_EMOJI.length,
+ ...propsData,
+ },
+ });
+}
+
+describe('Custom emoji settings list component', () => {
+ it('renders table of custom emoji', () => {
+ createComponent();
+
+ expect(wrapper.element).toMatchSnapshot();
+ });
+
+ describe('pagination', () => {
+ it.each`
+ emits | button | pageInfo
+ ${{ before: 'startCursor' }} | ${'prevButton'} | ${{ hasPreviousPage: true, startCursor: 'startCursor' }}
+ ${{ after: 'endCursor' }} | ${'nextButton'} | ${{ hasNextPage: true, endCursor: 'endCursor' }}
+ `('emits $emits when $button is clicked', async ({ emits, button, pageInfo }) => {
+ createComponent({ pageInfo });
+
+ await wrapper.findByTestId(button).vm.$emit('click');
+
+ expect(wrapper.emitted('input')[0]).toEqual([emits]);
+ });
+ });
+});
diff --git a/spec/frontend/custom_emoji/mock_data.js b/spec/frontend/custom_emoji/mock_data.js
new file mode 100644
index 00000000000..19ba7022bf1
--- /dev/null
+++ b/spec/frontend/custom_emoji/mock_data.js
@@ -0,0 +1,8 @@
+export const CUSTOM_EMOJI = [
+ {
+ id: 'gid://gitlab/CustomEmoji/1',
+ name: 'confused_husky',
+ url: 'https://gitlab.com/custom_emoji/custom_emoji/-/raw/main/img/confused_husky.gif',
+ createdAt: 'created-at',
+ },
+];
diff --git a/spec/models/ci/bridge_spec.rb b/spec/models/ci/bridge_spec.rb
index a5366a1a67a..1d0c3bb5dee 100644
--- a/spec/models/ci/bridge_spec.rb
+++ b/spec/models/ci/bridge_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Ci::Bridge, feature_category: :continuous_integration do
- let_it_be(:project, reload: true) { create(:project, :repository, :in_group) }
+ let_it_be(:project, refind: true) { create(:project, :repository, :in_group) }
let_it_be(:target_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'my')) }
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
diff --git a/spec/requests/api/npm_group_packages_spec.rb b/spec/requests/api/npm_group_packages_spec.rb
index 431c59cf1b8..fe0bf1d8b46 100644
--- a/spec/requests/api/npm_group_packages_spec.rb
+++ b/spec/requests/api/npm_group_packages_spec.rb
@@ -2,8 +2,7 @@
require 'spec_helper'
-RSpec.describe API::NpmGroupPackages, feature_category: :package_registry,
- quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/418757' do
+RSpec.describe API::NpmGroupPackages, feature_category: :package_registry do
using RSpec::Parameterized::TableSyntax
include_context 'npm api setup'
diff --git a/spec/requests/organizations/organizations_controller_spec.rb b/spec/requests/organizations/organizations_controller_spec.rb
index bd54b50de99..c3a328cf3f6 100644
--- a/spec/requests/organizations/organizations_controller_spec.rb
+++ b/spec/requests/organizations/organizations_controller_spec.rb
@@ -30,9 +30,13 @@ RSpec.describe Organizations::OrganizationsController, feature_category: :cell d
end
context 'when the feature flag `ui_for_organizations` is disabled' do
- it 'renders 404' do
- stub_feature_flags(ui_for_organizations: false)
+ let_it_be(:other_user) { create :user }
+
+ before do
+ stub_feature_flags(ui_for_organizations: other_user)
+ end
+ it 'renders 404' do
gitlab_request
expect(response).to have_gitlab_http_status(:not_found)
diff --git a/spec/support/shared_contexts/requests/api/npm_packages_shared_context.rb b/spec/support/shared_contexts/requests/api/npm_packages_shared_context.rb
index 36103b94542..9d05a39cdb8 100644
--- a/spec/support/shared_contexts/requests/api/npm_packages_shared_context.rb
+++ b/spec/support/shared_contexts/requests/api/npm_packages_shared_context.rb
@@ -7,7 +7,7 @@ RSpec.shared_context 'npm api setup' do
let_it_be(:user, reload: true) { create(:user) }
let_it_be(:group) { create(:group, name: 'test-group') }
let_it_be(:namespace) { group }
- let_it_be(:project, reload: true) { create(:project, :public, namespace: namespace) }
+ let_it_be_with_refind(:project) { create(:project, :public, namespace: namespace) }
let_it_be(:package, reload: true) { create(:npm_package, project: project, name: "@#{group.path}/scoped_package", version: '1.2.3') }
let_it_be(:token) { create(:oauth_access_token, scopes: 'api', resource_owner: user) }
let_it_be(:personal_access_token) { create(:personal_access_token, user: user) }
diff --git a/spec/support/shared_examples/ci/deployable_shared_examples.rb b/spec/support/shared_examples/ci/deployable_shared_examples.rb
index 367e939e69c..75ddc763bc6 100644
--- a/spec/support/shared_examples/ci/deployable_shared_examples.rb
+++ b/spec/support/shared_examples/ci/deployable_shared_examples.rb
@@ -51,7 +51,7 @@ RSpec.shared_examples 'a deployable job' do
end
context 'when job is older than the latest deployment but succeeded once' do
- let(:job) { create(factory_type, :success, :with_deployment, pipeline: pipeline, environment: 'production') }
+ let(:job) { create(factory_type, :success, :with_deployment, project: project, pipeline: pipeline, environment: 'production') }
before do
allow(job.deployment).to receive(:older_than_last_successful_deployment?).and_return(true)