Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-01-12 21:10:47 +00:00
parent 141ef7e939
commit eb489ab3e7
51 changed files with 383 additions and 329 deletions

View File

@ -77,5 +77,4 @@ const initLabelIndex = () => {
},
});
};
document.addEventListener('DOMContentLoaded', initLabelIndex);
initLabelIndex();

View File

@ -1,4 +1,4 @@
#import "~/pipelines/graphql/queries/pipeline_stages_connection.fragment.graphql"
#import "~/pipelines/graphql/fragments/pipeline_stages_connection.fragment.graphql"
query getCiConfigData($projectPath: ID!, $content: String!) {
ciConfig(projectPath: $projectPath, content: $content) {

View File

@ -105,9 +105,7 @@ export default {
highlightedJobs() {
// If you are hovering on a job, then the jobs we want to highlight are:
// The job you are currently hovering + all of its needs.
return this.hasHighlightedJob
? [this.highlightedJob, ...this.needsObject[this.highlightedJob]]
: [];
return [this.highlightedJob, ...this.needsObject[this.highlightedJob]];
},
highlightedLinks() {
// If you are hovering on a job, then the links we want to highlight are:

View File

@ -4,6 +4,7 @@ fragment PipelineStagesConnection on CiConfigStageConnection {
groups {
nodes {
name
size
jobs {
nodes {
name

View File

@ -1,5 +1,6 @@
import { pickBy } from 'lodash';
import { SUPPORTED_FILTER_PARAMETERS } from './constants';
import { createNodeDict } from './components/parsing_utils';
export const validateParams = (params) => {
return pickBy(params, (val, key) => SUPPORTED_FILTER_PARAMETERS.includes(key) && val);
@ -15,19 +16,8 @@ export const createUniqueLinkId = (stageName, jobName) => `${stageName}-${jobNam
* @returns {Object} - Hash of jobs
*/
export const createJobsHash = (stages = []) => {
const jobsHash = {};
stages.forEach((stage) => {
if (stage.groups.length > 0) {
stage.groups.forEach((group) => {
group.jobs.forEach((job) => {
jobsHash[job.name] = job;
});
});
}
});
return jobsHash;
const nodes = stages.flatMap(({ groups }) => groups);
return createNodeDict(nodes);
};
/**
@ -56,6 +46,14 @@ export const generateJobNeedsDict = (jobs = {}) => {
// to save some performance.
const newNeeds = acc[job] ?? recursiveNeeds(job);
// In case it's a parallel job (size > 1), the name of the group
// and the job will be different. This mean we also need to add the group name
// to the list of `needs` to ensure we can properly reference it.
const group = jobs[job];
if (group.size > 1) {
return [job, group.name, ...newNeeds];
}
return [job, ...newNeeds];
})
.flat(Infinity);

View File

@ -107,7 +107,7 @@ export default {
},
computed: {
/**
* Determines if we shoud render the ref info section based
* Determines if we should render the ref info section based
*/
shouldShowRefInfo() {
return this.showRefInfo && (this.commitRef || this.mergeRequestRef);

View File

@ -165,7 +165,7 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
end
def render_merge_ref_head_diff?
Gitlab::Utils.to_boolean(params[:diff_head]) && @merge_request.diffable_merge_ref?
Gitlab::Utils.to_boolean(params[:diff_head]) && @merge_request.diffable_merge_ref? && @start_sha.nil?
end
def note_positions

View File

@ -2491,16 +2491,12 @@ class Project < ApplicationRecord
end
def service_desk_custom_address
return unless service_desk_custom_address_enabled?
return unless Gitlab::ServiceDeskEmail.enabled?
key = service_desk_setting&.project_key
return unless key.present?
::Gitlab::ServiceDeskEmail.address_for_key("#{full_path_slug}-#{key}")
end
def service_desk_custom_address_enabled?
::Gitlab::ServiceDeskEmail.enabled? && ::Feature.enabled?(:service_desk_custom_address, self, default_enabled: true)
Gitlab::ServiceDeskEmail.address_for_key("#{full_path_slug}-#{key}")
end
def root_namespace

View File

@ -122,6 +122,7 @@ class GroupPolicy < BasePolicy
rule { reporter }.policy do
enable :reporter_access
enable :read_container_image
enable :admin_board
enable :admin_label
enable :admin_list
enable :admin_issue

View File

@ -19,7 +19,7 @@ module ResourceEvents
state: ResourceStateEvent.states[state],
close_after_error_tracking_resolve: close_after_error_tracking_resolve,
close_auto_resolve_prometheus_alert: close_auto_resolve_prometheus_alert,
created_at: Time.zone.now
created_at: resource.system_note_timestamp
)
resource.expire_note_etag_cache

View File

@ -5,10 +5,6 @@ module ServiceDeskSettings
def execute
settings = ServiceDeskSetting.safe_find_or_create_by!(project_id: project.id)
unless ::Feature.enabled?(:service_desk_custom_address, project, default_enabled: true)
params.delete(:project_key)
end
params[:project_key] = nil if params[:project_key].blank?
if settings.update(params)

View File

@ -1,21 +1,23 @@
- link = link_to _("Install GitLab Runner"), 'https://docs.gitlab.com/runner/install/', target: '_blank'
- link = link_to _("Install GitLab Runner and ensure it's running."), 'https://docs.gitlab.com/runner/install/', target: '_blank'
.gl-mb-3
%h4= _("Set up a %{type} Runner manually") % { type: type }
%h5= _("Set up a %{type} runner manually") % { type: type }
%ol
%li
= link.html_safe
%li
= _("Specify the following URL during the Runner setup:")
= _("Register the runner with this URL:")
%br
%code#coordinator_address= root_url(only_path: false)
= clipboard_button(target: '#coordinator_address', title: _("Copy URL"), class: "btn-transparent btn-clipboard")
%li
= _("Use the following registration token during setup:")
%br
%br
= _("And this registration token:")
%br
%code#registration_token= registration_token
= clipboard_button(target: '#registration_token', title: _("Copy token"), class: "btn-transparent btn-clipboard")
.gl-mt-3.gl-mb-3
= button_to _("Reset runners registration token"), reset_token_url,
method: :put, class: 'gl-button btn btn-default',
data: { confirm: _("Are you sure you want to reset registration token?") }
%li
= _("Start the Runner!")
.gl-mt-3.gl-mb-3
= button_to _("Reset registration token"), reset_token_url,
method: :put, class: 'gl-button btn btn-default',
data: { confirm: _("Are you sure you want to reset the registration token?") }

View File

@ -1,22 +1,21 @@
.gl-mb-3
%h4= _('Set up a %{type} Runner automatically') % { type: type }
%h5= _('Set up a %{type} runner automatically') % { type: type }
%p
- link_to_help_page = link_to(_('Learn more about Kubernetes'),
- link_to_help_page = link_to(_('Learn more.'),
help_page_path('user/project/clusters/index'),
target: '_blank',
rel: 'noopener noreferrer')
= _('You can easily install a Runner on a Kubernetes cluster. %{link_to_help_page}').html_safe % { link_to_help_page: link_to_help_page }
= _('Register a runner on a Kubernetes cluster. %{link_to_help_page}').html_safe % { link_to_help_page: link_to_help_page }
%ol
%li
= _('Click the button below to begin the install process by navigating to the Kubernetes page')
= _('Click the button below.')
%li
= _('Select an existing Kubernetes cluster or create a new one')
= _('Select an existing Kubernetes cluster or create a new one.')
%li
= _('From the Kubernetes cluster details view, install Runner from the applications list')
= _('From the Kubernetes cluster details view, applications list, install GitLab Runner.')
= link_to _('Install Runner on Kubernetes'),
= link_to _('Install GitLab Runner on Kubernetes'),
clusters_path,
class: 'gl-button btn btn-info'

View File

@ -1,11 +1,11 @@
- link = link_to _('Runners API'), help_page_path('api/runners.md')
- link = link_to _('Runner API'), help_page_path('api/runners.md')
%h3
= _('Group Runners')
%h4
= _('Group runners')
.bs-callout.bs-callout-warning
= _('GitLab Group Runners can execute code for all the projects in this group.')
= _('They can be managed using the %{link}.').html_safe % { link: link }
%p
= _('These runners are shared across projects in this group.')
= _('Group runners can be managed with the %{link}.').html_safe % { link: link }
-# Proper policies should be implemented per
-# https://gitlab.com/gitlab-org/gitlab-foss/issues/45894
@ -18,3 +18,4 @@
locals: { registration_token: @group.runners_token,
type: 'group',
reset_token_url: reset_registration_token_group_settings_ci_cd_path }
%br

View File

@ -2,8 +2,6 @@
%hr
%p.lead
= _('To start serving your jobs you can add Runners to your group')
.row
.col-sm-6
= render 'groups/runners/group_runners'
@ -11,7 +9,7 @@
= render 'groups/runners/shared_runners'
%h4.underlined-title
= _('Available Runners: %{runners}').html_safe % { runners: limited_counter_with_delimiter(@all_group_runners) }
= _('Available runners: %{runners}').html_safe % { runners: limited_counter_with_delimiter(@all_group_runners) }
-# haml-lint:disable NoPlainNodes
.row

View File

@ -31,8 +31,8 @@
%button.btn.gl-button.btn-default.js-settings-toggle{ type: "button" }
= expanded ? _('Collapse') : _('Expand')
%p
= _("Runners are processes that pick up and execute jobs for GitLab. Here you can register and see your Runners for this project.")
= link_to s_('More information'), help_page_path('ci/runners/README')
= _("Runners are processes that pick up and execute CI/CD jobs for GitLab.")
= link_to s_('How do I configure runners?'), help_page_path('ci/runners/README')
.settings-content
= render 'groups/runners/index'

View File

@ -12,7 +12,7 @@
enabled: "#{@project.service_desk_enabled}",
incoming_email: (@project.service_desk_incoming_address if @project.service_desk_enabled),
custom_email: (@project.service_desk_custom_address if @project.service_desk_enabled),
custom_email_enabled: "#{@project.service_desk_custom_address_enabled?}",
custom_email_enabled: "#{Gitlab::ServiceDeskEmail.enabled?}",
selected_template: "#{@project.service_desk_setting&.issue_template_key}",
outgoing_name: "#{@project.service_desk_setting&.outgoing_name}",
project_key: "#{@project.service_desk_setting&.project_key}",

View File

@ -5,10 +5,10 @@
= s_('GitLabPages|Remove pages')
.errors-holder
.card-body
%p
%p.gl-mb-0
= s_('GitLabPages|Removing pages will prevent them from being exposed to the outside world.')
.form-actions
= link_to s_('GitLabPages|Remove pages'), project_pages_path(@project), data: { confirm: s_('GitLabPages|Are you sure?')}, method: :delete, class: "btn gl-button btn-danger"
.card-footer
= link_to s_('GitLabPages|Remove pages'), project_pages_path(@project), data: { confirm: s_('GitLabPages|Are you sure?')}, method: :delete, class: "btn gl-button btn-danger"
- else
.nothing-here-block
= s_('GitLabPages|Only project maintainers can remove pages')

View File

@ -1,37 +1,40 @@
- link = link_to _('Runners API'), help_page_path('api/runners.md')
- link = link_to _('Runner API'), help_page_path('api/runners.md')
%h3
= _('Group Runners')
%h4
= _('Group runners')
.bs-callout.bs-callout-warning
= _('GitLab Group Runners can execute code for all the projects in this group.')
= _('They can be managed using the %{link}.').html_safe % { link: link }
= _('These runners are shared across projects in this group.')
%br
%br
= _('Group runners can be managed with the %{link}.').html_safe % { link: link }
- if @project.group
%hr
%br
%br
- if @project.group_runners_enabled?
= link_to toggle_group_runners_project_runners_path(@project), class: 'btn btn-close', method: :post do
= _('Disable group Runners')
= _('Disable group runners')
- else
= link_to toggle_group_runners_project_runners_path(@project), class: 'btn btn-success btn-inverted', method: :post do
= _('Enable group Runners')
= _('Enable group runners')
&nbsp;
= _('for this project')
- if !@project.group
= _('This project does not belong to a group and can therefore not make use of group Runners.')
= _('This project does not belong to a group and cannot make use of group runners.')
- elsif @group_runners.empty?
= _('This group does not provide any group Runners yet.')
= _('This group does not have any group runners yet.')
- if can?(current_user, :admin_pipeline, @project.group)
- group_link = link_to _('Group CI/CD settings'), group_settings_ci_cd_path(@project.group)
- group_link = link_to _("group's CI/CD settings."), group_settings_ci_cd_path(@project.group)
= _('Group maintainers can register group runners in the %{link}').html_safe % { link: group_link }
- else
= _('Ask your group maintainer to set up a group Runner.')
= _('Ask your group maintainer to set up a group runner.')
- else
%h4.underlined-title
= _('Available group Runners: %{runners}').html_safe % { runners: @group_runners.count }
= _('Available group runners: %{runners}').html_safe % { runners: @group_runners.count }
%ul.bordered-list
= render partial: 'projects/runners/runner', collection: @group_runners, as: :runner

View File

@ -1,8 +1,5 @@
= render 'shared/runners/runner_description'
%hr
%p.lead= _('To start serving your jobs you can either add specific Runners to your project or use shared Runners')
.row
.col-sm-6
= render 'projects/runners/specific_runners'

View File

@ -23,7 +23,7 @@
- else
= link_to _('Resume'), resume_project_runner_path(@project, runner), method: :post, class: 'btn btn-success btn-sm'
- if runner.belongs_to_one_project?
= link_to _('Remove Runner'), project_runner_path(@project, runner), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn btn-danger btn-sm'
= link_to _('Remove runner'), project_runner_path(@project, runner), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn btn-danger btn-sm'
- else
- runner_project = @project.runner_projects.find_by(runner_id: runner) # rubocop: disable CodeReuse/ActiveRecord
= link_to _('Disable for this project'), project_runner_project_path(@project, runner_project), data: { confirm: _("Are you sure?") }, method: :delete, class: 'btn btn-danger btn-sm'

View File

@ -2,7 +2,8 @@
= render layout: 'shared/runners/shared_runners_description' do
- if !isVueifySharedRunnersToggleEnabled
%hr
%br
%br
- if @project.group&.shared_runners_setting == 'disabled_and_unoverridable'
%h5.gl-text-red-500
= _('Shared runners disabled on group level')
@ -19,8 +20,8 @@
#toggle-shared-runners-form{ data: toggle_shared_runners_settings_data(@project) }
- if @shared_runners_count == 0
= _('This GitLab instance does not provide any shared Runners yet. Instance administrators can register shared Runners in the admin area.')
= _('This GitLab instance does not provide any shared runners yet. Instance administrators can register shared runners in the admin area.')
- else
%h4.underlined-title #{_('Available shared Runners:')} #{@shared_runners_count}
%h4.underlined-title #{_('Available shared runners:')} #{@shared_runners_count}
%ul.bordered-list.available-shared-runners
= render partial: 'projects/runners/runner', collection: @shared_runners, as: :runner

View File

@ -1,7 +1,9 @@
%h3
= _('Specific Runners')
%h4
= _('Specific runners')
.bs-callout.help-callout
= _('These runners are specific to this project.')
%hr
= render partial: 'ci/runner/how_to_setup_runner_automatically',
locals: { type: 'specific',
clusters_path: project_clusters_path(@project) }
@ -11,14 +13,16 @@
type: 'specific',
reset_token_url: reset_registration_token_namespace_project_settings_ci_cd_path }
%hr
- if @project_runners.any?
%h4.underlined-title= _('Runners activated for this project')
%h4.underlined-title= _('Available specific runners')
%ul.bordered-list.activated-specific-runners
= render partial: 'projects/runners/runner', collection: @project_runners, as: :runner
= paginate @project_runners, theme: "gitlab", param_name: "project_page", params: { expand_runners: true, anchor: 'js-runners-settings' }
- if @assignable_runners.any?
%h4.underlined-title= _('Available specific runners')
%h4.underlined-title= _('Other available runners')
%ul.bordered-list.available-specific-runners
= render partial: 'projects/runners/runner', collection: @assignable_runners, as: :runner
= paginate @assignable_runners, theme: "gitlab", param_name: "specific_page", :params => { :anchor => 'js-runners-settings'}

View File

@ -1,4 +1,4 @@
- page_title _('Edit'), "#{@runner.description} ##{@runner.id}", _('Runners')
- page_title _('Edit'), "#{@runner.description} ##{@runner.id}", _('runners')
%h4 Runner ##{@runner.id}

View File

@ -40,8 +40,8 @@
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
= _("Runners are processes that pick up and execute jobs for GitLab. Here you can register and see your Runners for this project.")
= link_to s_('More information'), help_page_path('ci/runners/README')
= _("Runners are processes that pick up and execute CI/CD jobs for GitLab.")
= link_to s_('How do I configure runners?'), help_page_path('ci/runners/README')
.settings-content
= render 'projects/runners/index'

View File

@ -46,7 +46,7 @@
= _('Tags')
.col-sm-10
= f.text_field :tag_list, value: runner.tag_list.sort.join(', '), class: 'form-control'
.form-text.text-muted= _('You can configure jobs to use runners that are assigned specific tags. Separate tags with commas.')
.form-text.text-muted= _('You can set up jobs to only use runners with specific tags. Separate tags with commas.')
- if local_assigns[:in_gitlab_com_admin_context]
.form-group.row
= label_tag :public_projects_minutes_cost_factor, class: 'col-form-label col-sm-2' do

View File

@ -1,16 +1,12 @@
.light.gl-mt-3
%p
= _("You can set up as many Runners as you need to run your jobs.")
%br
= _('Runners can be placed on separate users, servers, and even on your local machine.')
= _("Register as many runners as you want. You can register runners as separate users, on separate servers, and on your local machine. Runners are either:")
%p
= _('Each Runner can be in one of the following states:')
%div
%ul
%li
%span.badge.badge-success active
= _('- Runner is active and can process any new jobs')
= _('- Available to run jobs.')
%li
%span.badge.badge-danger paused
= _('- Runner is paused and will not receive any new jobs')
= _('- Not available to run jobs.')

View File

@ -1,9 +1,11 @@
- link = link_to _('MaxBuilds'), 'https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section', target: '_blank'
%h3
%h4
= _('Shared runners')
.bs-callout.shared-runners-description
= _('These runners are shared across this GitLab instance.')
%p
- if Gitlab::CurrentSettings.shared_runners_text.present?
= markdown_field(Gitlab::CurrentSettings.current_application_settings, :shared_runners_text)
- else

View File

@ -0,0 +1,6 @@
---
title: Fix issue with the `default_merge_refs` feature flag removing version to version
diffs
merge_request: 50671
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Persist updated_at value in state change events
merge_request: 50272
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Updated UI text to match style guidelines
merge_request: 50403
author:
type: other

View File

@ -1,8 +0,0 @@
---
name: service_desk_custom_address
introduced_by_url:
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/284656
milestone:
type: development
group: group::certify
default_enabled: true

View File

@ -132,8 +132,8 @@ general guidelines around how to collect those, due to the individual nature of
There are several types of counters which are all found in `usage_data.rb`:
- **Ordinary Batch Counters:** Simple count of a given ActiveRecord_Relation
- **Distinct Batch Counters:** Distinct count of a given ActiveRecord_Relation on given column
- **Sum Batch Counters:** Sum the values of a given ActiveRecord_Relation on given column
- **Distinct Batch Counters:** Distinct count of a given ActiveRecord_Relation in a given column
- **Sum Batch Counters:** Sum the values of a given ActiveRecord_Relation in a given column
- **Alternative Counters:** Used for settings and configurations
- **Redis Counters:** Used for in-memory counts.
@ -153,7 +153,15 @@ For GitLab.com, there are extremely large tables with 15 second query timeouts,
| `merge_request_diff_files` | 1082 |
| `events` | 514 |
There are two batch counting methods provided, `Ordinary Batch Counters` and `Distinct Batch Counters`. Batch counting requires indexes on columns to calculate max, min, and range queries. In some cases, a specialized index may need to be added on the columns involved in a counter.
We have several batch counting methods available:
- `Ordinary Batch Counters`
- `Distinct Batch Counters`
- `Sum Batch Counters`
- `Estimated Batch Counters`
Batch counting requires indexes on columns to calculate max, min, and range queries. In some cases,
you may need to add a specialized index on the columns involved in a counter.
### Ordinary Batch Counters
@ -248,6 +256,76 @@ sum(Issue.group(:state_id), :weight))
# returns => {1=>3542, 2=>6820}
```
### Estimated Batch Counters
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48233) in GitLab 13.7.
Estimated batch counter functionality handles `ActiveRecord::StatementInvalid` errors
when used through the provided `estimate_batch_distinct_count` method.
Errors return a value of `-1`.
WARNING:
This functionality estimates a distinct count of a specific ActiveRecord_Relation in a given column,
which uses the [HyperLogLog](http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf) algorithm.
As the HyperLogLog algorithm is probabilistic, the **results always includes error**.
The highest encountered error rate is 4.9%.
When correctly used, the `estimate_batch_distinct_count` method enables efficient counting over
columns that contain non-unique values, which can not be assured by other counters.
Method: [`estimate_batch_distinct_count(relation, column = nil, batch_size: nil, start: nil, finish: nil)`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/utils/usage_data.rb#L63)
The method includes the following arguments:
- `relation`: The ActiveRecord_Relation to perform the count.
- `column`: The column to perform the distinct count. The default is the primary key.
- `batch_size`: The default is 10,000, from `Gitlab::Database::PostgresHll::BatchDistinctCounter::DEFAULT_BATCH_SIZE`.
- `start`: The custom start of the batch count, to avoid complex minimum calculations.
- `finish`: The custom end of the batch count in order to avoid complex maximum calculations.
The method includes the following prerequisites:
1. The supplied `relation` must include the primary key defined as the numeric column.
For example: `id bigint NOT NULL`.
1. The `estimate_batch_distinct_count` can handle a joined relation. To utilize its ability to
count non-unique columns, the joined relation **must NOT** have a one-to-many relationship,
such as `has_many :boards`.
1. Both `start` and `finish` arguments should always represent primary key relationship values,
even if the estimated count refers to another column, for example:
```ruby
estimate_batch_distinct_count(::Note, :author_id, start: ::Note.minimum(:id), finish: ::Note.maximum(:id))
```
Examples:
1. Simple execution of estimated batch counter, with only relation provided, returned value will represent estimated
number of unique values in `id` column (which is the primary key) of `Project` relation:
```ruby
estimate_batch_distinct_count(::Project)
```
1. Execution of estimated batch counter, where provided relation has applied additional filter (`.where(time_period)`), number of unique values is going to be estimated in custom column (`:author_id`), and parameters: `start` and `finish` together apply boundaries that defines range of provided relation that is going to be analyzed
```ruby
estimate_batch_distinct_count(::Note.with_suggestions.where(time_period), :author_id, start: ::Note.minimum(:id), finish: ::Note.maximum(:id))
```
1. Execution of estimated batch counter with joined relation (`joins(:cluster)`), for a custom column (`'clusters.user_id'`):
```ruby
estimate_batch_distinct_count(::Clusters::Applications::CertManager.where(time_period).available.joins(:cluster), 'clusters.user_id')
```
When instrumenting metric with usage of estimated batch counter please add `_estimated` suffix to its name, for example:
```ruby
"counts": {
"ci_builds_estimated": estimate_batch_distinct_count(Ci::Build),
...
```
### Redis Counters
Handles `::Redis::CommandError` and `Gitlab::UsageDataCounters::BaseCounter::UnknownEvent`
@ -309,6 +387,10 @@ Examples of implementation:
#### Redis HLL Counters
WARNING:
HyperLogLog (HLL) is a probabilistic algorithm and its **results always includes some small error**. According to [Redis documentation](https://redis.io/commands/pfcount), data from
used HLL implementation is "approximated with a standard error of 0.81%".
With `Gitlab::UsageDataCounters::HLLRedisCounter` we have available data structures used to count unique values.
Implemented using Redis methods [PFADD](https://redis.io/commands/pfadd) and [PFCOUNT](https://redis.io/commands/pfcount).
@ -783,8 +865,6 @@ appear to be associated to any of the services running, since they all appear to
## Aggregated metrics
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45979) in GitLab 13.6.
> - It's [deployed behind a feature flag](../../user/feature_flags.md), disabled by default.
> - It's enabled on GitLab.com.
WARNING:
This feature is intended solely for internal GitLab use.

View File

@ -212,7 +212,7 @@ When a user tries to sign in with Group SSO, GitLab attempts to find or create a
To link SAML to your existing GitLab.com account:
1. Sign in to your GitLab.com account.
1. Locate and visit the **GitLab single sign-on URL** for the group you're signing in to. A group Admin can find this on the group's **Settings > SAML SSO** page. If the sign-in URL is configured, users can connect to the GitLab app from the Identity Provider.
1. Locate and visit the **GitLab single sign-on URL** for the group you're signing in to. A group owner can find this on the group's **Settings > SAML SSO** page. If the sign-in URL is configured, users can connect to the GitLab app from the Identity Provider.
1. Click **Authorize**.
1. Enter your credentials on the Identity Provider if prompted.
1. You are then redirected back to GitLab.com and should now have access to the group. In the future, you can use SAML to sign in to GitLab.com.

View File

@ -146,13 +146,16 @@ Users are notified of the following events:
| New email added | User | Security email, always sent. |
| Email changed | User | Security email, always sent. |
| Password changed | User | Security email, always sent when user changes their own password |
| Password changed by administrator | User | Security email, always sent when an administrator changes the password of another user |
| Password changed by administrator | User | Security email, always sent when an administrator changes the password of another user |
| Two-factor authentication disabled | User | Security email, always sent. |
| New user created | User | Sent on user creation, except for OmniAuth (LDAP)|
| User added to project | User | Sent when user is added to project |
| Project access level changed | User | Sent when user project access level is changed |
| User added to group | User | Sent when user is added to group |
| Group access level changed | User | Sent when user group access level is changed |
| Personal Access Tokens expiring soon | User | Security email, always sent. |
<!-- Do not delete or lint this instance of future tense -->
| Personal Access Tokens have expired | User | Security email, always sent. |
| Project moved | Project members (1) | (1) not disabled |
| New release | Project members | Custom notification |

View File

@ -140,15 +140,12 @@ To edit the custom email display name:
### Using custom email address
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/2201) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.0.
> - It was [deployed behind a feature flag](../feature_flags.md), disabled by default.
> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/284656) on GitLab 13.7.
> - It's enabled on GitLab.com.
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#disable-custom-email-address). **(CORE ONLY)**
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/284656) in GitLab 13.8.
If the `service_desk_email` feature flag is enabled, then you can
create Service Desk issues by sending emails to the Service Desk email address.
The default address has the following format: `project_contact+%{key}@example.com`.
If the `service_desk_email` is configured, then you can create Service Desk
issues by sending emails to the Service Desk email address. The default
address has the following format:
`project_contact+%{key}@example.com`.
The `%{key}` part is used to find the project where the issue should be created. The
`%{key}` part combines the path to the project and configurable project name suffix:
@ -163,7 +160,7 @@ always use separate mailboxes. This is important, because emails picked from
`service_desk_email` mailbox are processed by a different worker and it would
not recognize `incoming_email` emails.
You can add the following snippets to your configuration:
To configure a custom email address for Service Desk, add the following snippets to your configuration file:
- Example for installations from source:
@ -216,23 +213,6 @@ As a result, a new Service Desk issue is created from this email in the `mygroup
The configuration options are the same as for configuring
[incoming email](../../administration/incoming_email.md#set-it-up).
#### Disable custom email address **(CORE ONLY)**
Service Desk custom email is under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
To disable it:
```ruby
Feature.disable(:service_desk_custom_address)
```
To enable it:
```ruby
Feature.enable(:service_desk_custom_address)
```
## Using Service Desk
There are a few ways Service Desk can be used.

View File

@ -68,7 +68,7 @@ module Gitlab
end
def valid_project_key?(project, slug)
project.present? && slug == project.full_path_slug && Feature.enabled?(:service_desk_custom_address, project, default_enabled: true)
project.present? && slug == project.full_path_slug
end
def create_issue!

View File

@ -1033,15 +1033,15 @@ msgstr ""
msgid ", or "
msgstr ""
msgid "- Available to run jobs."
msgstr ""
msgid "- Event"
msgid_plural "- Events"
msgstr[0] ""
msgstr[1] ""
msgid "- Runner is active and can process any new jobs"
msgstr ""
msgid "- Runner is paused and will not receive any new jobs"
msgid "- Not available to run jobs."
msgstr ""
msgid "- User"
@ -3405,6 +3405,9 @@ msgstr ""
msgid "Ancestors"
msgstr ""
msgid "And this registration token:"
msgstr ""
msgid "Anonymous"
msgstr ""
@ -3778,15 +3781,15 @@ msgstr ""
msgid "Are you sure you want to remove this list?"
msgstr ""
msgid "Are you sure you want to reset registration token?"
msgstr ""
msgid "Are you sure you want to reset the SCIM token? SCIM provisioning will stop working until the new token is updated."
msgstr ""
msgid "Are you sure you want to reset the health check token?"
msgstr ""
msgid "Are you sure you want to reset the registration token?"
msgstr ""
msgid "Are you sure you want to revoke this %{type}? This action cannot be undone."
msgstr ""
@ -3856,7 +3859,7 @@ msgstr ""
msgid "Ascending"
msgstr ""
msgid "Ask your group maintainer to set up a group Runner."
msgid "Ask your group maintainer to set up a group runner."
msgstr ""
msgid "Assertion consumer service URL"
@ -4259,16 +4262,16 @@ msgstr ""
msgid "Available ID"
msgstr ""
msgid "Available Runners: %{runners}"
msgstr ""
msgid "Available for dependency and container scanning"
msgstr ""
msgid "Available group Runners: %{runners}"
msgid "Available group runners: %{runners}"
msgstr ""
msgid "Available shared Runners:"
msgid "Available runners: %{runners}"
msgstr ""
msgid "Available shared runners:"
msgstr ""
msgid "Available specific runners"
@ -5806,7 +5809,7 @@ msgstr ""
msgid "Click %{link_to} to view the request."
msgstr ""
msgid "Click the button below to begin the install process by navigating to the Kubernetes page"
msgid "Click the button below."
msgstr ""
msgid "Click to expand it."
@ -10054,7 +10057,7 @@ msgstr ""
msgid "Disable for this project"
msgstr ""
msgid "Disable group Runners"
msgid "Disable group runners"
msgstr ""
msgid "Disable public access to Pages sites"
@ -10347,9 +10350,6 @@ msgstr ""
msgid "Dynamic Application Security Testing (DAST)"
msgstr ""
msgid "Each Runner can be in one of the following states:"
msgstr ""
msgid "Edit"
msgstr ""
@ -10695,7 +10695,7 @@ msgstr ""
msgid "Enable for this project"
msgstr ""
msgid "Enable group Runners"
msgid "Enable group runners"
msgstr ""
msgid "Enable header and footer in emails"
@ -12689,7 +12689,7 @@ msgstr ""
msgid "From merge request merge until deploy to production"
msgstr ""
msgid "From the Kubernetes cluster details view, install Runner from the applications list"
msgid "From the Kubernetes cluster details view, applications list, install GitLab Runner."
msgstr ""
msgid "Full name"
@ -13184,9 +13184,6 @@ msgstr ""
msgid "GitLab Billing Team."
msgstr ""
msgid "GitLab Group Runners can execute code for all the projects in this group."
msgstr ""
msgid "GitLab Import"
msgstr ""
@ -13610,9 +13607,6 @@ msgstr ""
msgid "Group Audit Events"
msgstr ""
msgid "Group CI/CD settings"
msgstr ""
msgid "Group Git LFS status:"
msgstr ""
@ -13628,9 +13622,6 @@ msgstr ""
msgid "Group Owner must have signed in with SAML before enabling Group Managed Accounts"
msgstr ""
msgid "Group Runners"
msgstr ""
msgid "Group SAML must be enabled to test"
msgstr ""
@ -13715,6 +13706,12 @@ msgstr ""
msgid "Group requires separate account"
msgstr ""
msgid "Group runners"
msgstr ""
msgid "Group runners can be managed with the %{link}."
msgstr ""
msgid "Group variables (inherited)"
msgstr ""
@ -14421,6 +14418,9 @@ msgstr ""
msgid "Housekeeping, export, path, transfer, remove, archive."
msgstr ""
msgid "How do I configure runners?"
msgstr ""
msgid "How does cleanup work?"
msgstr ""
@ -15099,10 +15099,10 @@ msgstr ""
msgid "Install"
msgstr ""
msgid "Install GitLab Runner"
msgid "Install GitLab Runner and ensure it's running."
msgstr ""
msgid "Install Runner on Kubernetes"
msgid "Install GitLab Runner on Kubernetes"
msgstr ""
msgid "Install a soft token authenticator like %{free_otp_link} or Google Authenticator from your application repository and use that app to scan this QR code. More information is available in the %{help_link_start}documentation%{help_link_end}."
@ -16489,9 +16489,6 @@ msgstr ""
msgid "Learn more about Auto DevOps"
msgstr ""
msgid "Learn more about Kubernetes"
msgstr ""
msgid "Learn more about License-Check"
msgstr ""
@ -20013,6 +20010,9 @@ msgstr ""
msgid "Other Labels"
msgstr ""
msgid "Other available runners"
msgstr ""
msgid "Other information"
msgstr ""
@ -23315,12 +23315,21 @@ msgstr ""
msgid "Register WebAuthn Device"
msgstr ""
msgid "Register a runner on a Kubernetes cluster. %{link_to_help_page}"
msgstr ""
msgid "Register as many runners as you want. You can register runners as separate users, on separate servers, and on your local machine. Runners are either:"
msgstr ""
msgid "Register device"
msgstr ""
msgid "Register now"
msgstr ""
msgid "Register the runner with this URL:"
msgstr ""
msgid "Register with two-factor app"
msgstr ""
@ -23446,9 +23455,6 @@ msgstr ""
msgid "Remove %{displayReference}"
msgstr ""
msgid "Remove Runner"
msgstr ""
msgid "Remove Zoom meeting"
msgstr ""
@ -23542,6 +23548,9 @@ msgstr ""
msgid "Remove reviewer"
msgstr ""
msgid "Remove runner"
msgstr ""
msgid "Remove secondary node"
msgstr ""
@ -24089,7 +24098,7 @@ msgstr ""
msgid "Reset key"
msgstr ""
msgid "Reset runners registration token"
msgid "Reset registration token"
msgstr ""
msgid "Reset template"
@ -24345,6 +24354,9 @@ msgstr ""
msgid "Run untagged jobs"
msgstr ""
msgid "Runner API"
msgstr ""
msgid "Runner is %{status}, last contact was %{runner_contact} ago"
msgstr ""
@ -24366,21 +24378,9 @@ msgstr ""
msgid "Runners"
msgstr ""
msgid "Runners API"
msgstr ""
msgid "Runners activated for this project"
msgstr ""
msgid "Runners are processes that pick up and execute CI/CD jobs for GitLab."
msgstr ""
msgid "Runners are processes that pick up and execute jobs for GitLab. Here you can register and see your Runners for this project."
msgstr ""
msgid "Runners can be placed on separate users, servers, and even on your local machine."
msgstr ""
msgid "Runners can be:"
msgstr ""
@ -25281,7 +25281,7 @@ msgstr ""
msgid "Select all"
msgstr ""
msgid "Select an existing Kubernetes cluster or create a new one"
msgid "Select an existing Kubernetes cluster or create a new one."
msgstr ""
msgid "Select assignee"
@ -25692,10 +25692,10 @@ msgstr ""
msgid "Set up Jira Integration"
msgstr ""
msgid "Set up a %{type} Runner automatically"
msgid "Set up a %{type} runner automatically"
msgstr ""
msgid "Set up a %{type} Runner manually"
msgid "Set up a %{type} runner manually"
msgstr ""
msgid "Set up a hardware device as a second factor to sign in."
@ -26662,7 +26662,7 @@ msgstr ""
msgid "Spam log successfully submitted as ham."
msgstr ""
msgid "Specific Runners"
msgid "Specific runners"
msgstr ""
msgid "Specified URL cannot be used: \"%{reason}\""
@ -26671,9 +26671,6 @@ msgstr ""
msgid "Specify an e-mail address regex pattern to identify default internal users."
msgstr ""
msgid "Specify the following URL during the Runner setup:"
msgstr ""
msgid "Speed up your pipelines with Needs relationships"
msgstr ""
@ -26782,9 +26779,6 @@ msgstr ""
msgid "Start search"
msgstr ""
msgid "Start the Runner!"
msgstr ""
msgid "Start thread"
msgstr ""
@ -28577,10 +28571,16 @@ msgstr ""
msgid "These paths are protected for POST requests."
msgstr ""
msgid "These variables are configured in the parent group settings, and will be active in the current project in addition to the project variables."
msgid "These runners are shared across projects in this group."
msgstr ""
msgid "They can be managed using the %{link}."
msgid "These runners are shared across this GitLab instance."
msgstr ""
msgid "These runners are specific to this project."
msgstr ""
msgid "These variables are configured in the parent group settings, and will be active in the current project in addition to the project variables."
msgstr ""
msgid "Third Party Advisory Link"
@ -28610,7 +28610,7 @@ msgstr ""
msgid "This Cron pattern is invalid"
msgstr ""
msgid "This GitLab instance does not provide any shared Runners yet. Instance administrators can register shared Runners in the admin area."
msgid "This GitLab instance does not provide any shared runners yet. Instance administrators can register shared runners in the admin area."
msgstr ""
msgid "This GitLab instance is licensed at the %{insufficient_license} tier. Geo is only available for users who have at least a Premium license."
@ -28763,7 +28763,7 @@ msgstr ""
msgid "This group cannot be invited to a project inside a group with enforced SSO"
msgstr ""
msgid "This group does not provide any group Runners yet."
msgid "This group does not have any group runners yet."
msgstr ""
msgid "This group has been scheduled for permanent removal on %{date}"
@ -28964,7 +28964,7 @@ msgstr ""
msgid "This project"
msgstr ""
msgid "This project does not belong to a group and can therefore not make use of group Runners."
msgid "This project does not belong to a group and cannot make use of group runners."
msgstr ""
msgid "This project does not have %{service_desk_link_start}Service Desk%{service_desk_link_end} enabled, so the user who created the issue will no longer receive email notifications about new activity."
@ -29568,12 +29568,6 @@ msgstr ""
msgid "To specify the notification level per project of a group you belong to, you need to visit project page and change notification level there."
msgstr ""
msgid "To start serving your jobs you can add Runners to your group"
msgstr ""
msgid "To start serving your jobs you can either add specific Runners to your project or use shared Runners"
msgstr ""
msgid "To unsubscribe from this issue, please paste the following link into your browser:"
msgstr ""
@ -30629,9 +30623,6 @@ msgstr ""
msgid "Use template"
msgstr ""
msgid "Use the following registration token during setup:"
msgstr ""
msgid "Use your global notification setting"
msgstr ""
@ -32138,9 +32129,6 @@ msgstr ""
msgid "You can always edit this later"
msgstr ""
msgid "You can configure jobs to use runners that are assigned specific tags. Separate tags with commas."
msgstr ""
msgid "You can create a new %{link}."
msgstr ""
@ -32165,9 +32153,6 @@ msgstr ""
msgid "You can easily contribute to them by requesting to join these groups."
msgstr ""
msgid "You can easily install a Runner on a Kubernetes cluster. %{link_to_help_page}"
msgstr ""
msgid "You can filter by 'days to merge' by clicking on the columns in the chart."
msgstr ""
@ -32240,7 +32225,7 @@ msgstr ""
msgid "You can see your chat accounts."
msgstr ""
msgid "You can set up as many Runners as you need to run your jobs."
msgid "You can set up jobs to only use runners with specific tags. Separate tags with commas."
msgstr ""
msgid "You can specify notification level per group or per project."
@ -33392,6 +33377,9 @@ msgstr ""
msgid "group members"
msgstr ""
msgid "group's CI/CD settings."
msgstr ""
msgid "groups"
msgstr ""
@ -34141,6 +34129,9 @@ msgstr ""
msgid "revised"
msgstr ""
msgid "runners"
msgstr ""
msgid "satisfied"
msgstr ""

View File

@ -193,6 +193,29 @@ RSpec.describe Projects::MergeRequests::DiffsController do
end
end
context "with the :default_merge_ref_for_diffs flag on" do
let(:diffable_merge_ref) { true }
subject do
go(diff_head: true,
diff_id: merge_request.merge_request_diff.id,
start_sha: merge_request.merge_request_diff.start_commit_sha)
end
it "correctly generates the right diff between versions" do
MergeRequests::MergeToRefService.new(project, merge_request.author).execute(merge_request)
expect_next_instance_of(CompareService) do |service|
expect(service).to receive(:execute).with(
project,
merge_request.merge_request_diff.head_commit_sha,
straight: true)
end
subject
end
end
context 'with diff_head param passed' do
before do
allow(merge_request).to receive(:diffable_merge_ref?)

View File

@ -23,7 +23,7 @@ RSpec.describe "Admin Runners" do
create(:ci_build, pipeline: pipeline, runner_id: runner.id)
visit admin_runners_path
expect(page).to have_text "Set up a shared Runner manually"
expect(page).to have_text "Set up a shared runner manually"
expect(page).to have_text "Runners currently online: 1"
end
@ -227,7 +227,7 @@ RSpec.describe "Admin Runners" do
end
it 'has all necessary texts including no runner message' do
expect(page).to have_text "Set up a shared Runner manually"
expect(page).to have_text "Set up a shared runner manually"
expect(page).to have_text "Runners currently online: 0"
expect(page).to have_text 'No runners found'
end
@ -389,7 +389,7 @@ RSpec.describe "Admin Runners" do
let(:page_token) { find('#registration_token').text }
before do
click_button 'Reset runners registration token'
click_button 'Reset registration token'
end
it 'changes registration token' do

View File

@ -28,7 +28,7 @@ RSpec.describe 'Group CI/CD settings' do
let(:page_token) { find('#registration_token').text }
before do
click_button 'Reset runners registration token'
click_button 'Reset registration token'
end
it 'changes registration token' do

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe 'Projects > Files > User wants to add a Dockerfile file' do
RSpec.describe 'Projects > Files > User wants to add a Dockerfile file', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/297400' do
before do
project = create(:project, :repository)
sign_in project.owner

View File

@ -183,7 +183,7 @@ RSpec.describe "Projects > Settings > Pipelines settings" do
let(:page_token) { find('#registration_token').text }
before do
click_button 'Reset runners registration token'
click_button 'Reset registration token'
end
it 'changes registration token' do

View File

@ -19,7 +19,7 @@ RSpec.describe 'Runners' do
it 'user can see a button to install runners on kubernetes clusters' do
visit project_runners_path(project)
expect(page).to have_link('Install Runner on Kubernetes', href: project_clusters_path(project))
expect(page).to have_link('Install GitLab Runner on Kubernetes', href: project_clusters_path(project))
end
end
@ -69,7 +69,7 @@ RSpec.describe 'Runners' do
visit project_runners_path(project)
within '.activated-specific-runners' do
click_on 'Remove Runner'
click_on 'Remove runner'
end
expect(page).not_to have_content(specific_runner.display_name)
@ -226,10 +226,10 @@ RSpec.describe 'Runners' do
it 'group runners are not available' do
visit project_runners_path(project)
expect(page).to have_content 'This group does not provide any group Runners yet'
expect(page).to have_content 'This group does not have any group runners yet.'
expect(page).to have_content 'Group maintainers can register group runners in the Group CI/CD settings'
expect(page).not_to have_content 'Ask your group maintainer to set up a group Runner'
expect(page).to have_content 'Group maintainers can register group runners in the group\'s CI/CD settings.'
expect(page).not_to have_content 'Ask your group maintainer to set up a group runner'
end
end
end
@ -241,7 +241,7 @@ RSpec.describe 'Runners' do
it 'group runners are not available' do
visit project_runners_path(project)
expect(page).to have_content 'This project does not belong to a group and can therefore not make use of group Runners.'
expect(page).to have_content 'This project does not belong to a group and cannot make use of group runners.'
end
end
@ -252,10 +252,10 @@ RSpec.describe 'Runners' do
it 'group runners are not available' do
visit project_runners_path(project)
expect(page).to have_content 'This group does not provide any group Runners yet.'
expect(page).to have_content 'This group does not have any group runners yet.'
expect(page).not_to have_content 'Group maintainers can register group runners in the Group CI/CD settings'
expect(page).to have_content 'Ask your group maintainer to set up a group Runner.'
expect(page).not_to have_content 'Group maintainers can register group runners in the group\'s CI/CD settings.'
expect(page).to have_content 'Ask your group maintainer to set up a group runner.'
end
end
@ -267,21 +267,21 @@ RSpec.describe 'Runners' do
it 'group runners are available' do
visit project_runners_path(project)
expect(page).to have_content 'Available group Runners: 1'
expect(page).to have_content 'Available group runners: 1'
expect(page).to have_content 'group-runner'
end
it 'group runners may be disabled for a project' do
visit project_runners_path(project)
click_on 'Disable group Runners'
click_on 'Disable group runners'
expect(page).to have_content 'Enable group Runners'
expect(page).to have_content 'Enable group runners'
expect(project.reload.group_runners_enabled).to be false
click_on 'Enable group Runners'
click_on 'Enable group runners'
expect(page).to have_content 'Disable group Runners'
expect(page).to have_content 'Disable group runners'
expect(project.reload.group_runners_enabled).to be true
end
end
@ -305,7 +305,7 @@ RSpec.describe 'Runners' do
it 'user can see a link to install runners on kubernetes clusters' do
visit group_settings_ci_cd_path(group)
expect(page).to have_link('Install Runner on Kubernetes', href: group_clusters_path(group))
expect(page).to have_link('Install GitLab Runner on Kubernetes', href: group_clusters_path(group))
end
end
@ -316,7 +316,7 @@ RSpec.describe 'Runners' do
visit group_settings_ci_cd_path(group)
expect(page).not_to have_content 'No runners found'
expect(page).to have_content 'Available Runners: 1'
expect(page).to have_content 'Available runners: 1'
expect(page).to have_content 'group-runner'
end
@ -396,7 +396,7 @@ RSpec.describe 'Runners' do
visit group_settings_ci_cd_path(group)
expect(page).not_to have_content 'No runners found'
expect(page).to have_content 'Available Runners: 1'
expect(page).to have_content 'Available runners: 1'
expect(page).to have_content 'project-runner'
end

View File

@ -49,6 +49,7 @@ export const mockCiConfigQueryResponse = {
nodes: [
{
name: 'job_test_1',
size: 1,
jobs: {
nodes: [
{
@ -63,10 +64,12 @@ export const mockCiConfigQueryResponse = {
},
{
name: 'job_test_2',
size: 1,
jobs: {
nodes: [
{
name: 'job_test_2',
needs: { nodes: [], __typename: 'CiConfigNeedConnection' },
__typename: 'CiConfigJob',
},
@ -86,6 +89,7 @@ export const mockCiConfigQueryResponse = {
nodes: [
{
name: 'job_build',
size: 1,
jobs: {
nodes: [
{

View File

@ -68,10 +68,10 @@ describe('utils functions', () => {
it('returns a hash with the jobname as key and all its data as value', () => {
const jobs = {
[jobName1]: job1,
[jobName2]: job2,
[jobName3]: job3,
[jobName4]: job4,
[jobName1]: { jobs: [job1], name: jobName1, needs: [] },
[jobName2]: { jobs: [job2], name: jobName2, needs: [] },
[jobName3]: { jobs: [job3], name: jobName3, needs: job3.needs },
[jobName4]: { jobs: [job4], name: jobName4, needs: job4.needs },
};
expect(createJobsHash(pipelineGraphData.stages)).toEqual(jobs);
@ -110,5 +110,41 @@ describe('utils functions', () => {
[jobName4]: [jobName3, jobName1, jobName2],
});
});
it('handles parallel jobs by adding the group name as a need', () => {
const size = 3;
const jobOptimize1 = 'optimize_1';
const jobPrepareA = 'prepare_a';
const jobPrepareA1 = `${jobPrepareA} 1/${size}`;
const jobPrepareA2 = `${jobPrepareA} 2/${size}`;
const jobPrepareA3 = `${jobPrepareA} 3/${size}`;
const jobsParallel = {
[jobOptimize1]: {
jobs: [job1],
name: [jobOptimize1],
needs: [jobPrepareA1, jobPrepareA2, jobPrepareA3],
},
[jobPrepareA]: { jobs: [], name: jobPrepareA, needs: [], size },
[jobPrepareA1]: { jobs: [], name: jobPrepareA, needs: [], size },
[jobPrepareA2]: { jobs: [], name: jobPrepareA, needs: [], size },
[jobPrepareA3]: { jobs: [], name: jobPrepareA, needs: [], size },
};
expect(generateJobNeedsDict(jobsParallel)).toEqual({
[jobOptimize1]: [
jobPrepareA1,
// This is the important part, the `jobPrepareA` group name has been
// added to our list of needs.
jobPrepareA,
jobPrepareA2,
jobPrepareA3,
],
[jobPrepareA]: [],
[jobPrepareA1]: [],
[jobPrepareA2]: [],
[jobPrepareA3]: [],
});
});
});
});

View File

@ -191,16 +191,6 @@ RSpec.describe Gitlab::Email::Handler::ServiceDeskHandler do
expect { receiver.execute }.to raise_error(Gitlab::Email::ProjectNotFound)
end
end
context 'when service_desk_custom_address feature is disabled' do
before do
stub_feature_flags(service_desk_custom_address: false)
end
it 'bounces the email' do
expect { receiver.execute }.to raise_error(Gitlab::Email::ProjectNotFound)
end
end
end
end

View File

@ -1499,63 +1499,13 @@ RSpec.describe Project, factory_default: :keep do
allow(::Gitlab::ServiceDeskEmail).to receive(:config).and_return(config)
end
context 'when service_desk_custom_address flag is enabled' do
before do
stub_feature_flags(service_desk_custom_address: true)
end
it 'returns custom address when project_key is set' do
create(:service_desk_setting, project: project, project_key: 'key1')
it 'returns custom address when project_key is set' do
create(:service_desk_setting, project: project, project_key: 'key1')
expect(subject).to eq("foo+#{project.full_path_slug}-key1@bar.com")
end
it_behaves_like 'with incoming email address'
expect(subject).to eq("foo+#{project.full_path_slug}-key1@bar.com")
end
context 'when service_desk_custom_address flag is disabled' do
before do
stub_feature_flags(service_desk_custom_address: false)
end
it_behaves_like 'with incoming email address'
end
end
end
describe '.service_desk_custom_address_enabled?' do
let_it_be(:project) { create(:project, service_desk_enabled: true) }
subject(:address_enabled) { project.service_desk_custom_address_enabled? }
context 'when service_desk_email is enabled' do
before do
allow(::Gitlab::ServiceDeskEmail).to receive(:enabled?).and_return(true)
end
it 'returns true' do
expect(address_enabled).to be_truthy
end
context 'when service_desk_custom_address flag is disabled' do
before do
stub_feature_flags(service_desk_custom_address: false)
end
it 'returns false' do
expect(address_enabled).to be_falsey
end
end
end
context 'when service_desk_email is disabled' do
before do
allow(::Gitlab::ServiceDeskEmail).to receive(:enabled?).and_return(false)
end
it 'returns false when service_desk_email is disabled' do
expect(address_enabled).to be_falsey
end
it_behaves_like 'with incoming email address'
end
end

View File

@ -30,6 +30,15 @@ RSpec.describe ResourceEvents::ChangeStateService do
expect_event_source(event, source)
end
it "sets the created_at timestamp from the system_note_timestamp" do
resource.system_note_timestamp = Time.at(43).utc
described_class.new(user: user, resource: resource).execute(status: state, mentionable_source: source)
event = resource.resource_state_events.last
expect(event.created_at).to eq(Time.at(43).utc)
end
end
end

View File

@ -16,19 +16,6 @@ RSpec.describe ServiceDeskSettings::UpdateService do
expect(settings.reload.outgoing_name).to eq 'some name'
expect(settings.reload.project_key).to eq 'foo'
end
context 'when service_desk_custom_address is disabled' do
before do
stub_feature_flags(service_desk_custom_address: false)
end
it 'ignores project_key parameter' do
result = described_class.new(settings.project, user, params).execute
expect(result[:status]).to eq :success
expect(settings.reload.project_key).to be_nil
end
end
end
context 'when project_key is an empty string' do

View File

@ -23,6 +23,7 @@ RSpec.shared_context 'GroupPolicy context' do
let(:reporter_permissions) do
%i[
admin_label
admin_board
read_container_image
read_metrics_dashboard_annotation
read_prometheus