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:
-rw-r--r--app/assets/javascripts/admin/deploy_keys/components/table.vue67
-rw-r--r--app/assets/javascripts/behaviors/markdown/render_mermaid.js2
-rw-r--r--app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue2
-rw-r--r--app/views/devise/sessions/new.html.haml2
-rw-r--r--doc/administration/redis/troubleshooting.md12
-rw-r--r--doc/development/cicd/templates.md2
-rw-r--r--doc/development/contributing/index.md2
-rw-r--r--doc/development/documentation/styleguide/word_list.md2
-rw-r--r--doc/integration/omniauth.md2
-rw-r--r--doc/subscriptions/bronze_starter.md2
-rw-r--r--doc/user/award_emojis.md12
-rw-r--r--doc/user/discussions/index.md41
-rw-r--r--doc/user/img/award_emoji_comment_awarded.pngbin19159 -> 0 bytes
-rw-r--r--doc/user/img/award_emoji_comment_picker.pngbin72847 -> 0 bytes
-rw-r--r--doc/user/img/award_emoji_select.pngbin17554 -> 0 bytes
-rw-r--r--doc/user/img/award_emoji_select_v14_6.pngbin0 -> 50200 bytes
-rw-r--r--doc/user/profile/notifications.md6
-rw-r--r--doc/user/project/issues/img/comment-or-discussion.pngbin4530 -> 0 bytes
-rw-r--r--doc/user/project/issues/img/create_mr_from_issue.pngbin8632 -> 0 bytes
-rw-r--r--doc/user/project/issues/img/issue_activity_sort_order_v12_10.pngbin11646 -> 0 bytes
-rw-r--r--doc/user/project/issues/img/issues_main_view_numbered.pngbin107528 -> 0 bytes
-rw-r--r--doc/user/project/issues/img/show-all-activity.pngbin4501 -> 0 bytes
-rw-r--r--doc/user/project/issues/index.md5
-rw-r--r--doc/user/project/issues/issue_data_and_actions.md316
-rw-r--r--doc/user/project/issues/managing_issues.md95
-rw-r--r--doc/user/project/issues/multiple_assignees_for_issues.md3
-rw-r--r--doc/user/project/issues/sorting_issue_lists.md2
-rw-r--r--doc/user/project/merge_requests/getting_started.md16
-rw-r--r--doc/user/todos.md2
-rw-r--r--lib/gitlab/ci/build/context/base.rb6
-rw-r--r--lib/gitlab/ci/build/policy/variables.rb2
-rw-r--r--lib/gitlab/ci/build/rules/rule/clause/changes.rb2
-rw-r--r--lib/gitlab/ci/build/rules/rule/clause/if.rb2
-rw-r--r--lib/gitlab/ci/config/external/context.rb12
-rw-r--r--lib/gitlab/ci/config/external/mapper.rb2
-rw-r--r--lib/gitlab/ci/pipeline/expression/lexeme/variable.rb6
-rw-r--r--lib/gitlab/ci/pipeline/expression/statement.rb4
-rw-r--r--lib/gitlab/ci/pipeline/seed/build.rb2
-rw-r--r--lib/gitlab/import_export/project/import_export.yml5
-rw-r--r--locale/gitlab.pot6
-rw-r--r--package.json2
-rw-r--r--qa/qa/page/component/wiki_page_form.rb21
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb5
-rw-r--r--spec/frontend/admin/deploy_keys/components/table_spec.js37
-rw-r--r--spec/lib/gitlab/ci/build/context/build_spec.rb22
-rw-r--r--spec/lib/gitlab/ci/build/context/global_spec.rb22
-rw-r--r--spec/lib/gitlab/ci/build/policy/variables_spec.rb4
-rw-r--r--spec/lib/gitlab/ci/build/rules/rule/clause/changes_spec.rb8
-rw-r--r--spec/lib/gitlab/ci/build/rules/rule_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/build/rules_spec.rb6
-rw-r--r--spec/lib/gitlab/ci/config/external/context_spec.rb8
-rw-r--r--spec/lib/gitlab/ci/config/external/rules_spec.rb6
-rw-r--r--spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb25
-rw-r--r--spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb1
-rw-r--r--spec/lib/gitlab/import_export/safe_model_attributes.yml1
-rw-r--r--spec/support/shared_examples/lib/gitlab/import_export/attributes_permitter_shared_examples.rb10
-rw-r--r--workhorse/go.mod2
-rw-r--r--workhorse/go.sum4
-rw-r--r--yarn.lock17
59 files changed, 412 insertions, 433 deletions
diff --git a/app/assets/javascripts/admin/deploy_keys/components/table.vue b/app/assets/javascripts/admin/deploy_keys/components/table.vue
index e971a1d1550..29e8b9a724e 100644
--- a/app/assets/javascripts/admin/deploy_keys/components/table.vue
+++ b/app/assets/javascripts/admin/deploy_keys/components/table.vue
@@ -1,11 +1,12 @@
<script>
-import { GlTable, GlButton, GlPagination, GlLoadingIcon, GlEmptyState } from '@gitlab/ui';
+import { GlTable, GlButton, GlPagination, GlLoadingIcon, GlEmptyState, GlModal } from '@gitlab/ui';
import { __ } from '~/locale';
import Api, { DEFAULT_PER_PAGE } from '~/api';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { cleanLeadingSeparator } from '~/lib/utils/url_utility';
import createFlash from '~/flash';
+import csrf from '~/lib/utils/csrf';
export default {
name: 'DeployKeysTable',
@@ -16,12 +17,16 @@ export default {
emptyStateDescription: __(
'Deploy keys grant read/write access to all repositories in your instance',
),
- remove: __('Remove deploy key'),
+ delete: __('Delete deploy key'),
edit: __('Edit deploy key'),
pagination: {
next: __('Next'),
prev: __('Prev'),
},
+ modal: {
+ title: __('Are you sure?'),
+ body: __('Are you sure you want to delete this deploy key?'),
+ },
apiErrorMessage: __('An error occurred fetching the public deploy keys. Please try again.'),
},
fields: [
@@ -48,6 +53,22 @@ export default {
thClass: 'gl-lg-w-1px gl-white-space-nowrap',
},
],
+ modal: {
+ id: 'delete-deploy-key-modal',
+ actionPrimary: {
+ text: __('Delete'),
+ attributes: {
+ variant: 'danger',
+ },
+ },
+ actionSecondary: {
+ text: __('Cancel'),
+ attributes: {
+ variant: 'default',
+ },
+ },
+ },
+ csrf,
DEFAULT_PER_PAGE,
components: {
GlTable,
@@ -56,6 +77,7 @@ export default {
TimeAgoTooltip,
GlLoadingIcon,
GlEmptyState,
+ GlModal,
},
inject: ['editPath', 'deletePath', 'createPath', 'emptyStateSvgPath'],
data() {
@@ -64,12 +86,21 @@ export default {
totalItems: 0,
loading: false,
items: [],
+ deployKeyToDelete: null,
};
},
computed: {
shouldShowTable() {
return this.totalItems !== 0 || this.loading;
},
+ isModalVisible() {
+ return this.deployKeyToDelete !== null;
+ },
+ deleteAction() {
+ return this.deployKeyToDelete === null
+ ? null
+ : this.deletePath.replace(':id', this.deployKeyToDelete);
+ },
},
watch: {
page(newPage) {
@@ -120,6 +151,15 @@ export default {
}
this.loading = false;
},
+ handleDeleteClick(id) {
+ this.deployKeyToDelete = id;
+ },
+ handleModalHide() {
+ this.deployKeyToDelete = null;
+ },
+ handleModalPrimary() {
+ this.$refs.modalForm.submit();
+ },
},
};
</script>
@@ -175,7 +215,12 @@ export default {
:href="editHref(id)"
class="gl-mr-2"
/>
- <gl-button variant="danger" icon="remove" :aria-label="$options.i18n.remove" />
+ <gl-button
+ variant="danger"
+ icon="remove"
+ :aria-label="$options.i18n.delete"
+ @click="handleDeleteClick(id)"
+ />
</template>
</gl-table>
<gl-pagination
@@ -196,5 +241,21 @@ export default {
:primary-button-text="$options.i18n.newDeployKeyButtonText"
:primary-button-link="createPath"
/>
+ <gl-modal
+ :modal-id="$options.modal.id"
+ :visible="isModalVisible"
+ :title="$options.i18n.modal.title"
+ :action-primary="$options.modal.actionPrimary"
+ :action-secondary="$options.modal.actionSecondary"
+ size="sm"
+ @hide="handleModalHide"
+ @primary="handleModalPrimary"
+ >
+ <form ref="modalForm" :action="deleteAction" method="post">
+ <input type="hidden" name="_method" value="delete" />
+ <input type="hidden" name="authenticity_token" :value="$options.csrf.token" />
+ </form>
+ {{ $options.i18n.modal.body }}
+ </gl-modal>
</div>
</template>
diff --git a/app/assets/javascripts/behaviors/markdown/render_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_mermaid.js
index 3f878949f9b..d78c456ed5b 100644
--- a/app/assets/javascripts/behaviors/markdown/render_mermaid.js
+++ b/app/assets/javascripts/behaviors/markdown/render_mermaid.js
@@ -75,7 +75,7 @@ export function initMermaid(mermaid) {
function importMermaidModule() {
return import(/* webpackChunkName: 'mermaid' */ 'mermaid')
- .then((mermaid) => {
+ .then(({ default: mermaid }) => {
mermaidModule = initMermaid(mermaid);
})
.catch((err) => {
diff --git a/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue b/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue
index 0d975ffbb26..11819200d7b 100644
--- a/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue
+++ b/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue
@@ -442,6 +442,8 @@ export default {
>
<gl-button
data-testid="toggle-editing-mode-button"
+ data-qa-selector="editing_mode_button"
+ :data-qa-mode="toggleEditingModeButtonText"
variant="link"
@click="toggleEditingMode"
>{{ toggleEditingModeButtonText }}</gl-button
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml
index da6232b2a2b..175b45dbbfa 100644
--- a/app/views/devise/sessions/new.html.haml
+++ b/app/views/devise/sessions/new.html.haml
@@ -1,8 +1,6 @@
- page_title _("Sign in")
- content_for :page_specific_javascripts do
- = render "layouts/google_tag_manager_head"
= render "layouts/one_trust"
-= render "layouts/google_tag_manager_body"
#signin-container
- if any_form_based_providers_enabled?
diff --git a/doc/administration/redis/troubleshooting.md b/doc/administration/redis/troubleshooting.md
index 6ab3d55e06a..f4aab9d7b7f 100644
--- a/doc/administration/redis/troubleshooting.md
+++ b/doc/administration/redis/troubleshooting.md
@@ -20,6 +20,18 @@ Before proceeding with the troubleshooting below, check your firewall rules:
- Connect to other Sentinel machines via TCP in `26379`
- Connect to the Redis machines via TCP in `6379`
+## Basic Redis activity check
+
+Start Redis troubleshooting with a basic Redis activity check:
+
+1. Open a terminal on your GitLab server.
+1. Run `gitlab-redis-cli --stat` and observe the output while it runs.
+1. Go to your GitLab UI and browse to a handful of pages. Any page works, like
+ group or project overviews, issues, files in repositories, and so on.
+1. Check the `stat` output again and verify that the values for `keys`, `clients`,
+ `requests`, and `connections` increases as you browse. If the numbers go up,
+ basic Redis functionality is working and GitLab can connect to it.
+
## Troubleshooting Redis replication
You can check if everything is correct by connecting to each server using
diff --git a/doc/development/cicd/templates.md b/doc/development/cicd/templates.md
index 46442aa6106..b1252b86cc0 100644
--- a/doc/development/cicd/templates.md
+++ b/doc/development/cicd/templates.md
@@ -392,6 +392,6 @@ If you're unsure if it's secure or not, you must ask security experts for cross-
After your CI/CD template MR is created and labeled with `ci::templates`, DangerBot
suggests one reviewer and one maintainer that can review your code. When your merge
-request is ready for review, please [mention](../../user/project/issues/issue_data_and_actions.md#mentions)
+request is ready for review, please [mention](../../user/discussions/index.md#mentions)
the reviewer and ask them to review your CI/CD template changes. See details in the merge request that added
[a DangerBot task for CI/CD template MRs](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44688).
diff --git a/doc/development/contributing/index.md b/doc/development/contributing/index.md
index fe7dc52d077..ec05f75c709 100644
--- a/doc/development/contributing/index.md
+++ b/doc/development/contributing/index.md
@@ -129,7 +129,7 @@ The general flow of contributing to GitLab is:
1. In the merge request's description:
- Ensure you provide complete and accurate information.
- Review the provided checklist.
-1. Assign the merge request (if possible) to, or [mention](../../user/project/issues/issue_data_and_actions.md#mentions),
+1. Assign the merge request (if possible) to, or [mention](../../user/discussions/index.md#mentions),
one of the [code owners](../../user/project/code_owners.md) for the relevant project,
and explain that you are ready for review.
diff --git a/doc/development/documentation/styleguide/word_list.md b/doc/development/documentation/styleguide/word_list.md
index 0888844dc31..de45773b27e 100644
--- a/doc/development/documentation/styleguide/word_list.md
+++ b/doc/development/documentation/styleguide/word_list.md
@@ -20,7 +20,7 @@ For guidance not on this page, we defer to these style guides:
## `@mention`
Try to avoid **`@mention`**. Say **mention** instead, and consider linking to the
-[mentions topic](../../../user/project/issues/issue_data_and_actions.md#mentions).
+[mentions topic](../../../user/discussions/index.md#mentions).
Don't use backticks.
## above
diff --git a/doc/integration/omniauth.md b/doc/integration/omniauth.md
index d9a9c7ca8aa..8bc111c9a46 100644
--- a/doc/integration/omniauth.md
+++ b/doc/integration/omniauth.md
@@ -30,7 +30,7 @@ GitLab supports the following OmniAuth providers.
| [Azure v1](azure.md) | `azure_oauth2` |
| [Bitbucket Cloud](bitbucket.md) | `bitbucket` |
| [CAS](cas.md) | `cas3` |
-| [DingTalk](ding_talk.md) | `ding_talk` |
+| [DingTalk](ding_talk.md) | `dingtalk` |
| [Facebook](facebook.md) | `facebook` |
| [Generic OAuth 2.0](oauth2_generic.md) | `oauth2_generic` |
| [GitHub](github.md) | `github` |
diff --git a/doc/subscriptions/bronze_starter.md b/doc/subscriptions/bronze_starter.md
index 2f33d7b740e..3a58dd84614 100644
--- a/doc/subscriptions/bronze_starter.md
+++ b/doc/subscriptions/bronze_starter.md
@@ -39,7 +39,7 @@ the tiers are no longer mentioned in GitLab documentation:
- Issues:
- [Multiple assignees for issues](../user/project/issues/multiple_assignees_for_issues.md)
- [Issue weights](../user/project/issues/issue_weight.md)
- - [Issue histories](../user/project/issues/issue_data_and_actions.md#issue-history) contain changes to issue description
+ - Issue histories contain [changes to issue description](../user/discussions/index.md#view-description-change-history)
- [Adding an issue to an iteration](../user/project/issues/managing_issues.md#add-an-issue-to-an-iteration)
- [Iterations](../user/group/iterations/index.md)
- [Kerberos integration](../integration/kerberos.md)
diff --git a/doc/user/award_emojis.md b/doc/user/award_emojis.md
index 88651688779..e4fcdcd4653 100644
--- a/doc/user/award_emojis.md
+++ b/doc/user/award_emojis.md
@@ -10,7 +10,7 @@ When you're collaborating online, you get fewer opportunities for high-fives
and thumbs-ups. Emoji can be awarded to [issues](project/issues/index.md), [merge requests](project/merge_requests/index.md),
[snippets](snippets.md), and anywhere you can have a thread.
-![Award emoji](img/award_emoji_select.png)
+![Award emoji](img/award_emoji_select_v14_6.png)
Award emoji make it much easier to give and receive feedback without a long
comment thread.
@@ -34,11 +34,9 @@ downvotes.
Award emoji can also be applied to individual comments when you want to
celebrate an accomplishment or agree with an opinion.
-To:
+To add an award emoji:
-- Add an award emoji, click the smile in the top right of the comment and pick an emoji from the dropdown.
-- Remove an award emoji, click the emoji again.
+1. In the top right of the comment, select the smile (**{slight-smile}**).
+1. Select an emoji from the dropdown list.
-![Picking an emoji for a comment](img/award_emoji_comment_picker.png)
-
-![An award emoji has been applied to a comment](img/award_emoji_comment_awarded.png)
+To remove an award emoji, select the emoji again.
diff --git a/doc/user/discussions/index.md b/doc/user/discussions/index.md
index 4d6cff96169..7831fdff249 100644
--- a/doc/user/discussions/index.md
+++ b/doc/user/discussions/index.md
@@ -34,6 +34,20 @@ You can create comments in places like:
Each object can have as many as 5,000 comments.
+## Mentions
+
+You can mention a user or a group present in your GitLab instance with `@username` or
+`@groupname`. All mentioned users are notified with to-do items and emails.
+Users can change this setting for themselves in the
+[notification settings](../profile/notifications.md).
+
+You can quickly see which comments involve you, because
+mentions for yourself (the user currently signed in) are highlighted
+in a different color.
+
+Avoid mentioning `@all` in issues and merge requests, because it sends an email notification
+to all the members of that project's group. This might be interpreted as spam.
+
## Add a comment to a merge request diff
You can add comments to a merge request diff. These comments
@@ -90,8 +104,10 @@ An icon is displayed on the image and a comment field is displayed.
If you have ["reply by email"](../../administration/reply_by_email.md) configured,
you can reply to comments by sending an email.
-- When you reply to a standard comment, another standard comment is created.
+- When you reply to a standard comment, it creates another standard comment.
- When you reply to a threaded comment, it creates a reply in the thread.
+- When you [send an email to an issue email address](../project/issues/managing_issues.md#copy-issue-email-address),
+ it creates a standard comment.
You can use [Markdown](../markdown.md) and [quick actions](../project/quick_actions.md) in your email replies.
@@ -145,7 +161,7 @@ For issues and merge requests with many comments, you can filter the page to sho
1. Open a merge request's **Discussion** tab, or epic or issue's **Overview** tab.
1. On the right side of the page, select from the filter:
- - **Show all activity**: Display all user comments and system notes
+ - **Show all activity**: Display all user comments and system notes.
(issue updates, mentions from other issues, changes to the description, and so on).
- **Show comments only**: Display only user comments.
- **Show history only**: Display only activity notes.
@@ -155,6 +171,27 @@ For issues and merge requests with many comments, you can filter the page to sho
GitLab saves your preference, so it persists when you visit the same page again
from any device you're logged into.
+## View description change history **(PREMIUM)**
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10103) in GitLab 12.6.
+
+You can see changes to the description listed in the history.
+
+To compare the changes, select **Compare with previous version**.
+
+## Change activity sort order
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14588) in GitLab 12.10.
+
+You can reverse the default order and interact with the activity feed sorted by most recent items
+at the top. Your preference is saved in local storage and automatically applies to every issue,
+merge request, or epic you view.
+
+To change the activity sort order:
+
+1. Select the **Oldest first** (or **Newest first**) dropdown list.
+1. Select either oldest or newest items to be shown first.
+
## Assign an issue to the commenting user
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/191455) in GitLab 13.1.
diff --git a/doc/user/img/award_emoji_comment_awarded.png b/doc/user/img/award_emoji_comment_awarded.png
deleted file mode 100644
index 111793ebf8a..00000000000
--- a/doc/user/img/award_emoji_comment_awarded.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/img/award_emoji_comment_picker.png b/doc/user/img/award_emoji_comment_picker.png
deleted file mode 100644
index 07f90c898ed..00000000000
--- a/doc/user/img/award_emoji_comment_picker.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/img/award_emoji_select.png b/doc/user/img/award_emoji_select.png
deleted file mode 100644
index 269282b94b0..00000000000
--- a/doc/user/img/award_emoji_select.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/img/award_emoji_select_v14_6.png b/doc/user/img/award_emoji_select_v14_6.png
new file mode 100644
index 00000000000..500b78bdf44
--- /dev/null
+++ b/doc/user/img/award_emoji_select_v14_6.png
Binary files differ
diff --git a/doc/user/profile/notifications.md b/doc/user/profile/notifications.md
index 9faa4b78f8c..acee295ce72 100644
--- a/doc/user/profile/notifications.md
+++ b/doc/user/profile/notifications.md
@@ -67,7 +67,7 @@ For each project and group you can select one of the following levels:
| Global | Your global settings apply. |
| Watch | Receive notifications for any activity. |
| Participate | Receive notifications for threads you have participated in. |
-| On mention | Receive notifications when you are [mentioned](../project/issues/issue_data_and_actions.md#mentions) in a comment. |
+| On mention | Receive notifications when you are [mentioned](../discussions/index.md#mentions) in a comment. |
| Disabled | Receive no notifications. |
| Custom | Receive notifications for selected events. |
@@ -203,7 +203,7 @@ In issues, merge requests, and epics, for most events, the notification is sent
- Participants:
- The author and assignee.
- Authors of comments.
- - Anyone [mentioned](../project/issues/issue_data_and_actions.md#mentions) by username in the title
+ - Anyone [mentioned](../discussions/index.md#mentions) by username in the title
or description.
- Anyone mentioned by username in a comment if their notification level is "Participating" or higher.
- Watchers: users with notification level "Watch".
@@ -287,7 +287,7 @@ The participants are:
- Authors of the design (can be multiple people if different authors have uploaded different versions of the design).
- Authors of comments on the design.
-- Anyone that is [mentioned](../project/issues/issue_data_and_actions.md#mentions) in a comment on the design.
+- Anyone that is [mentioned](../discussions/index.md#mentions) in a comment on the design.
## Opt out of all GitLab emails
diff --git a/doc/user/project/issues/img/comment-or-discussion.png b/doc/user/project/issues/img/comment-or-discussion.png
deleted file mode 100644
index a29014c984c..00000000000
--- a/doc/user/project/issues/img/comment-or-discussion.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/issues/img/create_mr_from_issue.png b/doc/user/project/issues/img/create_mr_from_issue.png
deleted file mode 100644
index d05a678cd17..00000000000
--- a/doc/user/project/issues/img/create_mr_from_issue.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/issues/img/issue_activity_sort_order_v12_10.png b/doc/user/project/issues/img/issue_activity_sort_order_v12_10.png
deleted file mode 100644
index 3e19ee1ac66..00000000000
--- a/doc/user/project/issues/img/issue_activity_sort_order_v12_10.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/issues/img/issues_main_view_numbered.png b/doc/user/project/issues/img/issues_main_view_numbered.png
deleted file mode 100644
index 92b9df44972..00000000000
--- a/doc/user/project/issues/img/issues_main_view_numbered.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/issues/img/show-all-activity.png b/doc/user/project/issues/img/show-all-activity.png
deleted file mode 100644
index 55c6f5ab5db..00000000000
--- a/doc/user/project/issues/img/show-all-activity.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/issues/index.md b/doc/user/project/issues/index.md
index 64838b261ce..c535d16bc0f 100644
--- a/doc/user/project/issues/index.md
+++ b/doc/user/project/issues/index.md
@@ -31,6 +31,7 @@ To learn how the GitLab Strategic Marketing department uses GitLab issues with [
- [Create issues](managing_issues.md#create-a-new-issue)
- [Create an issue from a template](../../project/description_templates.md#use-the-templates)
+- [Edit issues](managing_issues.md#edit-an-issue)
- [Move issues](managing_issues.md#moving-issues)
- [Close issues](managing_issues.md#closing-issues)
- [Delete issues](managing_issues.md#deleting-issues)
@@ -40,13 +41,13 @@ To learn how the GitLab Strategic Marketing department uses GitLab issues with [
- [Export issues](csv_export.md)
- [Upload designs to issues](design_management.md)
- [Linked issues](related_issues.md)
+- [Similar issues](managing_issues.md#similar-issues)
+- [Health status](managing_issues.md#health-status)
- [Cross-link issues](crosslinking_issues.md)
-- [Bulk edit issues](../issues/managing_issues.md)
- [Sort issue lists](sorting_issue_lists.md)
- [Search for issues](../../search/index.md#filter-issue-and-merge-request-lists)
- [Epics](../../group/epics/index.md)
- [Issue boards](../issue_board.md)
- [Issues API](../../../api/issues.md)
- [Configure an external issue tracker](../../../integration/external-issue-tracker.md)
-- [Parts of an issue](issue_data_and_actions.md)
- [Tasks](../../tasks.md)
diff --git a/doc/user/project/issues/issue_data_and_actions.md b/doc/user/project/issues/issue_data_and_actions.md
index 6bb60e5e31a..66ca29c094e 100644
--- a/doc/user/project/issues/issue_data_and_actions.md
+++ b/doc/user/project/issues/issue_data_and_actions.md
@@ -1,315 +1,9 @@
---
-stage: Plan
-group: Project Management
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
+redirect_to: 'index.md'
+remove_date: '2022-02-24'
---
-# Issue Data and Actions **(FREE)**
+This file was moved to [another location](index.md).
-Please read through the [GitLab Issue Documentation](index.md) for an overview on GitLab Issues.
-
-## Parts of an Issue
-
-The image below illustrates what an issue may look like. Certain parts
-look slightly different or are absent, depending on the GitLab version
-and the user's permissions.
-
-You can find all of an issue's information on one page.
-
-![Issue view](img/issues_main_view_numbered.png)
-
-The numbers in the image correspond to the following features:
-
-- **1.** [Issue actions](#issue-actions)
-- **2.** [To Do](#to-do)
-- **3.** [Assignee](#assignee)
- - **3.1.** [Multiple Assignees](#multiple-assignees)
-- **4.** [Epic](#epic)
-- **5.** [Milestone](#milestone)
-- **6.** [Time tracking](#time-tracking)
-- **7.** [Due date](#due-date)
-- **8.** [Labels](#labels)
-- **9.** [Weight](#weight)
-- **10.** [Confidentiality](#confidentiality)
-- **11.** [Lock issue](#lock-issue)
-- **12.** [Participants](#participants)
-- **13.** [Notifications](#notifications)
-- **14.** [Reference](#reference)
-- [Issue email](#email)
-- **15.** [Edit](#edit)
-- **16.** [Description](#description)
-- **17.** [Mentions](#mentions)
-- **18.** [Linked Issues](#linked-issues)
-- **19.** [Related Merge Requests](#related-merge-requests)
-- **20.** [Award emoji](#award-emoji)
-- **21.** [Show all activity](#show-all-activity)
-- **22.** [Create Merge Request](#create-merge-request)
-- **23.** [Issue history](#issue-history)
- - [Activity sort order](#activity-sort-order)
-- **24.** [Comments](#comments)
-- **25.** [Submit comment, start a thread, or comment and close](#submit-comment-start-a-thread-or-comment-and-close)
-- **26.** [Zoom meetings](#zoom-meetings)
-
-Many of the elements of the issue screen refresh automatically, such as the title and
-description, when they are changed by another user. Comments and system notes also
-update automatically in response to various actions and content updates.
-
-### Issue actions
-
-In an open issue, you can close it by selecting the **Close issue** button.
-The issue is marked as closed but is not deleted.
-
-To reopen a closed issue, select the **Reopen issue** button.
-A reopened issue is no different from any other open issue.
-
-To access additional actions, select the vertical ellipsis
-(**{ellipsis_v}**) button:
-
-- To create a new issue in the same project, select **New issue** in the dropdown menu.
-
-- If you are not the issue author, you can [submit an abuse report](../../report_abuse.md).
- Select **Report abuse** in the dropdown menu.
-
-### To Do
-
-You can add issues to and remove issues from your [GitLab To-Do List](../../todos.md).
-
-The button to do this has a different label depending on whether the issue is already on your To-Do
-List or not. If the issue is:
-
-- Already on your To-Do List: The button is labeled **Mark as done**. Click the button to remove the issue from your To-Do List.
-- Not on your To-Do List: The button is labeled **Add a to do**. Click the button to add the issue to your To-Do List.
-
-### Assignee
-
-An issue can be assigned to:
-
-- Yourself.
-- Another person.
-- [Many people](#multiple-assignees). **(PREMIUM)**
-
-The assignees can be changed as often as needed. The idea is that the assignees are
-responsible for that issue until it's reassigned to someone else to take it from there.
-When assigned to someone, it appears in their assigned issues list.
-
-NOTE:
-If a user is not member of that project, it can only be
-assigned to them if they created the issue themselves.
-
-#### Multiple Assignees **(PREMIUM)**
-
-Often, multiple people work on the same issue together. This can be difficult
-to track in large teams where there is shared ownership of an issue.
-
-To help with this, you can use GitLab to
-[assign multiple people](multiple_assignees_for_issues.md) to an issue.
-
-### Epic **(PREMIUM)**
-
-You can assign issues to an [Epic](../../group/epics/index.md), which allows better
-management of groups of related issues.
-
-### Milestone
-
-Select a [milestone](../milestones/index.md) to attribute that issue to.
-
-### Time tracking
-
-Use [GitLab Quick Actions](../quick_actions.md) to [track estimates and time
-spent on issues](../time_tracking.md). You can add a [time estimate](../time_tracking.md#estimates)
-for resolving the issue, and also add [the time spent](../time_tracking.md#time-spent)
-to resolve the issue.
-
-### Due date
-
-When you work on a tight schedule, it's important to have a way to set a deadline for
-implementations and for solving problems. This can be done in the [due date](due_dates.md)
-element. Due dates can be changed as many times as needed.
-
-### Labels
-
-Categorize issues by giving them [labels](../labels.md). They help to organize workflows,
-and they enable you to work with the [issue board](../issue_board.md).
-
-Group Labels, which allow you to use the same labels for all projects in the same
-group, can also be given to issues. They work exactly the same, but are immediately
-available to all projects in the group.
-
-If a label doesn't exist yet, you can create one by clicking **Edit**
-followed by **Create new label** in the dropdown menu.
-
-### Weight **(PREMIUM)**
-
-[Assign a weight](issue_weight.md) to an issue.
-Larger values are used to indicate more effort is required to complete the issue. Only
-positive values or zero are allowed.
-
-### Confidentiality
-
-You can [set an issue to be confidential](confidential_issues.md). Unauthorized users
-cannot access the issue, and it is not listed in the project's issue boards nor list for them.
-
-### Lock issue
-
-You can [lock the issue](../../discussions/index.md#prevent-comments-by-locking-an-issue)
-to prevent further comments from being added.
-
-### Participants
-
-All the users involved in that issue. Either they participated in the [thread](../../discussions/index.md),
-or were mentioned in the description or threads.
-
-### Notifications
-
-Select the toggle to enable or disable [notifications](../../profile/notifications.md#notifications-on-issues-merge-requests-and-epics)
-for the issue. Notifications are automatically enabled after you participate in the issue in any way.
-
-### Reference
-
-- A quick "copy" button for that issue's reference, which looks like
- `foo/bar#xxx`, where `foo` is the `username` or `groupname`, `bar` is the
- `project-name`, and `xxx` is the issue number.
-
-### Email
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/18816) in GitLab 13.8.
-
-Guest users can see a button in the right sidebar to copy the email address for the issue.
-Sending an email to this address creates a comment containing the email body.
-
-### Edit
-
-Clicking this icon opens the issue for editing. All the fields which
-were shown when the issue was created are displayed for editing.
-This icon is only displayed if the user has permission to edit the issue.
-
-### Description
-
-The plain text title and description of the issue fill the top center of the issue page.
-The description fully supports [GitLab Flavored Markdown](../../markdown.md#gitlab-flavored-markdown),
-allowing many formatting options.
-
-[In GitLab 12.6](https://gitlab.com/gitlab-org/gitlab/-/issues/10103) and later, changes to an
-issue's description are listed in the [issue history](#issue-history). **(PREMIUM)**
-
-### Mentions
-
-You can mention a user or a group present in your GitLab instance with `@username` or
-`@groupname`. All mentioned users are notified via to-do items and emails,
-unless they have disabled all [notifications](#notifications) in their user settings.
-This is controlled in the [notification settings](../../profile/notifications.md).
-
-Mentions for yourself (the user currently signed in) are highlighted
-in a different color, which allows you to quickly see which comments involve you.
-
-Avoid mentioning `@all` in issues and merge requests, as it sends an email notification
-to all the members of that project's group. This might be interpreted as spam.
-
-### Linked Issues
-
-Issues that were mentioned as [linked issues](related_issues.md) are listed here.
-You can also click the `+` to add more linked issues.
-
-### Related Merge Requests
-
-Merge requests that were mentioned in that issue's description or in the issue thread
-are listed as [related merge requests](crosslinking_issues.md#from-merge-requests) here.
-Also, if the current issue was mentioned as related in another merge request, that
-merge request is also listed here.
-
-### Award emoji
-
-You can award emojis to issues. You can select the "thumbs up" and "thumbs down",
-or the gray "smiley-face" to choose from the list of available
-[GitLab Flavored Markdown Emoji](../../markdown.md#emojis).
-
-NOTE:
-Posting "+1" as a comment in a thread spams all subscribed participants of that issue,
-clutters the threads, and is not recommended. Awarding an emoji is a way
-to let them know your reaction without notifying them.
-
-### Show all activity
-
-You can filter what is displayed in the issue history by clicking on **Show all activity**
-and selecting either:
-
-- **Show comments only**, which only shows threads and hides updates to the issue.
-- **Show history only**, which hides threads and only shows updates.
-
-Also:
-
-- You can mention a user or a group present in your GitLab instance with
- `@username` or `@groupname` and they are notified via to-do items
- and emails, unless they have disabled all [notifications](#notifications)
- in their user settings.
-- Mentions for yourself (the current logged-in user) are highlighted
- in a different color, which allows you to quickly see which comments involve you.
-
-![Show all activity](img/show-all-activity.png)
-
-### Create Merge Request
-
-Create a new branch and [**Draft** merge request](../merge_requests/drafts.md)
-in one action. The branch is named `issuenumber-title` by default, but you can
-choose any name, and GitLab verifies that it is not already in use. The merge request
-inherits the milestone and labels of the issue, and is set to automatically
-close the issue when it is merged.
-
-![Create MR from issue](img/create_mr_from_issue.png)
-
-Optionally, you can choose to create a [new branch](../repository/web_editor.md#create-a-new-branch-from-an-issue)
-only, named after that issue.
-
-### Issue history
-
-All comments and updates to the issue are tracked and listed here, but this can be
-filtered, as shown above.
-
-#### Activity sort order
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14588) in GitLab 12.10.
-
-You can reverse the default order and interact with the activity feed sorted by most recent items
-at the top. Your preference is saved via local storage and automatically applied to every issue
-you view.
-
-To change the activity sort order, click the **Oldest first** dropdown menu and select either oldest
-or newest items to be shown first.
-
-![Issue activity sort order dropdown button](img/issue_activity_sort_order_v12_10.png)
-
-### Comments
-
-Collaborate in the issue by posting comments in its thread. This text field also fully
-supports [GitLab Flavored Markdown](../../markdown.md#gitlab-flavored-markdown).
-
-### Submit comment, start a thread, or comment and close
-
-After you write a comment, you can:
-
-- Click **Comment** to publish your comment.
-- Choose **Start thread** from the dropdown list and start a new [thread](../../discussions/index.md#create-a-thread-without-replying-to-a-comment)
- in that issue's main thread to discuss specific points. This invites other participants
- to reply directly to your thread, keeping related comments grouped together.
-
-![Comment or thread](img/comment-or-discussion.png)
-
-You can also close the issue from here, so you don't need to scroll to the top of the issue page.
-
-### Zoom meetings
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/31103) in GitLab 12.3.
-
-You can attach and remove Zoom meetings to issues using the `/zoom` and `/remove_zoom` [quick actions](../quick_actions.md) as part of
-[GitLab Flavored Markdown](../../markdown.md#gitlab-flavored-markdown).
-
-Attaching a [Zoom](https://zoom.us) call an issue
-results in a **Join Zoom meeting** button at the top of the issue, just under the header.
-
-Read more how to [add or remove a zoom meeting](associate_zoom_meeting.md).
-
-### Publish an issue **(ULTIMATE)**
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/30906) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.1.
-
-If a status page application is associated with the project, you can use the `/publish` [quick action](../quick_actions.md) to publish the issue. Refer to [GitLab Status Page](../../../operations/incident_management/status_page.md) for more information.
+<!-- This redirect file can be deleted after <2022-02-24>. -->
+<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page -->
diff --git a/doc/user/project/issues/managing_issues.md b/doc/user/project/issues/managing_issues.md
index b8305b8604f..b46672c9399 100644
--- a/doc/user/project/issues/managing_issues.md
+++ b/doc/user/project/issues/managing_issues.md
@@ -19,9 +19,9 @@ Key actions for issues include:
## Create a new issue
-When you create a new issue, you are prompted to fill in the [data and fields of the issue](issue_data_and_actions.md),
-as illustrated below. If you know the values you want to assign to an issue, you can use the
-[Quick actions](../quick_actions.md) feature to input values.
+When you create a new issue, you are prompted to enter the fields of the issue.
+If you know the values you want to assign to an issue, you can use
+[quick actions](../quick_actions.md) to enter them.
While creating an issue, you can associate it to an existing epic from current group by
selecting it using **Epic** dropdown.
@@ -142,7 +142,13 @@ Follow these examples to form your new issue URL with prefilled fields.
- For a new issue in the GitLab Community Edition project with a pre-filled title,
a pre-filled description, and the confidential flag set, the URL would be `https://gitlab.com/gitlab-org/gitlab-foss/-/issues/new?issue[title]=Validate%20new%20concept&issue[description]=Research%20idea&issue[confidential]=true`
-## Bulk edit issues at the project level
+## Edit an issue
+
+You can edit an issue's title and description.
+
+To edit an issue, select **Edit title and description** (**{pencil}**).
+
+### Bulk edit issues at the project level
> - Assigning epic ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/210470) in GitLab 13.2.
> - Editing health status [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218395) in GitLab 13.2.
@@ -169,7 +175,7 @@ To update multiple project issues at the same time:
1. Select the appropriate fields and their values from the sidebar.
1. Click **Update all**.
-## Bulk edit issues at the group level
+### Bulk edit issues at the group level
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/7249) in GitLab 12.1.
> - Assigning epic ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/210470) in GitLab 13.2.
@@ -232,15 +238,23 @@ end; nil
## Closing issues
-When you decide that an issue is resolved, or no longer needed, you can close the issue
-using the close button:
+When you decide that an issue is resolved, or no longer needed, you can close the issue.
+The issue is marked as closed but is not deleted.
+
+To close an issue, you can do the following:
-![close issue - button](img/button_close_issue_v13_6.png)
+- Select **Close issue**:
-You can also close an issue from the [issue boards](../issue_board.md) by dragging an issue card
-from its list and dropping it into the **Closed** list.
+ ![close issue - button](img/button_close_issue_v13_6.png)
-![close issue from the issue board](img/close_issue_from_board.gif)
+- In an [issue board](../issue_board.md), drag an issue card from its list into the **Closed** list.
+
+ ![close issue from the issue board](img/close_issue_from_board.gif)
+
+### Reopen a closed issue
+
+To reopen a closed issue, select **Reopen issue**.
+A reopened issue is no different from any other open issue.
### Closing issues automatically
@@ -268,6 +282,9 @@ Closes #4, #6, and https://gitlab.com/<username>/<projectname>/issues/<xxx>
For performance reasons, automatic issue closing is disabled for the very first
push from an existing repository.
+Alternatively, when you [create a merge request from an issue](../merge_requests/getting_started.md#merge-requests-to-close-issues),
+it inherits the issue's milestone and labels.
+
#### Default closing pattern
When not specified, this default issue closing pattern is used:
@@ -382,6 +399,35 @@ You can also use the `/iteration`
[quick action](../quick_actions.md#issues-merge-requests-and-epics)
in a comment or description field.
+## Copy issue reference
+
+To refer to an issue elsewhere in GitLab, you can use its full URL or a short reference, which looks like
+`namespace/project-name#123`, where `namespace` is either a group or a username.
+
+To copy the issue reference to your clipboard:
+
+1. Go to the issue.
+1. On the right sidebar, next to **Reference**, select **Copy Reference** (**{copy-to-clipboard}**).
+
+You can now paste the reference into another description or comment.
+
+Read more about issue references in [GitLab-Flavored Markdown](../../markdown.md#gitlab-specific-references).
+
+## Copy issue email address
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/18816) in GitLab 13.8.
+
+You can create a comment in an issue by sending an email.
+
+To copy the issue's email address:
+
+1. Go to the issue.
+1. On the right sidebar, next to **Issue email**, select **Copy Reference** (**{copy-to-clipboard}**).
+
+Sending an email to this address creates a comment containing the email body.
+To learn more about creating comments by sending an email and the necessary configuration, see
+[Reply to a comment by sending email](../../discussions/index.md#reply-to-a-comment-by-sending-email).
+
## Real-time sidebar
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17589) in GitLab 13.3. Disabled by default.
@@ -395,6 +441,24 @@ On GitLab.com, this feature is available.
Assignees in the sidebar are updated in real time.
+## Assignee
+
+An issue can be assigned to one or [more users](multiple_assignees_for_issues.md).
+
+The assignees can be changed as often as needed. The idea is that the assignees are
+people responsible for an issue.
+When an issue is assigned to someone, it appears in their assigned issues list.
+
+If a user is not a member of a project, an issue can only be assigned to them if they create it
+themselves or another project member assigns them.
+
+To change the assignee on an issue:
+
+1. Go to your issue.
+1. On the right sidebar, in the **Assignee** section, select **Edit**.
+1. From the dropdown list, select the user to add as an assignee.
+1. Click or tap anywhere outside of the dropdown list.
+
## Similar issues
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/22866) in GitLab 11.6.
@@ -427,3 +491,12 @@ After an issue is closed, its health status can't be edited and the **Edit** but
until the issue is reopened.
You can then see issue statuses in the issues list and the epic tree.
+
+## Publish an issue **(ULTIMATE)**
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/30906) in GitLab 13.1.
+
+If a status page application is associated with the project, you can use the `/publish`
+[quick action](../quick_actions.md) to publish the issue.
+
+For more information, see [GitLab Status Page](../../../operations/incident_management/status_page.md).
diff --git a/doc/user/project/issues/multiple_assignees_for_issues.md b/doc/user/project/issues/multiple_assignees_for_issues.md
index 189777d40e7..98e940b6b51 100644
--- a/doc/user/project/issues/multiple_assignees_for_issues.md
+++ b/doc/user/project/issues/multiple_assignees_for_issues.md
@@ -12,8 +12,7 @@ In large teams, where there is shared ownership of an issue, it can be difficult
to track who is working on it, who already completed their contributions, who
didn't even start yet.
-In [GitLab Enterprise Edition](https://about.gitlab.com/pricing/),
-you can also select multiple assignees to an issue, making it easier to
+You can also select multiple [assignees](managing_issues.md#assignee) for an issue, making it easier to
track, and making clearer who is accountable for it.
![multiple assignees for issues](img/multiple_assignees_for_issues.png)
diff --git a/doc/user/project/issues/sorting_issue_lists.md b/doc/user/project/issues/sorting_issue_lists.md
index ebfc723280f..0340f15c25c 100644
--- a/doc/user/project/issues/sorting_issue_lists.md
+++ b/doc/user/project/issues/sorting_issue_lists.md
@@ -37,7 +37,7 @@ creation date. Issues created most recently are first.
## Sorting by due date
When you sort by **Due date**, the issue list changes to sort ascending by the issue
-[due date](issue_data_and_actions.md#due-date). Issues with the earliest due date are first,
+[due date](due_dates.md). Issues with the earliest due date are first,
and issues without a due date are last.
## Sorting by label priority
diff --git a/doc/user/project/merge_requests/getting_started.md b/doc/user/project/merge_requests/getting_started.md
index 006e6d4a8aa..42db5779ac0 100644
--- a/doc/user/project/merge_requests/getting_started.md
+++ b/doc/user/project/merge_requests/getting_started.md
@@ -136,10 +136,18 @@ To learn more, read [Review a merge request](reviews/index.md).
### Merge requests to close issues
-If the merge request is being created to resolve an issue, you can
-add a note in the description which sets it to
-[automatically close the issue](../issues/managing_issues.md#closing-issues-automatically)
-when merged.
+To create a merge request to close an issue when it's merged, you can either:
+
+- [Add a note in the MR description](../issues/managing_issues.md#closing-issues-automatically).
+- In the issue, select **Create a merge request**. Then, you can either:
+
+ - Create a new branch and [a draft merge request](../merge_requests/drafts.md)
+ in one action. The branch is named `issuenumber-title` by default, but you can
+ choose any name, and GitLab verifies that it's not already in use. The merge request
+ inherits the milestone and labels of the issue, and is set to automatically
+ close the issue when it is merged.
+ - Create a [new branch](../repository/web_editor.md#create-a-new-branch-from-an-issue)
+ only, with its name starting with the issue number.
If the issue is [confidential](../issues/confidential_issues.md),
you may want to use a different workflow for
diff --git a/doc/user/todos.md b/doc/user/todos.md
index 9a985664ed1..2486db813ff 100644
--- a/doc/user/todos.md
+++ b/doc/user/todos.md
@@ -29,7 +29,7 @@ Many to-do items are created automatically.
A to-do item is added to your To-Do List when:
- An issue or merge request is assigned to you.
-- You're [mentioned](project/issues/issue_data_and_actions.md#mentions) in the description or
+- You're [mentioned](discussions/index.md#mentions) in the description or
comment of an issue, merge request, or epic.
- You are mentioned in a comment on a commit or design.
- The CI/CD pipeline for your merge request fails.
diff --git a/lib/gitlab/ci/build/context/base.rb b/lib/gitlab/ci/build/context/base.rb
index c7ea7c78e2f..81f96e822f4 100644
--- a/lib/gitlab/ci/build/context/base.rb
+++ b/lib/gitlab/ci/build/context/base.rb
@@ -17,6 +17,12 @@ module Gitlab
raise NotImplementedError
end
+ def variables_hash
+ strong_memoize(:variables_hash) do
+ variables.to_hash
+ end
+ end
+
def project
pipeline.project
end
diff --git a/lib/gitlab/ci/build/policy/variables.rb b/lib/gitlab/ci/build/policy/variables.rb
index 7b1ce6330f0..810523052ae 100644
--- a/lib/gitlab/ci/build/policy/variables.rb
+++ b/lib/gitlab/ci/build/policy/variables.rb
@@ -10,7 +10,7 @@ module Gitlab
end
def satisfied_by?(pipeline, context)
- variables = context.variables
+ variables = context.variables_hash
statements = @expressions.map do |statement|
::Gitlab::Ci::Pipeline::Expression::Statement
diff --git a/lib/gitlab/ci/build/rules/rule/clause/changes.rb b/lib/gitlab/ci/build/rules/rule/clause/changes.rb
index 9c2f6eea1dd..82a59fdb4e1 100644
--- a/lib/gitlab/ci/build/rules/rule/clause/changes.rb
+++ b/lib/gitlab/ci/build/rules/rule/clause/changes.rb
@@ -23,7 +23,7 @@ module Gitlab
return @globs unless context
@globs.map do |glob|
- ExpandVariables.expand_existing(glob, context.variables)
+ ExpandVariables.expand_existing(glob, -> { context.variables_hash })
end
end
end
diff --git a/lib/gitlab/ci/build/rules/rule/clause/if.rb b/lib/gitlab/ci/build/rules/rule/clause/if.rb
index 6143a736ca6..499a265a1e2 100644
--- a/lib/gitlab/ci/build/rules/rule/clause/if.rb
+++ b/lib/gitlab/ci/build/rules/rule/clause/if.rb
@@ -10,7 +10,7 @@ module Gitlab
def satisfied_by?(pipeline, context)
::Gitlab::Ci::Pipeline::Expression::Statement.new(
- @expression, context.variables).truthful?
+ @expression, context.variables_hash).truthful?
end
end
end
diff --git a/lib/gitlab/ci/config/external/context.rb b/lib/gitlab/ci/config/external/context.rb
index c94180a5306..308414af47d 100644
--- a/lib/gitlab/ci/config/external/context.rb
+++ b/lib/gitlab/ci/config/external/context.rb
@@ -9,17 +9,19 @@ module Gitlab
TimeoutError = Class.new(StandardError)
+ include ::Gitlab::Utils::StrongMemoize
+
attr_reader :project, :sha, :user, :parent_pipeline, :variables
attr_reader :expandset, :execution_deadline, :logger
delegate :instrument, to: :logger
- def initialize(project: nil, sha: nil, user: nil, parent_pipeline: nil, variables: [], logger: nil)
+ def initialize(project: nil, sha: nil, user: nil, parent_pipeline: nil, variables: nil, logger: nil)
@project = project
@sha = sha
@user = user
@parent_pipeline = parent_pipeline
- @variables = variables
+ @variables = variables || Ci::Variables::Collection.new
@expandset = Set.new
@execution_deadline = 0
@logger = logger || Gitlab::Ci::Pipeline::Logger.new(project: project)
@@ -39,6 +41,12 @@ module Gitlab
end
end
+ def variables_hash
+ strong_memoize(:variables_hash) do
+ variables.to_hash
+ end
+ end
+
def mutate(attrs = {})
self.class.new(**attrs) do |ctx|
ctx.expandset = expandset
diff --git a/lib/gitlab/ci/config/external/mapper.rb b/lib/gitlab/ci/config/external/mapper.rb
index 7036fddae0b..a5bf066c81f 100644
--- a/lib/gitlab/ci/config/external/mapper.rb
+++ b/lib/gitlab/ci/config/external/mapper.rb
@@ -179,7 +179,7 @@ module Gitlab
end
def expand(data)
- ExpandVariables.expand(data, context.variables)
+ ExpandVariables.expand(data, -> { context.variables_hash })
end
end
end
diff --git a/lib/gitlab/ci/pipeline/expression/lexeme/variable.rb b/lib/gitlab/ci/pipeline/expression/lexeme/variable.rb
index 11d2010909f..6da88fd287e 100644
--- a/lib/gitlab/ci/pipeline/expression/lexeme/variable.rb
+++ b/lib/gitlab/ci/pipeline/expression/lexeme/variable.rb
@@ -9,7 +9,11 @@ module Gitlab
PATTERN = /\$(?<name>\w+)/.freeze
def evaluate(variables = {})
- variables.with_indifferent_access.fetch(@value, nil)
+ unless variables.is_a?(ActiveSupport::HashWithIndifferentAccess)
+ variables = variables.with_indifferent_access
+ end
+
+ variables.fetch(@value, nil)
end
def inspect
diff --git a/lib/gitlab/ci/pipeline/expression/statement.rb b/lib/gitlab/ci/pipeline/expression/statement.rb
index 5f3310dd668..4b13cae792e 100644
--- a/lib/gitlab/ci/pipeline/expression/statement.rb
+++ b/lib/gitlab/ci/pipeline/expression/statement.rb
@@ -9,7 +9,7 @@ module Gitlab
def initialize(statement, variables = nil)
@lexer = Expression::Lexer.new(statement)
- @variables = variables&.to_hash
+ @variables = variables || {}
end
def parse_tree
@@ -19,7 +19,7 @@ module Gitlab
end
def evaluate
- parse_tree.evaluate(@variables.to_h)
+ parse_tree.evaluate(@variables)
end
def truthful?
diff --git a/lib/gitlab/ci/pipeline/seed/build.rb b/lib/gitlab/ci/pipeline/seed/build.rb
index e1695fb19e6..c1e3a4ec3f7 100644
--- a/lib/gitlab/ci/pipeline/seed/build.rb
+++ b/lib/gitlab/ci/pipeline/seed/build.rb
@@ -205,7 +205,7 @@ module Gitlab
def evaluate_runner_tags
@seed_attributes[:tag_list]&.map do |tag|
- ExpandVariables.expand_existing(tag, evaluate_context.variables)
+ ExpandVariables.expand_existing(tag, -> { evaluate_context.variables_hash })
end
end
diff --git a/lib/gitlab/import_export/project/import_export.yml b/lib/gitlab/import_export/project/import_export.yml
index 2172efba83c..878cc906e1a 100644
--- a/lib/gitlab/import_export/project/import_export.yml
+++ b/lib/gitlab/import_export/project/import_export.yml
@@ -126,7 +126,6 @@ included_attributes:
- :project_id
project_badges:
- :created_at
- - :group_id
- :image_url
- :link_url
- :name
@@ -572,7 +571,6 @@ included_attributes:
- :updated_at
actions:
- :event
- - :image_v432x230
design: &design_definition
- :iid
- :project_id
@@ -731,7 +729,6 @@ excluded_attributes:
- :verification_checksum
- :verification_failure
merge_request_diff_files:
- - :diff
- :external_diff_offset
- :external_diff_size
- :merge_request_diff_id
@@ -890,8 +887,6 @@ excluded_attributes:
system_note_metadata:
- :description_version_id
- :note_id
- pipeline_schedules:
- - :active
methods:
notes:
- :type
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 24873d1d758..57bedcaf551 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -4509,6 +4509,9 @@ msgstr ""
msgid "Are you sure you want to delete this SSH key?"
msgstr ""
+msgid "Are you sure you want to delete this deploy key?"
+msgstr ""
+
msgid "Are you sure you want to delete this device? This action cannot be undone."
msgstr ""
@@ -11192,6 +11195,9 @@ msgstr ""
msgid "Delete corpus"
msgstr ""
+msgid "Delete deploy key"
+msgstr ""
+
msgid "Delete file"
msgstr ""
diff --git a/package.json b/package.json
index 13d157e2e15..0c410f0bebd 100644
--- a/package.json
+++ b/package.json
@@ -149,7 +149,7 @@
"lowlight": "^1.20.0",
"marked": "^0.3.12",
"mathjax": "3",
- "mermaid": "^8.13.2",
+ "mermaid": "^8.13.4",
"minimatch": "^3.0.4",
"monaco-editor": "^0.25.2",
"monaco-editor-webpack-plugin": "^4.0.0",
diff --git a/qa/qa/page/component/wiki_page_form.rb b/qa/qa/page/component/wiki_page_form.rb
index fd536ff1dd3..bc73fe0c3ab 100644
--- a/qa/qa/page/component/wiki_page_form.rb
+++ b/qa/qa/page/component/wiki_page_form.rb
@@ -15,6 +15,7 @@ module QA
element :wiki_message_textbox
element :wiki_submit_button
element :try_new_editor_container
+ element :editing_mode_button
end
base.view 'app/assets/javascripts/pages/shared/wikis/components/delete_wiki_modal.vue' do
@@ -36,6 +37,10 @@ module QA
def click_submit
click_element(:wiki_submit_button)
+
+ wait_until(reload: false) do
+ has_no_element?(:wiki_title_textbox)
+ end
end
def delete_page
@@ -43,11 +48,19 @@ module QA
Page::Modal::DeleteWiki.perform(&:confirm_deletion)
end
- def use_new_editor
- within_element(:try_new_editor_container) do
- click_button('Use the new editor')
+ def use_new_editor(toggle)
+ # Update once the feature is released, see https://gitlab.com/gitlab-org/gitlab/-/issues/345398
+ if toggle
+ click_element(:editing_mode_button, mode: 'Edit rich text')
+ else
+ within_element(:try_new_editor_container) do
+ click_button('Use the new editor')
+ end
+ end
+
+ wait_until(reload: false) do
+ has_element?(:content_editor_container)
end
- has_element?(:content_editor_container)
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb b/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb
index 295c5cbdec3..c3dea30746d 100644
--- a/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb
+++ b/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb
@@ -1,12 +1,13 @@
# frozen_string_literal: true
module QA
- RSpec.describe 'Create', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/346149', type: :stale } do
+ RSpec.describe 'Create', :requires_admin do # remove :requires_admin once the ff is enabled by default in https://gitlab.com/gitlab-org/gitlab/-/issues/345398
context 'Content Editor' do
let(:initial_wiki) { Resource::Wiki::ProjectPage.fabricate_via_api! }
let(:page_title) { 'Content Editor Page' }
let(:heading_text) { 'My New Heading' }
let(:image_file_name) { 'testfile.png' }
+ let!(:toggle) { Runtime::Feature.enabled?(:wiki_switch_between_content_editor_raw_markdown) }
before do
Flow::Login.sign_in
@@ -23,7 +24,7 @@ module QA
Page::Project::Wiki::Edit.perform do |edit|
edit.set_title(page_title)
- edit.use_new_editor
+ edit.use_new_editor(toggle)
edit.add_heading('Heading 1', heading_text)
edit.upload_image(File.absolute_path(File.join('qa', 'fixtures', 'designs', image_file_name)))
end
diff --git a/spec/frontend/admin/deploy_keys/components/table_spec.js b/spec/frontend/admin/deploy_keys/components/table_spec.js
index 98b834e3235..49bda7100fb 100644
--- a/spec/frontend/admin/deploy_keys/components/table_spec.js
+++ b/spec/frontend/admin/deploy_keys/components/table_spec.js
@@ -1,10 +1,11 @@
import { merge } from 'lodash';
-import { GlLoadingIcon, GlEmptyState, GlPagination } from '@gitlab/ui';
+import { GlLoadingIcon, GlEmptyState, GlPagination, GlModal } from '@gitlab/ui';
import { nextTick } from 'vue';
import responseBody from 'test_fixtures/api/deploy_keys/index.json';
import { mountExtended } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
+import { stubComponent } from 'helpers/stub_component';
import DeployKeysTable from '~/admin/deploy_keys/components/table.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import Api, { DEFAULT_PER_PAGE } from '~/api';
@@ -12,6 +13,7 @@ import createFlash from '~/flash';
jest.mock('~/api');
jest.mock('~/flash');
+jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' }));
describe('DeployKeysTable', () => {
let wrapper;
@@ -29,13 +31,23 @@ describe('DeployKeysTable', () => {
const createComponent = (provide = {}) => {
wrapper = mountExtended(DeployKeysTable, {
provide: merge({}, defaultProvide, provide),
+ stubs: {
+ GlModal: stubComponent(GlModal, {
+ template: `
+ <div>
+ <slot name="modal-title"></slot>
+ <slot></slot>
+ <slot name="modal-footer"></slot>
+ </div>`,
+ }),
+ },
});
};
const findEditButton = (index) =>
wrapper.findAllByLabelText(DeployKeysTable.i18n.edit, { selector: 'a' }).at(index);
const findRemoveButton = (index) =>
- wrapper.findAllByLabelText(DeployKeysTable.i18n.remove, { selector: 'button' }).at(index);
+ wrapper.findAllByLabelText(DeployKeysTable.i18n.delete, { selector: 'button' }).at(index);
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
const findTimeAgoTooltip = (index) => wrapper.findAllComponents(TimeAgoTooltip).at(index);
const findPagination = () => wrapper.findComponent(GlPagination);
@@ -118,6 +130,27 @@ describe('DeployKeysTable', () => {
expectDeployKeyIsRendered(deployKey, 0);
expectDeployKeyIsRendered(deployKey2, 1);
});
+
+ describe('when delete button is clicked', () => {
+ it('asks user to confirm', async () => {
+ await findRemoveButton(0).trigger('click');
+
+ const modal = wrapper.findComponent(GlModal);
+ const form = modal.find('form');
+ const submitSpy = jest.spyOn(form.element, 'submit');
+
+ expect(modal.props('visible')).toBe(true);
+ expect(form.attributes('action')).toBe(`/admin/deploy_keys/${deployKey.id}`);
+ expect(form.find('input[name="_method"]').attributes('value')).toBe('delete');
+ expect(form.find('input[name="authenticity_token"]').attributes('value')).toBe(
+ 'mock-csrf-token',
+ );
+
+ modal.vm.$emit('primary');
+
+ expect(submitSpy).toHaveBeenCalled();
+ });
+ });
});
describe('pagination', () => {
diff --git a/spec/lib/gitlab/ci/build/context/build_spec.rb b/spec/lib/gitlab/ci/build/context/build_spec.rb
index 46447231424..7f862a3b80a 100644
--- a/spec/lib/gitlab/ci/build/context/build_spec.rb
+++ b/spec/lib/gitlab/ci/build/context/build_spec.rb
@@ -8,11 +8,7 @@ RSpec.describe Gitlab::Ci::Build::Context::Build do
let(:context) { described_class.new(pipeline, seed_attributes) }
- describe '#variables' do
- subject { context.variables.to_hash }
-
- it { expect(context.variables).to be_instance_of(Gitlab::Ci::Variables::Collection) }
-
+ shared_examples 'variables collection' do
it { is_expected.to include('CI_COMMIT_REF_NAME' => 'master') }
it { is_expected.to include('CI_PIPELINE_IID' => pipeline.iid.to_s) }
it { is_expected.to include('CI_PROJECT_PATH' => pipeline.project.full_path) }
@@ -27,4 +23,20 @@ RSpec.describe Gitlab::Ci::Build::Context::Build do
it { is_expected.to include('CI_PROJECT_PATH' => pipeline.project.full_path) }
end
end
+
+ describe '#variables' do
+ subject { context.variables.to_hash }
+
+ it { expect(context.variables).to be_instance_of(Gitlab::Ci::Variables::Collection) }
+
+ it_behaves_like 'variables collection'
+ end
+
+ describe '#variables_hash' do
+ subject { context.variables_hash }
+
+ it { expect(context.variables_hash).to be_instance_of(ActiveSupport::HashWithIndifferentAccess) }
+
+ it_behaves_like 'variables collection'
+ end
end
diff --git a/spec/lib/gitlab/ci/build/context/global_spec.rb b/spec/lib/gitlab/ci/build/context/global_spec.rb
index 61f2b90426d..d4141eb8389 100644
--- a/spec/lib/gitlab/ci/build/context/global_spec.rb
+++ b/spec/lib/gitlab/ci/build/context/global_spec.rb
@@ -8,11 +8,7 @@ RSpec.describe Gitlab::Ci::Build::Context::Global do
let(:context) { described_class.new(pipeline, yaml_variables: yaml_variables) }
- describe '#variables' do
- subject { context.variables.to_hash }
-
- it { expect(context.variables).to be_instance_of(Gitlab::Ci::Variables::Collection) }
-
+ shared_examples 'variables collection' do
it { is_expected.to include('CI_COMMIT_REF_NAME' => 'master') }
it { is_expected.to include('CI_PIPELINE_IID' => pipeline.iid.to_s) }
it { is_expected.to include('CI_PROJECT_PATH' => pipeline.project.full_path) }
@@ -26,4 +22,20 @@ RSpec.describe Gitlab::Ci::Build::Context::Global do
it { is_expected.to include('SUPPORTED' => 'parsed') }
end
end
+
+ describe '#variables' do
+ subject { context.variables.to_hash }
+
+ it { expect(context.variables).to be_instance_of(Gitlab::Ci::Variables::Collection) }
+
+ it_behaves_like 'variables collection'
+ end
+
+ describe '#variables_hash' do
+ subject { context.variables_hash }
+
+ it { is_expected.to be_instance_of(ActiveSupport::HashWithIndifferentAccess) }
+
+ it_behaves_like 'variables collection'
+ end
end
diff --git a/spec/lib/gitlab/ci/build/policy/variables_spec.rb b/spec/lib/gitlab/ci/build/policy/variables_spec.rb
index 6c8c968dc0c..436ad59bdf7 100644
--- a/spec/lib/gitlab/ci/build/policy/variables_spec.rb
+++ b/spec/lib/gitlab/ci/build/policy/variables_spec.rb
@@ -16,7 +16,7 @@ RSpec.describe Gitlab::Ci::Build::Policy::Variables do
let(:seed) do
double('build seed',
to_resource: ci_build,
- variables: ci_build.scoped_variables
+ variables_hash: ci_build.scoped_variables.to_hash
)
end
@@ -91,7 +91,7 @@ RSpec.describe Gitlab::Ci::Build::Policy::Variables do
let(:seed) do
double('bridge seed',
to_resource: bridge,
- variables: ci_build.scoped_variables
+ variables_hash: ci_build.scoped_variables.to_hash
)
end
diff --git a/spec/lib/gitlab/ci/build/rules/rule/clause/changes_spec.rb b/spec/lib/gitlab/ci/build/rules/rule/clause/changes_spec.rb
index d20ea6c9202..532c83f6768 100644
--- a/spec/lib/gitlab/ci/build/rules/rule/clause/changes_spec.rb
+++ b/spec/lib/gitlab/ci/build/rules/rule/clause/changes_spec.rb
@@ -33,12 +33,12 @@ RSpec.describe Gitlab::Ci::Build::Rules::Rule::Clause::Changes do
end
context 'when context has the specified variables' do
- let(:variables) do
- [{ key: "HELM_DIR", value: "helm", public: true }]
+ let(:variables_hash) do
+ { 'HELM_DIR' => 'helm' }
end
before do
- allow(context).to receive(:variables).and_return(variables)
+ allow(context).to receive(:variables_hash).and_return(variables_hash)
end
it { is_expected.to be_truthy }
@@ -49,7 +49,7 @@ RSpec.describe Gitlab::Ci::Build::Rules::Rule::Clause::Changes do
let(:modified_paths) { ['path/with/$in/it/file.txt'] }
before do
- allow(context).to receive(:variables).and_return([])
+ allow(context).to receive(:variables_hash).and_return({})
end
it { is_expected.to be_truthy }
diff --git a/spec/lib/gitlab/ci/build/rules/rule_spec.rb b/spec/lib/gitlab/ci/build/rules/rule_spec.rb
index 6f3c9278677..f905e229415 100644
--- a/spec/lib/gitlab/ci/build/rules/rule_spec.rb
+++ b/spec/lib/gitlab/ci/build/rules/rule_spec.rb
@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Ci::Build::Rules::Rule do
let(:seed) do
double('build seed',
to_resource: ci_build,
- variables: ci_build.scoped_variables
+ variables_hash: ci_build.scoped_variables.to_hash
)
end
diff --git a/spec/lib/gitlab/ci/build/rules_spec.rb b/spec/lib/gitlab/ci/build/rules_spec.rb
index 1d5bdf30278..37bfdca4d1d 100644
--- a/spec/lib/gitlab/ci/build/rules_spec.rb
+++ b/spec/lib/gitlab/ci/build/rules_spec.rb
@@ -3,13 +3,13 @@
require 'spec_helper'
RSpec.describe Gitlab::Ci::Build::Rules do
- let(:pipeline) { create(:ci_pipeline) }
- let(:ci_build) { build(:ci_build, pipeline: pipeline) }
+ let_it_be(:pipeline) { create(:ci_pipeline) }
+ let_it_be(:ci_build) { build(:ci_build, pipeline: pipeline) }
let(:seed) do
double('build seed',
to_resource: ci_build,
- variables: ci_build.scoped_variables
+ variables_hash: ci_build.scoped_variables.to_hash
)
end
diff --git a/spec/lib/gitlab/ci/config/external/context_spec.rb b/spec/lib/gitlab/ci/config/external/context_spec.rb
index 39cb32d90b7..800c563cd0b 100644
--- a/spec/lib/gitlab/ci/config/external/context_spec.rb
+++ b/spec/lib/gitlab/ci/config/external/context_spec.rb
@@ -6,7 +6,8 @@ RSpec.describe Gitlab::Ci::Config::External::Context do
let(:project) { double('Project') }
let(:user) { double('User') }
let(:sha) { '12345' }
- let(:attributes) { { project: project, user: user, sha: sha } }
+ let(:variables) { Gitlab::Ci::Variables::Collection.new([{ 'key' => 'a', 'value' => 'b' }]) }
+ let(:attributes) { { project: project, user: user, sha: sha, variables: variables } }
subject(:subject) { described_class.new(**attributes) }
@@ -15,6 +16,9 @@ RSpec.describe Gitlab::Ci::Config::External::Context do
it { is_expected.to have_attributes(**attributes) }
it { expect(subject.expandset).to eq(Set.new) }
it { expect(subject.execution_deadline).to eq(0) }
+ it { expect(subject.variables).to be_instance_of(Gitlab::Ci::Variables::Collection) }
+ it { expect(subject.variables_hash).to be_instance_of(ActiveSupport::HashWithIndifferentAccess) }
+ it { expect(subject.variables_hash).to include('a' => 'b') }
end
context 'without values' do
@@ -23,6 +27,8 @@ RSpec.describe Gitlab::Ci::Config::External::Context do
it { is_expected.to have_attributes(**attributes) }
it { expect(subject.expandset).to eq(Set.new) }
it { expect(subject.execution_deadline).to eq(0) }
+ it { expect(subject.variables).to be_instance_of(Gitlab::Ci::Variables::Collection) }
+ it { expect(subject.variables_hash).to be_instance_of(ActiveSupport::HashWithIndifferentAccess) }
end
end
diff --git a/spec/lib/gitlab/ci/config/external/rules_spec.rb b/spec/lib/gitlab/ci/config/external/rules_spec.rb
index 1e42cb30ae7..091bd3b07e6 100644
--- a/spec/lib/gitlab/ci/config/external/rules_spec.rb
+++ b/spec/lib/gitlab/ci/config/external/rules_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe Gitlab::Ci::Config::External::Rules do
subject(:rules) { described_class.new(rule_hashes) }
describe '#evaluate' do
- let(:context) { double(variables: {}) }
+ let(:context) { double(variables_hash: {}) }
subject(:result) { rules.evaluate(context).pass? }
@@ -20,13 +20,13 @@ RSpec.describe Gitlab::Ci::Config::External::Rules do
let(:rule_hashes) { [{ if: '$MY_VAR == "hello"' }] }
context 'when the rule matches' do
- let(:context) { double(variables: { MY_VAR: 'hello' }) }
+ let(:context) { double(variables_hash: { 'MY_VAR' => 'hello' }) }
it { is_expected.to eq(true) }
end
context 'when the rule does not match' do
- let(:context) { double(variables: { MY_VAR: 'invalid' }) }
+ let(:context) { double(variables_hash: { 'MY_VAR' => 'invalid' }) }
it { is_expected.to eq(false) }
end
diff --git a/spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb b/spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb
index 115674edc48..3e10ca686ba 100644
--- a/spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/expression/lexeme/variable_spec.rb
@@ -17,30 +17,33 @@ RSpec.describe Gitlab::Ci::Pipeline::Expression::Lexeme::Variable do
end
describe '#evaluate' do
- it 'returns variable value if it is defined' do
- variable = described_class.new('VARIABLE')
+ let(:lexeme) { described_class.new('VARIABLE') }
- expect(variable.evaluate(VARIABLE: 'my variable'))
+ it 'returns variable value if it is defined' do
+ expect(lexeme.evaluate(VARIABLE: 'my variable'))
.to eq 'my variable'
end
it 'allows to use a string as a variable key too' do
- variable = described_class.new('VARIABLE')
-
- expect(variable.evaluate('VARIABLE' => 'my variable'))
+ expect(lexeme.evaluate('VARIABLE' => 'my variable'))
.to eq 'my variable'
end
it 'returns nil if it is not defined' do
- variable = described_class.new('VARIABLE')
-
- expect(variable.evaluate(OTHER: 'variable')).to be_nil
+ expect(lexeme.evaluate('OTHER' => 'variable')).to be_nil
+ expect(lexeme.evaluate(OTHER: 'variable')).to be_nil
end
it 'returns an empty string if it is empty' do
- variable = described_class.new('VARIABLE')
+ expect(lexeme.evaluate('VARIABLE' => '')).to eq ''
+ expect(lexeme.evaluate(VARIABLE: '')).to eq ''
+ end
+
+ it 'does not call with_indifferent_access unnecessarily' do
+ variables_hash = { VARIABLE: 'my variable' }.with_indifferent_access
- expect(variable.evaluate(VARIABLE: '')).to eq ''
+ expect(variables_hash).not_to receive(:with_indifferent_access)
+ expect(lexeme.evaluate(variables_hash)).to eq 'my variable'
end
end
end
diff --git a/spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb b/spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb
index ec7eebdc056..84713e2a798 100644
--- a/spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/expression/statement_spec.rb
@@ -9,6 +9,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Expression::Statement do
.append(key: 'PATH_VARIABLE', value: 'a/path/variable/value')
.append(key: 'FULL_PATH_VARIABLE', value: '/a/full/path/variable/value')
.append(key: 'EMPTY_VARIABLE', value: '')
+ .to_hash
end
subject do
diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml
index 6ffe2187466..0fa3756ff3a 100644
--- a/spec/lib/gitlab/import_export/safe_model_attributes.yml
+++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml
@@ -253,6 +253,7 @@ MergeRequestDiffFile:
- b_mode
- too_large
- binary
+- diff
MergeRequestContextCommit:
- id
- authored_date
diff --git a/spec/support/shared_examples/lib/gitlab/import_export/attributes_permitter_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/import_export/attributes_permitter_shared_examples.rb
index 41d3d76b66b..1ebfbe6ede5 100644
--- a/spec/support/shared_examples/lib/gitlab/import_export/attributes_permitter_shared_examples.rb
+++ b/spec/support/shared_examples/lib/gitlab/import_export/attributes_permitter_shared_examples.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
RSpec.shared_examples 'a permitted attribute' do |relation_sym, permitted_attributes, additional_attributes = []|
- let(:prohibited_attributes) { %i[remote_url my_attributes my_ids token my_id test] }
+ let(:prohibited_attributes) { %w[remote_url my_attributes my_ids token my_id test] }
let(:import_export_config) { Gitlab::ImportExport::Config.new.to_h }
let(:project_relation_factory) { Gitlab::ImportExport::Project::RelationFactory }
@@ -8,7 +8,7 @@ RSpec.shared_examples 'a permitted attribute' do |relation_sym, permitted_attrib
let(:relation_hash) { (permitted_attributes + prohibited_attributes).map(&:to_s).zip([]).to_h }
let(:relation_name) { project_relation_factory.overrides[relation_sym]&.to_sym || relation_sym }
let(:relation_class) { project_relation_factory.relation_class(relation_name) }
- let(:excluded_keys) { import_export_config.dig(:excluded_keys, relation_sym) || [] }
+ let(:excluded_keys) { (import_export_config.dig(:excluded_attributes, relation_sym) || []).map(&:to_s) }
let(:cleaned_hash) do
Gitlab::ImportExport::AttributeCleaner.new(
@@ -18,7 +18,7 @@ RSpec.shared_examples 'a permitted attribute' do |relation_sym, permitted_attrib
).clean
end
- let(:permitted_hash) { subject.permit(relation_sym, relation_hash) }
+ let(:permitted_hash) { subject.permit(relation_sym, relation_hash).transform_keys { |k| k.to_s } }
if described_class.new.permitted_attributes_defined?(relation_sym)
it 'contains only attributes that are defined as permitted in the import/export config' do
@@ -26,11 +26,11 @@ RSpec.shared_examples 'a permitted attribute' do |relation_sym, permitted_attrib
end
it 'does not contain attributes that would be cleaned with AttributeCleaner' do
- expect(cleaned_hash.keys + additional_attributes.to_a).to include(*permitted_hash.keys)
+ expect((cleaned_hash.keys + additional_attributes.to_a.map(&:to_s))).to include(*permitted_hash.keys)
end
it 'does not contain prohibited attributes that are not related to given relation' do
- expect(permitted_hash.keys).not_to include(*prohibited_attributes.map(&:to_s))
+ expect(permitted_hash.keys).not_to include(*prohibited_attributes)
end
else
it 'is disabled' do
diff --git a/workhorse/go.mod b/workhorse/go.mod
index 8b1cbeeba36..9fb4c25166b 100644
--- a/workhorse/go.mod
+++ b/workhorse/go.mod
@@ -29,7 +29,7 @@ require (
github.com/smartystreets/goconvey v1.6.4
github.com/stretchr/testify v1.7.0
gitlab.com/gitlab-org/gitaly/v14 v14.3.0-rc2.0.20211007055622-df7dadcc3f74
- gitlab.com/gitlab-org/golang-archive-zip v0.1.0
+ gitlab.com/gitlab-org/golang-archive-zip v0.1.1
gitlab.com/gitlab-org/labkit v1.6.0
gocloud.dev v0.23.0
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8
diff --git a/workhorse/go.sum b/workhorse/go.sum
index 7dfb3515403..76590474a00 100644
--- a/workhorse/go.sum
+++ b/workhorse/go.sum
@@ -835,8 +835,8 @@ gitlab.com/gitlab-org/gitaly/v14 v14.3.0-rc2.0.20211007055622-df7dadcc3f74 h1:7R
gitlab.com/gitlab-org/gitaly/v14 v14.3.0-rc2.0.20211007055622-df7dadcc3f74/go.mod h1:2McjFiZrwflPGtXSquCAXWzewmxTPytoI/vamNz/QPM=
gitlab.com/gitlab-org/gitlab-shell v1.9.8-0.20201117050822-3f9890ef73dc/go.mod h1:5QSTbpAHY2v0iIH5uHh2KA9w7sPUqPmnLjDApI/sv1U=
gitlab.com/gitlab-org/gitlab-shell v1.9.8-0.20210720163109-50da611814d2/go.mod h1:QWDYBwuy24qGMandtCngLRPzFgnGPg6LSNoJWPKmJMc=
-gitlab.com/gitlab-org/golang-archive-zip v0.1.0 h1:7PoEX9KIr7dBuQDTE+hBQwlOs7PKYsekATrj/i/nR4c=
-gitlab.com/gitlab-org/golang-archive-zip v0.1.0/go.mod h1:ZDtqpWPGPB9qBuZnZDrKQjIdJtkN7ZAoVwhT6H2o2kE=
+gitlab.com/gitlab-org/golang-archive-zip v0.1.1 h1:35k9giivbxwF03+8A05Cm8YoxoakU8FBCj5gysjCTCE=
+gitlab.com/gitlab-org/golang-archive-zip v0.1.1/go.mod h1:ZDtqpWPGPB9qBuZnZDrKQjIdJtkN7ZAoVwhT6H2o2kE=
gitlab.com/gitlab-org/labkit v0.0.0-20190221122536-0c3fc7cdd57c/go.mod h1:rYhLgfrbEcyfinG+R3EvKu6bZSsmwQqcXzLfHWSfUKM=
gitlab.com/gitlab-org/labkit v0.0.0-20200908084045-45895e129029/go.mod h1:SNfxkfUwVNECgtmluVayv0GWFgEjjBs5AzgsowPQuo0=
gitlab.com/gitlab-org/labkit v1.0.0/go.mod h1:nohrYTSLDnZix0ebXZrbZJjymRar8HeV2roWL5/jw2U=
diff --git a/yarn.lock b/yarn.lock
index cb49b73219d..fe2ef79cc14 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4918,12 +4918,7 @@ domhandler@^4.0.0, domhandler@^4.2.0:
dependencies:
domelementtype "^2.2.0"
-dompurify@2.3.1:
- version "2.3.1"
- resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.1.tgz#a47059ca21fd1212d3c8f71fdea6943b8bfbdf6a"
- integrity sha512-xGWt+NHAQS+4tpgbOAI08yxW0Pr256Gu/FNE2frZVTbgrBUn8M7tz7/ktS/LZ2MHeGqz6topj0/xY+y8R5FBFw==
-
-dompurify@^2.3.3:
+dompurify@2.3.3, dompurify@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.3.tgz#c1af3eb88be47324432964d8abc75cf4b98d634c"
integrity sha512-dqnqRkPMAjOZE0FogZ+ceJNM2dZ3V/yNOuFB7+39qpO93hHhfRpHw3heYQC7DPK9FqbQTfBKUJhiSfz4MvXYwg==
@@ -8440,16 +8435,16 @@ merge2@^1.3.0:
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
-mermaid@^8.13.2:
- version "8.13.2"
- resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-8.13.2.tgz#9f8abc66ba1c53b132fdaa0d4a80f4717b7b7655"
- integrity sha512-qTFI7MfC2d+x0Hft5gx063EH9tZg36lERG8o7Zq0Ag+MnO8CgVaMZEU6oA8gzTtTn9upMdy4UlYSLVmavu27cQ==
+mermaid@^8.13.4:
+ version "8.13.4"
+ resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-8.13.4.tgz#924cb85f39380285e0a99f245c66cfa61014a2e1"
+ integrity sha512-zdWtsXabVy1PEAE25Jkm4zbTDlQe8rqNlTMq2B3j+D+NxDskJEY5OsgalarvNLsw+b5xFa1a8D1xcm/PijrDow==
dependencies:
"@braintree/sanitize-url" "^3.1.0"
d3 "^7.0.0"
dagre "^0.8.5"
dagre-d3 "^0.6.4"
- dompurify "2.3.1"
+ dompurify "2.3.3"
graphlib "^2.1.8"
khroma "^1.4.1"
moment-mini "^2.24.0"