Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-11-25 12:10:23 +00:00
parent 4d60d012f8
commit 85a825bbbf
59 changed files with 412 additions and 433 deletions

View File

@ -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>

View File

@ -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) => {

View File

@ -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

View File

@ -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?

View File

@ -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

View File

@ -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).

View File

@ -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.

View File

@ -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

View File

@ -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` |

View File

@ -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)

View File

@ -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.

View File

@ -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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -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)

View File

@ -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 -->

View File

@ -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.
![close issue - button](img/button_close_issue_v13_6.png)
To close an issue, you can do the following:
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.
- Select **Close issue**:
![close issue from the issue board](img/close_issue_from_board.gif)
![close issue - button](img/button_close_issue_v13_6.png)
- 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).

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -179,7 +179,7 @@ module Gitlab
end
def expand(data)
ExpandVariables.expand(data, context.variables)
ExpandVariables.expand(data, -> { context.variables_hash })
end
end
end

View File

@ -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

View File

@ -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?

View File

@ -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

View File

@ -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

View File

@ -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 ""

View File

@ -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",

View File

@ -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

View File

@ -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

View File

@ -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', () => {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 }

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
expect(variable.evaluate(VARIABLE: '')).to eq ''
it 'does not call with_indifferent_access unnecessarily' do
variables_hash = { VARIABLE: 'my variable' }.with_indifferent_access
expect(variables_hash).not_to receive(:with_indifferent_access)
expect(lexeme.evaluate(variables_hash)).to eq 'my variable'
end
end
end

View File

@ -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

View File

@ -253,6 +253,7 @@ MergeRequestDiffFile:
- b_mode
- too_large
- binary
- diff
MergeRequestContextCommit:
- id
- authored_date

View File

@ -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

View File

@ -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

View File

@ -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=

View File

@ -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"