Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-03-24 15:09:19 +00:00
parent a46b489e17
commit 036de5f31f
33 changed files with 1255 additions and 447 deletions

View file

@ -640,3 +640,7 @@ Cop/UserAdmin:
- 'lib/gitlab/auth/current_user_mode.rb'
- 'spec/**/*.rb'
- 'ee/spec/**/*.rb'
Performance/OpenStruct:
Exclude:
- 'ee/spec/**/*.rb'

File diff suppressed because it is too large Load diff

View file

@ -323,10 +323,6 @@ Performance/Detect:
Performance/MethodObjectAsBlock:
Enabled: false
# Offense count: 42
Performance/OpenStruct:
Enabled: false
# Offense count: 18
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect.
@ -380,11 +376,6 @@ RSpec/EmptyExampleGroup:
- 'ee/spec/services/personal_access_tokens/revoke_invalid_tokens_spec.rb'
- 'spec/services/projects/prometheus/alerts/notify_service_spec.rb'
# Offense count: 1162
# Cop supports --auto-correct.
RSpec/EmptyLineAfterFinalLetItBe:
Enabled: false
# Offense count: 1428
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.

View file

@ -440,11 +440,7 @@ end
gem 'octokit', '~> 4.15'
# https://gitlab.com/gitlab-org/gitlab/issues/207207
gem 'gitlab-mail_room', '~> 0.0.10', require: false
# Ruby v3.0 promoted net-http and net-imap from stdlib. Adding net-http as a
# dependency avoids "already initialized constant errors" if net-imap is installed.
gem 'net-http', '~> 0.1'
gem 'uri', '= 0.10.0' # Lock this for bundler v2.1.4
gem 'gitlab-mail_room', '~> 0.0.9', require: 'mail_room'
gem 'email_reply_trimmer', '~> 0.1'
gem 'html2text'

View file

@ -268,7 +268,6 @@ GEM
diff-lcs (1.4.4)
diff_match_patch (0.1.0)
diffy (3.3.0)
digest (3.0.0)
discordrb-webhooks (3.4.2)
rest-client (>= 2.0.0)
docile (1.3.2)
@ -465,8 +464,7 @@ GEM
pg_query (~> 1.3)
redis (> 3.0.0, < 5.0.0)
gitlab-license (1.3.1)
gitlab-mail_room (0.0.10)
net-imap (>= 0.2.1)
gitlab-mail_room (0.0.9)
gitlab-markup (1.7.1)
gitlab-net-dns (0.9.1)
gitlab-pry-byebug (3.9.0)
@ -765,18 +763,10 @@ GEM
mustermann (>= 1.0.0)
nap (1.1.0)
nenv (0.3.0)
net-http (0.1.1)
net-protocol
uri
net-http-persistent (4.0.1)
connection_pool (~> 2.2)
net-imap (0.2.1)
digest
net-protocol
strscan
net-ldap (0.16.3)
net-ntp (2.1.3)
net-protocol (0.1.0)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-ssh (6.0.0)
@ -1218,7 +1208,6 @@ GEM
state_machines-activerecord (0.8.0)
activerecord (>= 5.1)
state_machines-activemodel (>= 0.8.0)
strscan (3.0.0)
swd (1.1.2)
activesupport (>= 3)
attr_required (>= 0.0.5)
@ -1289,7 +1278,6 @@ GEM
equalizer (~> 0.0.9)
parser (>= 2.6.5)
procto (~> 0.0.2)
uri (0.10.0)
uri_template (0.7.0)
valid_email (0.1.3)
activemodel
@ -1439,7 +1427,7 @@ DEPENDENCIES
gitlab-fog-google (~> 1.13)
gitlab-labkit (~> 0.16.2)
gitlab-license (~> 1.3)
gitlab-mail_room (~> 0.0.10)
gitlab-mail_room (~> 0.0.9)
gitlab-markup (~> 1.7.1)
gitlab-net-dns (~> 0.9.1)
gitlab-pry-byebug
@ -1501,7 +1489,6 @@ DEPENDENCIES
mini_magick (~> 4.10.1)
minitest (~> 5.11.0)
multi_json (~> 1.14.1)
net-http (~> 0.1)
net-ldap (~> 0.16.3)
net-ntp
net-ssh (~> 6.0)
@ -1610,7 +1597,6 @@ DEPENDENCIES
unicorn (~> 5.5)
unicorn-worker-killer (~> 0.4.4)
unleash (~> 0.1.5)
uri (= 0.10.0)
valid_email (~> 0.1)
validates_hostname (~> 1.0.11)
version_sorter (~> 2.2.4)

View file

@ -1,49 +0,0 @@
<script>
import { GlToggle } from '@gitlab/ui';
import { capitalizeFirstCharacter } from '~/lib/utils/text_utility';
export default {
name: 'GlToggleVuex',
components: {
GlToggle,
},
props: {
stateProperty: {
type: String,
required: true,
},
storeModule: {
type: String,
required: false,
default: null,
},
setAction: {
type: String,
required: false,
default() {
return `set${capitalizeFirstCharacter(this.stateProperty)}`;
},
},
},
computed: {
value: {
get() {
const { state } = this.$store;
const { stateProperty, storeModule } = this;
return storeModule ? state[storeModule][stateProperty] : state[stateProperty];
},
set(value) {
const { stateProperty, storeModule, setAction } = this;
const action = storeModule ? `${storeModule}/${setAction}` : setAction;
this.$store.dispatch(action, { key: stateProperty, value });
},
},
},
};
</script>
<template>
<gl-toggle v-model="value">
<slot v-bind="{ value }"></slot>
</gl-toggle>
</template>

View file

@ -243,19 +243,16 @@ class Deployment < ApplicationRecord
def previous_deployment
@previous_deployment ||=
project.deployments.joins(:environment)
.where(environments: { name: self.environment.name }, ref: self.ref)
.where.not(id: self.id)
self.class.for_environment(environment_id)
.where(ref: ref)
.where.not(id: id)
.order(id: :desc)
.take
end
def previous_environment_deployment
project
.deployments
self.class.for_environment(environment_id)
.success
.joins(:environment)
.where(environments: { name: environment.name })
.where.not(id: self.id)
.order(id: :desc)
.take

View file

@ -0,0 +1,5 @@
---
title: Remove N+1 for API commits/:sha/merge_requests
merge_request: 57290
author:
type: performance

View file

@ -0,0 +1,5 @@
---
title: Optimise query for Deployment#previous_environment_deployment in LinkMergeRequestWorker
merge_request: 57039
author:
type: performance

View file

@ -1,5 +0,0 @@
---
title: Update mailroom to v0.0.10
merge_request: 56913
author:
type: fixed

View file

@ -331,9 +331,3 @@
:why: https://github.com/xijo/reverse_markdown/blob/master/LICENSE
:versions: []
:when: 2021-02-03 08:47:28.792907000 Z
- - :approve
- net-protocol
- :who: Stan Hu
:why: "This license is the same as the Ruby license (BSD): https://github.com/ruby/net-protocol/blob/master/LICENSE.txt"
:versions: []
:when: 2021-03-18 00:00:46.124036000 Z

View file

@ -149,7 +149,7 @@ limited to 1KiB, and descriptions (the rest of the message) will be limited to
The maximum number of issues loaded on the milestone overview page is 3000.
When the number exceeds the limit the page displays an alert and links to a paginated
[issue list](../user/project/issues/index.md#issues-list) of all issues in the milestone.
[issue list](../user/project/issues/managing_issues.md) of all issues in the milestone.
- **Limit:** 3000 issues

View file

@ -504,18 +504,20 @@ so you can use it when resolving some concepts around experimentation in the cli
### Use experiments in Vue
With the `experiment` component, you can define slots that match the name of the
variants pushed to `window.gon.experiment`. For example, an experiment with the
default variants `control` and `candidate` could be implemented like this:
variants pushed to `window.gon.experiment`. For example, if we alter the `pill_color`
experiment to just use the default variants of `control` and `candidate` like so:
```ruby
def show
experiment(:button_color) do |e|
experiment(:pill_color) do |e|
e.use { } # control
e.try { } # candidate
end.run
end
```
We can make use of the named slots `control` and `candidate` in the Vue component:
```vue
<script>
import Experiment from '~/experimentation/components/experiment.vue';
@ -526,20 +528,20 @@ export default {
</script>
<template>
<experiment name="button_name">
<experiment name="pill_color">
<template #control>
<button>Click me</button>
<button class="bg-default">Click default button</button>
</template>
<template #candidate>
<button>You will not believe what happens when you click this button</button>
<button class="bg-red">Click red button</button>
</template>
</experiment>
</template>
```
When you use a multivariate experiment, you can use the variant names. For example,
the Vue component for the `pill_color` experiment would look like this:
When you're coding for an experiment with multiple variants, you can use the variant names.
For example, the Vue component for the previously-defined `pill_color` experiment with `red` and `blue` variants would look like this:
```vue
<template>
@ -560,7 +562,7 @@ the Vue component for the `pill_color` experiment would look like this:
```
NOTE:
When there is no experiment defined in the frontend via `experiment(:experiment_name)`, then `control` will be rendered if it exists.
When there is no experiment data in the `window.gon.experiment` object for the given experiment name, the `control` slot will be used, if it exists.
## Notes on feature flags

View file

@ -31,7 +31,7 @@ When bulk editing issues in a group, you can edit the following attributes:
- [Epic](../epics/index.md)
- [Milestone](../../project/milestones/index.md)
- [Labels](../../project/labels.md)
- [Health status](../../project/issues/index.md#health-status)
- [Health status](../../project/issues/managing_issues.md#health-status)
- [Iteration](../iterations/index.md)
To update multiple project issues at the same time:

View file

@ -81,7 +81,7 @@ to:
> - The health status of a closed issue [is hidden](https://gitlab.com/gitlab-org/gitlab/-/issues/220867) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.3 or later.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/213567) in GitLab 13.7.
Report or respond to the health of issues and epics by setting a red, amber, or green [health status](../../project/issues/index.md#health-status), which then appears on your Epic tree.
Report or respond to the health of issues and epics by setting a red, amber, or green [health status](../../project/issues/managing_issues.md#health-status), which then appears on your Epic tree.
## Multi-level child epics **(ULTIMATE)**

View file

@ -16,7 +16,7 @@ Then you can:
- Grant members access to multiple projects at once.
- Add to-do items for all of the group members at once.
- View the [issues](../project/issues/index.md#issues-list) and
- View the [issues](../project/issues/index.md) and
[merge requests](../project/merge_requests/reviewing_and_managing_merge_requests.md#view-merge-requests-for-all-projects-in-a-group)
for all projects in the group, together in a single list view.
- [Bulk edit](../group/bulk_editing/index.md) issues, epics, and merge requests.
@ -454,24 +454,21 @@ API requests to add a new user to a project are not possible.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1985) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 12.0.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/215410) to [GitLab Premium](https://about.gitlab.com/pricing/) in 13.1.
NOTE:
IP access restrictions are not functioning as expected on GitLab.com. If enabled,
users cannot perform Git operations through SSH, or access projects in the UI.
For more information, [see this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/271673).
To ensure only people from your organization can access particular
resources, you can restrict access to groups by IP address. This setting applies to all subgroups,
projects, issues, and so on.
resources, you can restrict access to groups by IP address. This group-level setting
applies to:
IP access restrictions can be configured at the group level only.
This restriction applies to:
- The GitLab UI.
- The GitLab UI, including subgroups, projects, and issues.
- [In GitLab 12.3 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/12874), the API.
- [In GitLab 12.4 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/32113), Git actions via SSH.
Administrators and group owners are able to access the group regardless of the IP restriction.
You should consider these security implications before configuring IP address restrictions:
- **SSH requests**: While you can restrict HTTP traffic on GitLab.com with IP address restrictions,
they cause SSH requests, including Git operations over SSH, to fail. For more information,
read [issue 271673](https://gitlab.com/gitlab-org/gitlab/-/issues/271673).
- **Administrators and group owners**: Users with these permission levels can always
access the group settings, regardless of IP restriction, but the can't access projects
belonging to the group when accessing from a disallowed IP address.
To restrict group access by IP address:

View file

@ -42,7 +42,7 @@ GitLab is a Git-based platform that integrates a great number of essential tools
- Hosting code in repositories with version control.
- Tracking proposals for new implementations, bug reports, and feedback with a
fully featured [Issue Tracker](project/issues/index.md#issues-list).
fully featured [Issue tracker](project/issues/index.md).
- Organizing and prioritizing with [Issue Boards](project/issue_board.md).
- Reviewing code in [Merge Requests](project/merge_requests/index.md) with live-preview changes per
branch with [Review Apps](../ci/review_apps/index.md).

View file

@ -33,7 +33,7 @@ When bulk editing issues in a project, you can edit the following attributes:
- [Epic](../group/epics/index.md)
- [Milestone](milestones/index.md)
- [Labels](labels.md)
- [Health status](issues/index.md#health-status)
- [Health status](issues/managing_issues.md#health-status)
- Notification subscription
- [Iteration](../group/iterations/index.md)

View file

@ -14,7 +14,7 @@ It can be used as a [Kanban](https://en.wikipedia.org/wiki/Kanban_(development))
It pairs issue tracking and project management, keeping everything together,
so that you don't need to jump between different platforms to organize your workflow.
Issue boards build on the existing [issue tracking functionality](issues/index.md#issues-list) and
Issue boards build on the existing [issue tracking functionality](issues/index.md) and
[labels](labels.md). Your issues appear as cards in vertical lists, organized by their assigned
labels, [milestones](#milestone-lists), or [assignees](#assignee-lists).
@ -88,7 +88,7 @@ You can tailor GitLab issue boards to your own preferred workflow.
Here are some common use cases for issue boards.
For examples of using issue boards along with [epics](../group/epics/index.md),
[issue health status](issues/index.md#health-status), and
[issue health status](issues/managing_issues.md#health-status), and
[scoped labels](labels.md#scoped-labels) for various Agile frameworks, check:
- The [How to use GitLab for Agile portfolio planning and project management](https://about.gitlab.com/blog/2020/11/11/gitlab-for-agile-portfolio-planning-project-management/) blog post (November 2020)

View file

@ -37,7 +37,7 @@ The last way to set a due date is by using [quick actions](../quick_actions.md),
## Making use of due dates
You can see issues with their due dates in the [issues list](index.md#issues-list).
You can see issues with their due dates in the issues list.
Overdue issues have their icon and date colored red.
To sort issues by their due dates, select **Due date** from the dropdown menu on the right.
Issues are then sorted from the earliest due date to the latest.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

View file

@ -6,209 +6,46 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Issues **(FREE)**
Issues are the fundamental mechanism in GitLab to collaborate on ideas, solve
problems, and plan work.
Using issues, you can share and discuss proposals (both before and during their
implementation) between you and your team, and outside collaborators.
Use issues to collaborate on ideas, solve problems, and plan work.
Share and discuss proposals with your team and with outside collaborators.
You can use issues for many purposes, customized to your needs and workflow.
Common use cases include:
- Discussing the implementation of a new idea.
- Tracking tasks and work status.
- Accepting feature proposals, questions, support requests, or bug reports.
- Elaborating on new code implementations.
- Discuss the implementation of an idea.
- Track tasks and work status.
- Accept feature proposals, questions, support requests, or bug reports.
- Elaborate on code implementations.
For more information about using issues, see the
[Always start a discussion with an issue](https://about.gitlab.com/blog/2016/03/03/start-with-an-issue/)
GitLab blog post.
For more information about using issues, see the GitLab blog post:
[Always start a discussion with an issue](https://about.gitlab.com/blog/2016/03/03/start-with-an-issue/).
Issues are always associated with a specific project. If you have multiple
projects in a group, you can view all of the issues collectively at the group
level.
projects in a group, you can view all of the projects' issues at once.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
To learn how our Strategic Marketing department uses GitLab issues with [labels](../labels.md) and
To learn how the GitLab Strategic Marketing department uses GitLab issues with [labels](../labels.md) and
[issue boards](../issue_board.md), see the video on
[Managing Commitments with Issues](https://www.youtube.com/watch?v=cuIHNintg1o&t=3).
## Parts of an issue
Issues have a flexible content and metadata structure. Here are some of the
elements you can provide in an issue:
- Title
- Description and tasks
- Comments and other activity
- Author
- Assignees
- State (open or closed)
- Health status (on track, needs attention, or at risk)
- Confidentiality
- Tasks (completed vs. outstanding)
- Milestone
- Due date
- Weight
- Time tracking
- Labels
- Votes
- Reaction emoji
- Linked issues
- Assigned epic
- Unique issue number and URL
## View and manage issues
Key actions for issues include:
- [Creating issues](managing_issues.md#create-a-new-issue)
- [Moving issues](managing_issues.md#moving-issues)
- [Closing issues](managing_issues.md#closing-issues)
- [Deleting issues](managing_issues.md#deleting-issues)
- [Promoting issues](managing_issues.md#promote-an-issue-to-an-epic)
Although you can view and manage details of an issue on the [issue page](#issue-page),
you can also work with several issues at a time by using these features:
- [Issues List](#issues-list): View a list of issues in a project or group.
- [Issue Boards](../issue_board.md): Organize issues with a project management
workflow for a feature or product release.
- Issue references
- [Epics](../../group/epics/index.md): Manage your portfolio of projects by
tracking groups of issues with a shared theme.
### Issue page
![Issue view](img/issues_main_view.png)
On an issue's page, you can view [all aspects of the issue](issue_data_and_actions.md),
and modify them if you have the necessary [permissions](../../permissions.md).
#### Real-time sidebar **(FREE SELF)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17589) in GitLab 13.3.
Assignees in the sidebar are updated in real time. This feature is **disabled by default**.
To enable it, you need to enable [ActionCable in-app mode](https://docs.gitlab.com/omnibus/settings/actioncable.html).
### Issues List
![Project Issues List view](img/project_issues_list_view.png)
In the Issues List, you can:
- View all issues in a project when opening the Issues List from a project context.
- View all issues in a groups's projects when opening the Issues List from a group context.
You can filter the Issues List with a [search query](../../search/index.md#filtering-issue-and-merge-request-lists),
including specific metadata, such as labels, assignees, status, and more. From this
view, you can also make certain changes [in bulk](../bulk_editing.md) to the displayed issues.
For more information, see the [Issue Data and Actions](issue_data_and_actions.md) page
for a rundown of all the fields and information in an issue.
You can sort a list of issues in several ways, for example by issue creation date, milestone due date.
For more information, see the [Sorting and ordering issue lists](sorting_issue_lists.md) page.
#### Cached issue count
> - [Introduced]([link-to-issue](https://gitlab.com/gitlab-org/gitlab/-/issues/243753)) in GitLab 13.9.
> - It's [deployed behind a feature flag](../../feature_flags.md), disabled by default.
> - It's disabled on GitLab.com.
> - It's not recommended for production use.
> - To use this feature in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-cached-issue-count) **(FREE SELF)**
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
In a group, the sidebar displays the total count of open issues and this value is cached if higher
than 1000. The cached value is rounded to thousands (or millions) and updated every 24 hours.
### Design Management
With [Design Management](design_management.md), you can upload design
assets to issues and view them all together for sharing and
collaboration with your team.
### Related issues
You can mark two issues as related, so that when viewing one, the other is always
listed in its [Related Issues](related_issues.md) section. This can help display important
context, such as past work, dependencies, or duplicates.
Users of [GitLab Premium](https://about.gitlab.com/pricing/) or higher can
also mark issues as blocking or blocked by another issue.
### Crosslinking issues
You can [cross-link issues](crosslinking_issues.md) by referencing an issue from another
issue or merge request by including its URL or ID. The referenced issue displays a
message in the Activity stream about the reference, with a link to the other issue or MR.
### Similar issues
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/22866) in GitLab 11.6.
To prevent duplication of issues for the same topic, GitLab searches for similar issues
when new issues are being created.
As you type in the title field of the **New Issue** page, GitLab searches titles and descriptions
across all issues to in the current project. Only issues you have access to are returned.
Up to five similar issues, sorted by most recently updated, are displayed below the title box.
[GraphQL](../../../api/graphql/index.md) must be enabled to use this feature.
![Similar issues](img/similar_issues.png)
### Health status **(ULTIMATE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/36427) in GitLab Ultimate 12.10.
> - Health status of closed issues [can't be edited](https://gitlab.com/gitlab-org/gitlab/-/issues/220867) in GitLab Ultimate 13.4 and later.
> - Issue health status visible in issue lists [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45141) in GitLab Ultimate 13.6.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/213567) in GitLab 13.7.
To help you track issue statuses, you can assign a status to each issue.
This marks issues as progressing as planned or needs attention to keep on schedule:
- **On track** (green)
- **Needs attention** (amber)
- **At risk** (red)
!["On track" health status on an issue](img/issue_health_status_dropdown_v12_10.png)
After an issue is closed, its health status can't be edited and the "Edit" button becomes disabled
until the issue is reopened.
You can then see issue statuses in the [issue list](#issues-list) and the
[Epic tree](../../group/epics/index.md#issue-health-status-in-epic-tree).
## Other Issue actions
## Related topics
- [Create issues](managing_issues.md#create-a-new-issue)
- [Create an issue from a template](../../project/description_templates.md#use-the-templates)
- [Move issues](managing_issues.md#moving-issues)
- [Close issues](managing_issues.md#closing-issues)
- [Delete issues](managing_issues.md#deleting-issues)
- [Promote issues](managing_issues.md#promote-an-issue-to-an-epic)
- [Set a due date](due_dates.md)
- [Bulk edit issues](../bulk_editing.md) - From the Issues List, select multiple issues
in order to change their status, assignee, milestone, or labels in bulk.
- [Import issues](csv_import.md)
- [Export issues](csv_export.md)
- [Upload designs to issues](design_management.md)
- [Relate issues](related_issues.md)
- [Cross-link issues](crosslinking_issues.md)
- [Bulk edit issues](../bulk_editing.md)
- [Sort issue lists](sorting_issue_lists.md)
- [Search for issues](../../search/index.md#filtering-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)
such as Jira, Redmine, Bugzilla, or EWM.
## Enable or disable cached issue count **(FREE SELF)**
Cached issue count in the left sidebar is under development and not ready for production use. It is
deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can disable it.
To disable it:
```ruby
Feature.disable(:cached_sidebar_open_issues_count)
```
To enable it:
```ruby
Feature.enable(:cached_sidebar_open_issues_count)
```
- [Configure an external issue tracker](../../../integration/external-issue-tracker.md)
- [Parts of an issue](issue_data_and_actions.md)

View file

@ -144,7 +144,7 @@ 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`
## Moving Issues
## Moving issues
Moving an issue copies it to the target project, and closes it in the originating project.
The original issue is not deleted. A system note, which indicates
@ -154,7 +154,7 @@ The "Move issue" button is at the bottom of the right-sidebar when viewing the i
![move issue - button](img/sidebar_move_issue.png)
### Moving Issues in Bulk
### Moving issues in bulk **(FREE SELF)**
If you have advanced technical skills you can also bulk move all the issues from
one project to another in the rails console. The below script moves all issues
@ -315,3 +315,79 @@ To add an issue to an [iteration](../../group/iterations/index.md):
You can also use the `/iteration`
[quick action](../quick_actions.md#issues-merge-requests-and-epics)
in a comment or description field.
## Real-time sidebar **(FREE SELF)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17589) in GitLab 13.3.
Assignees in the sidebar are updated in real time. This feature is **disabled by default**.
To enable it, you need to enable [ActionCable in-app mode](https://docs.gitlab.com/omnibus/settings/actioncable.html).
## Cached issue count **(FREE SELF)**
> - [Introduced]([link-to-issue](https://gitlab.com/gitlab-org/gitlab/-/issues/243753)) in GitLab 13.9.
> - It's [deployed behind a feature flag](../../feature_flags.md), disabled by default.
> - It's disabled on GitLab.com.
> - It's not recommended for production use.
> - To use this feature in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-cached-issue-count) **(FREE SELF)**
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
In a group, the sidebar displays the total count of open issues and this value is cached if higher
than 1000. The cached value is rounded to thousands (or millions) and updated every 24 hours.
## Similar issues
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/22866) in GitLab 11.6.
To prevent duplication of issues for the same topic, GitLab searches for similar issues
when new issues are being created.
As you type in the title field of the **New Issue** page, GitLab searches titles and descriptions
across all issues to in the current project. Only issues you have access to are returned.
Up to five similar issues, sorted by most recently updated, are displayed below the title box.
[GraphQL](../../../api/graphql/index.md) must be enabled to use this feature.
![Similar issues](img/similar_issues.png)
## Health status **(ULTIMATE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/36427) in GitLab Ultimate 12.10.
> - Health status of closed issues [can't be edited](https://gitlab.com/gitlab-org/gitlab/-/issues/220867) in GitLab Ultimate 13.4 and later.
> - Issue health status visible in issue lists [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45141) in GitLab Ultimate 13.6.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/213567) in GitLab 13.7.
To help you track issue statuses, you can assign a status to each issue.
This marks issues as progressing as planned or needs attention to keep on schedule:
- **On track** (green)
- **Needs attention** (amber)
- On track (green)
- Needs attention (amber)
- At risk (red)
After an issue is closed, its health status can't be edited and the **Edit** button becomes disabled
until the issue is reopened.
You can then see issue statuses in the issues list and the
[epic tree](../../group/epics/index.md#issue-health-status-in-epic-tree).
## Enable or disable cached issue count **(FREE SELF)**
Cached issue count in the left sidebar is under development and not ready for production use. It is
deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can disable it.
To disable it:
```ruby
Feature.disable(:cached_sidebar_open_issues_count)
```
To enable it:
```ruby
Feature.enable(:cached_sidebar_open_issues_count)
```

View file

@ -17,9 +17,9 @@ then it cannot be merged until its dependency is itself merged.
NOTE:
Merge requests dependencies are a **PREMIUM** feature, but this restriction is
only enforced for the dependent merge request. A merge request in a **FREE** or
**STARTER** project can be a dependency of a **PREMIUM** merge request, but not
vice-versa.
only enforced for the dependent merge request. A merge request in a **FREE**
project can be a dependency of a **PREMIUM** merge request, but not
the other way around.
## Use cases

View file

@ -160,7 +160,7 @@ To edit the custom email display name:
1. Enter a new name in **Email display name**.
1. Select **Save Changes**.
### Using custom email address
### Using custom email address **(FREE SELF)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/2201) in GitLab Premium 13.0.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/284656) in GitLab 13.8.

View file

@ -372,7 +372,7 @@ module API
current_user,
project_id: user_project.id,
commit_sha: commit.sha
).execute
).execute.with_api_entity_associations
present paginate(commit_merge_requests), with: Entities::MergeRequestBasic
end

View file

@ -20,15 +20,48 @@ performance:
fi
- export CI_ENVIRONMENT_URL=$(cat environment_url.txt)
- mkdir gitlab-exporter
# Busybox wget does not support proxied HTTPS, get the real thing.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/287611.
- (env | grep -i _proxy= 2>&1 >/dev/null) && apk --no-cache add wget
- wget -O gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/1.1.0/index.js
- mkdir sitespeed-results
- |
function propagate_env_vars() {
CURRENT_ENV=$(printenv)
for VAR_NAME; do
echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
done
}
- |
if [ -f .gitlab-urls.txt ]
then
sed -i -e 's@^@'"$CI_ENVIRONMENT_URL"'@' .gitlab-urls.txt
docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io $SITESPEED_IMAGE:$SITESPEED_VERSION --plugins.add ./gitlab-exporter --cpu --outputFolder sitespeed-results .gitlab-urls.txt $SITESPEED_OPTIONS
docker run \
$(propagate_env_vars \
auto_proxy \
https_proxy \
http_proxy \
no_proxy \
AUTO_PROXY \
HTTPS_PROXY \
HTTP_PROXY \
NO_PROXY \
) \
--shm-size=1g --rm -v "$(pwd)":/sitespeed.io $SITESPEED_IMAGE:$SITESPEED_VERSION --plugins.add ./gitlab-exporter --cpu --outputFolder sitespeed-results .gitlab-urls.txt $SITESPEED_OPTIONS
else
docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io $SITESPEED_IMAGE:$SITESPEED_VERSION --plugins.add ./gitlab-exporter --cpu --outputFolder sitespeed-results "$CI_ENVIRONMENT_URL" $SITESPEED_OPTIONS
docker run \
$(propagate_env_vars \
auto_proxy \
https_proxy \
http_proxy \
no_proxy \
AUTO_PROXY \
HTTPS_PROXY \
HTTP_PROXY \
NO_PROXY \
) \
--shm-size=1g --rm -v "$(pwd)":/sitespeed.io $SITESPEED_IMAGE:$SITESPEED_VERSION --plugins.add ./gitlab-exporter --cpu --outputFolder sitespeed-results "$CI_ENVIRONMENT_URL" $SITESPEED_OPTIONS
fi
- mv sitespeed-results/data/performance.json browser-performance.json
artifacts:

View file

@ -18,9 +18,32 @@ performance:
- docker:stable-dind
script:
- mkdir gitlab-exporter
# Busybox wget does not support proxied HTTPS, get the real thing.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/287611.
- (env | grep -i _proxy= 2>&1 >/dev/null) && apk --no-cache add wget
- wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/1.1.0/index.js
- mkdir sitespeed-results
- docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io $SITESPEED_IMAGE:$SITESPEED_VERSION --plugins.add ./gitlab-exporter --cpu --outputFolder sitespeed-results $URL $SITESPEED_OPTIONS
- |
function propagate_env_vars() {
CURRENT_ENV=$(printenv)
for VAR_NAME; do
echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
done
}
- |
docker run \
$(propagate_env_vars \
auto_proxy \
https_proxy \
http_proxy \
no_proxy \
AUTO_PROXY \
HTTPS_PROXY \
HTTP_PROXY \
NO_PROXY \
) \
--shm-size=1g --rm -v "$(pwd)":/sitespeed.io $SITESPEED_IMAGE:$SITESPEED_VERSION --plugins.add ./gitlab-exporter --cpu --outputFolder sitespeed-results $URL $SITESPEED_OPTIONS
- mv sitespeed-results/data/performance.json browser-performance.json
artifacts:
paths:

View file

@ -1,114 +0,0 @@
import { GlToggle } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import GlToggleVuex from '~/vue_shared/components/gl_toggle_vuex.vue';
const localVue = createLocalVue();
localVue.use(Vuex);
describe('GlToggleVuex component', () => {
let wrapper;
let store;
const findButton = () => wrapper.find('button');
const createWrapper = (props = {}) => {
wrapper = mount(GlToggleVuex, {
localVue,
store,
propsData: {
stateProperty: 'toggleState',
...props,
},
});
};
beforeEach(() => {
store = new Vuex.Store({
state: {
toggleState: false,
},
actions: {
setToggleState: ({ commit }, { key, value }) => commit('setToggleState', { key, value }),
},
mutations: {
setToggleState: (state, { key, value }) => {
state[key] = value;
},
},
});
createWrapper();
});
afterEach(() => {
wrapper.destroy();
});
it('renders gl-toggle', () => {
expect(wrapper.find(GlToggle).exists()).toBe(true);
});
it('properly computes default value for setAction', () => {
expect(wrapper.props('setAction')).toBe('setToggleState');
});
describe('without a store module', () => {
it('calls action with new value when value changes', () => {
jest.spyOn(store, 'dispatch');
findButton().trigger('click');
expect(store.dispatch).toHaveBeenCalledWith('setToggleState', {
key: 'toggleState',
value: true,
});
});
it('updates store property when value changes', () => {
findButton().trigger('click');
expect(store.state.toggleState).toBe(true);
});
});
describe('with a store module', () => {
beforeEach(() => {
store = new Vuex.Store({
modules: {
someModule: {
namespaced: true,
state: {
toggleState: false,
},
actions: {
setToggleState: ({ commit }, { key, value }) =>
commit('setToggleState', { key, value }),
},
mutations: {
setToggleState: (state, { key, value }) => {
state[key] = value;
},
},
},
},
});
createWrapper({
storeModule: 'someModule',
});
});
it('calls action with new value when value changes', () => {
jest.spyOn(store, 'dispatch');
findButton().trigger('click');
expect(store.dispatch).toHaveBeenCalledWith('someModule/setToggleState', {
key: 'toggleState',
value: true,
});
});
it('updates store property when value changes', () => {
findButton().trigger('click');
expect(store.state.someModule.toggleState).toBe(true);
});
});
});

View file

@ -574,7 +574,7 @@ RSpec.describe Deployment do
describe '#previous_deployment' do
it 'returns the previous deployment' do
deploy1 = create(:deployment)
deploy1 = create(:deployment, :success)
deploy2 = create(
:deployment,
project: deploy1.project,
@ -583,6 +583,18 @@ RSpec.describe Deployment do
expect(deploy2.previous_deployment).to eq(deploy1)
end
it 'returns nothing if the refs do not match' do
deploy1 = create(:deployment, :success)
deploy2 = create(
:deployment,
:review_app,
project: deploy1.project,
environment: deploy1.environment
)
expect(deploy2.previous_deployment).to be_nil
end
end
describe '#link_merge_requests' do

View file

@ -1898,8 +1898,12 @@ RSpec.describe API::Commits do
let(:merged_mr) { create(:merge_request, source_project: project, source_branch: 'master', target_branch: 'feature') }
let(:commit) { merged_mr.merge_request_diff.commits.last }
it 'returns the correct merge request' do
def perform_request(user)
get api("/projects/#{project.id}/repository/commits/#{commit.id}/merge_requests", user)
end
it 'returns the correct merge request' do
perform_request(user)
expect(response).to have_gitlab_http_status(:ok)
expect(response).to include_limited_pagination_headers
@ -1910,7 +1914,7 @@ RSpec.describe API::Commits do
it 'returns 403 for an unauthorized user' do
project.add_guest(user)
get api("/projects/#{project.id}/repository/commits/#{commit.id}/merge_requests", user)
perform_request(user)
expect(response).to have_gitlab_http_status(:forbidden)
end
@ -1926,11 +1930,21 @@ RSpec.describe API::Commits do
let(:non_member) { create(:user) }
it 'responds 403 when only members are allowed to read merge requests' do
get api("/projects/#{project.id}/repository/commits/#{commit.id}/merge_requests", non_member)
perform_request(non_member)
expect(response).to have_gitlab_http_status(:forbidden)
end
end
it 'returns multiple merge requests without N + 1' do
perform_request(user)
control_count = ActiveRecord::QueryRecorder.new { perform_request(user) }.count
create(:merge_request, :closed, source_project: project, source_branch: 'master', target_branch: 'feature')
expect { perform_request(user) }.not_to exceed_query_limit(control_count)
end
end
describe 'GET /projects/:id/repository/commits/:sha/signature' do