Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-09-16 06:09:24 +00:00
parent 0e9798aaa3
commit 6b9b8a52ba
40 changed files with 394 additions and 375 deletions

View File

@ -507,7 +507,7 @@ rspec-ee system pg12 geo:
# EE: Canonical MR pipelines
rspec fail-fast:
extends:
- .rspec-base-pg11
- .rspec-ee-base-pg11 # This job also runs EE spec which needs elasticsearch
- .rails:rules:rspec fail-fast
stage: test
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"]

View File

@ -11,17 +11,26 @@ export const diffCompareDropdownTargetVersions = (state, getters) => {
// startVersion only exists if the user has selected a version other
// than "base" so if startVersion is null then base must be selected
const diffHead = parseBoolean(getParameterByName('diff_head'));
const defaultMergeRefForDiffs = window.gon?.features?.defaultMergeRefForDiffs || false;
const diffHeadParam = getParameterByName('diff_head');
const diffHead = parseBoolean(diffHeadParam) || (!diffHeadParam && defaultMergeRefForDiffs);
const isBaseSelected = !state.startVersion && !diffHead;
const isHeadSelected = !state.startVersion && diffHead;
let baseVersion = null;
const baseVersion = {
versionName: state.targetBranchName,
version_index: DIFF_COMPARE_BASE_VERSION_INDEX,
href: state.mergeRequestDiff.base_version_path,
isBase: true,
selected: isBaseSelected,
};
if (
!defaultMergeRefForDiffs ||
(defaultMergeRefForDiffs && !state.mergeRequestDiff.head_version_path)
) {
baseVersion = {
versionName: state.targetBranchName,
version_index: DIFF_COMPARE_BASE_VERSION_INDEX,
href: state.mergeRequestDiff.base_version_path,
isBase: true,
selected:
isBaseSelected || (defaultMergeRefForDiffs && !state.mergeRequestDiff.head_version_path),
};
}
const headVersion = {
versionName: state.targetBranchName,
@ -40,7 +49,11 @@ export const diffCompareDropdownTargetVersions = (state, getters) => {
};
};
return [...state.mergeRequestDiffs.slice(1).map(formatVersion), baseVersion, headVersion];
return [
...state.mergeRequestDiffs.slice(1).map(formatVersion),
baseVersion,
state.mergeRequestDiff.head_version_path && headVersion,
].filter(a => a);
};
export const diffCompareDropdownSourceVersions = (state, getters) => {

View File

@ -55,13 +55,14 @@ export default {
<template>
<div v-if="isLoading">
<gl-loading-icon size="lg" class="gl-mt-3 js-loading-spinner" />
<gl-loading-icon size="lg" class="gl-mt-3" />
</div>
<div
v-else-if="!isLoading && showTests"
ref="container"
class="tests-detail position-relative js-tests-detail"
class="tests-detail position-relative"
data-testid="tests-detail"
>
<transition
name="slide"
@ -85,7 +86,7 @@ export default {
<div v-else>
<div class="row gl-mt-3">
<div class="col-12">
<p class="js-no-tests-to-show">{{ s__('TestReports|There are no tests to show.') }}</p>
<p data-testid="no-tests-to-show">{{ s__('TestReports|There are no tests to show.') }}</p>
</div>
</div>
</div>

View File

@ -1,8 +1,7 @@
<script>
import { mapState } from 'vuex';
import { GlIcon } from '@gitlab/ui';
import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { __, sprintf } from '~/locale';
import tooltip from '~/vue_shared/directives/tooltip';
import eventHub from '~/sidebar/event_hub';
import EditForm from './edit_form.vue';
@ -12,7 +11,7 @@ export default {
GlIcon,
},
directives: {
tooltip,
GlTooltip: GlTooltipDirective,
},
props: {
fullPath: {
@ -73,12 +72,9 @@ export default {
<div class="block issuable-sidebar-item confidentiality">
<div
ref="collapseIcon"
v-tooltip
v-gl-tooltip.viewport.left
:title="tooltipLabel"
class="sidebar-collapsed-icon"
data-container="body"
data-placement="left"
data-boundary="viewport"
@click="toggleForm"
>
<gl-icon :name="confidentialityIcon" aria-hidden="true" />

View File

@ -41,6 +41,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag(:merge_request_widget_graphql, @project)
push_frontend_feature_flag(:unified_diff_lines, @project)
push_frontend_feature_flag(:highlight_current_diff_row, @project)
push_frontend_feature_flag(:default_merge_ref_for_diffs, @project)
end
before_action do
@ -457,6 +458,10 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
params = request.query_parameters
params[:view] = cookies[:diff_view] if params[:view].blank? && cookies[:diff_view].present?
if Feature.enabled?(:default_merge_ref_for_diffs, project)
params = params.merge(diff_head: true)
end
diffs_metadata_project_json_merge_request_path(project, merge_request, 'json', params)
end
end

View File

@ -7,7 +7,7 @@ module Types
# a plain hash.
class DeleteJobsResponseType < BaseObject # rubocop:disable Graphql/AuthorizeTypes
graphql_name 'DeleteJobsResponse'
description 'The response from the AdminSidekiqQueuesDeleteJobs mutation.'
description 'The response from the AdminSidekiqQueuesDeleteJobs mutation'
field :completed,
GraphQL::BOOLEAN_TYPE,

View File

@ -4,7 +4,7 @@ module Types
module AwardEmojis
class AwardEmojiType < BaseObject
graphql_name 'AwardEmoji'
description 'An emoji awarded by a user.'
description 'An emoji awarded by a user'
authorize :read_emoji

View File

@ -6,7 +6,7 @@ module Types
graphql_name 'DesignAtVersion'
description 'A design pinned to a specific version. ' \
'The image field reflects the design as of the associated version.'
'The image field reflects the design as of the associated version'
authorize :read_design
@ -23,7 +23,7 @@ module Types
field :design,
Types::DesignManagement::DesignType,
null: false,
description: 'The underlying design.'
description: 'The underlying design'
def cached_stateful_version(_parent)
version

View File

@ -4,7 +4,7 @@ module Types
module DesignManagement
class DesignCollectionType < BaseObject
graphql_name 'DesignCollection'
description 'A collection of designs.'
description 'A collection of designs'
authorize :read_design

View File

@ -4,7 +4,7 @@ module Types
module ErrorTracking
class SentryDetailedErrorType < ::Types::BaseObject
graphql_name 'SentryDetailedError'
description 'A Sentry error.'
description 'A Sentry error'
present_using SentryErrorPresenter

View File

@ -4,7 +4,7 @@ module Types
module ErrorTracking
class SentryErrorCollectionType < ::Types::BaseObject
graphql_name 'SentryErrorCollection'
description 'An object containing a collection of Sentry errors, and a detailed error.'
description 'An object containing a collection of Sentry errors, and a detailed error'
authorize :read_sentry_issue
@ -21,7 +21,7 @@ module Types
required: false
argument :sort,
String,
description: 'Attribute to sort on. Options are frequency, first_seen, last_seen. last_seen is default.',
description: 'Attribute to sort on. Options are frequency, first_seen, last_seen. last_seen is default',
required: false
end
field :detailed_error, Types::ErrorTracking::SentryDetailedErrorType,

View File

@ -5,7 +5,7 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes
class SentryErrorStackTraceEntryType < ::Types::BaseObject
graphql_name 'SentryErrorStackTraceEntry'
description 'An object containing a stack trace entry for a Sentry error.'
description 'An object containing a stack trace entry for a Sentry error'
field :function, GraphQL::STRING_TYPE,
null: true,

View File

@ -4,7 +4,7 @@ module Types
module ErrorTracking
class SentryErrorStackTraceType < ::Types::BaseObject
graphql_name 'SentryErrorStackTrace'
description 'An object containing a stack trace entry for a Sentry error.'
description 'An object containing a stack trace entry for a Sentry error'
authorize :read_sentry_issue

View File

@ -5,7 +5,7 @@ module Types
# rubocop: disable Graphql/AuthorizeTypes
class SentryErrorType < ::Types::BaseObject
graphql_name 'SentryError'
description 'A Sentry error. A simplified version of SentryDetailedError.'
description 'A Sentry error. A simplified version of SentryDetailedError'
present_using SentryErrorPresenter

View File

@ -3,7 +3,7 @@
module Types
class IssueStatusCountsType < BaseObject
graphql_name 'IssueStatusCountsType'
description "Represents total number of issues for the represented statuses."
description 'Represents total number of issues for the represented statuses'
authorize :read_issue

View File

@ -3,7 +3,7 @@
module Types
class MilestoneType < BaseObject
graphql_name 'Milestone'
description 'Represents a milestone.'
description 'Represents a milestone'
present_using MilestonePresenter

View File

@ -3,7 +3,7 @@
module Types
class MutationOperationModeEnum < BaseEnum
graphql_name 'MutationOperationMode'
description 'Different toggles for changing mutator behavior.'
description 'Different toggles for changing mutator behavior'
# Suggested param name for the enum: `operation_mode`

View File

@ -110,10 +110,6 @@ class JiraImportState < ApplicationRecord
)
end
def self.finished_imports_count
finished.sum(:imported_issues_count)
end
def mark_as_failed(error_message)
sanitized_message = Gitlab::UrlSanitizer.sanitize(error_message)

View File

@ -70,10 +70,13 @@
= render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request)
- if mr_action === "diffs"
- add_page_startup_api_call @endpoint_metadata_url
- params = request.query_parameters
- if Feature.enabled?(:default_merge_ref_for_diffs, @project)
- params = params.merge(diff_head: true)
= render "projects/merge_requests/tabs/pane", name: "diffs", id: "js-diffs-app", class: "diffs", data: { "is-locked": @merge_request.discussion_locked?,
endpoint: diffs_project_merge_request_path(@project, @merge_request, 'json', request.query_parameters),
endpoint: diffs_project_merge_request_path(@project, @merge_request, 'json', params),
endpoint_metadata: @endpoint_metadata_url,
endpoint_batch: diffs_batch_project_json_merge_request_path(@project, @merge_request, 'json', request.query_parameters),
endpoint_batch: diffs_batch_project_json_merge_request_path(@project, @merge_request, 'json', params),
endpoint_coverage: @coverage_path,
help_page_path: suggest_changes_help_path,
current_user_data: @current_user_data,

View File

@ -1,4 +1,4 @@
.form-group.row.js-template-warning.mb-0.hidden.js-issuable-template-warning
.form-group.row.js-template-warning.mb-0.hidden.js-issuable-template-warning{ :class => ("gl-mb-5!" if issuable.supports_issue_type? && can?(current_user, :admin_issue, @project)) }
.offset-sm-2.col-sm-10
.warning_message.mb-0{ role: 'alert' }

View File

@ -20,7 +20,7 @@
= render 'shared/issuable/form/title', issuable: issuable, form: form, has_wip_commits: commits && commits.detect(&:work_in_progress?)
#js-suggestions{ data: { project_path: @project.full_path } }
= render 'shared/form_elements/apply_template_warning'
= render 'shared/form_elements/apply_template_warning', issuable: issuable
= render 'shared/issuable/form/type_selector', issuable: issuable, form: form

View File

@ -0,0 +1,5 @@
---
title: Autocomplete recently viewed issues in the global search bar
merge_request: 42302
author:
type: added

View File

@ -0,0 +1,5 @@
---
title: Update template warning padding on New Issue form
merge_request: 42154
author:
type: changed

View File

@ -1,7 +0,0 @@
---
name: recent_items_search
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40669
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/244277
group: group::global search
type: development
default_enabled: false

View File

@ -731,7 +731,7 @@ type AlertTodoCreatePayload {
}
"""
An emoji awarded by a user.
An emoji awarded by a user
"""
type AwardEmoji {
"""
@ -1448,7 +1448,7 @@ type Branch {
}
"""
Represents the total number of issues and their weights for a particular day.
Represents the total number of issues and their weights for a particular day
"""
type BurnupChartDailyTotals {
"""
@ -3139,7 +3139,7 @@ enum DastScanTypeEnum {
}
"""
Represents a DAST scanner profile.
Represents a DAST scanner profile
"""
type DastScannerProfile {
"""
@ -3359,7 +3359,7 @@ type DastScannerProfileUpdatePayload {
}
"""
Represents a DAST Site Profile.
Represents a DAST Site Profile
"""
type DastSiteProfile {
"""
@ -3626,7 +3626,7 @@ type DeleteAnnotationPayload {
}
"""
The response from the AdminSidekiqQueuesDeleteJobs mutation.
The response from the AdminSidekiqQueuesDeleteJobs mutation
"""
type DeleteJobsResponse {
"""
@ -3816,11 +3816,11 @@ type Design implements CurrentUserTodos & DesignFields & Noteable {
}
"""
A design pinned to a specific version. The image field reflects the design as of the associated version.
A design pinned to a specific version. The image field reflects the design as of the associated version
"""
type DesignAtVersion implements DesignFields {
"""
The underlying design.
The underlying design
"""
design: Design!
@ -3916,7 +3916,7 @@ type DesignAtVersionEdge {
}
"""
A collection of designs.
A collection of designs
"""
type DesignCollection {
"""
@ -5106,7 +5106,7 @@ type EnvironmentEdge {
}
"""
Represents an epic.
Represents an epic
"""
type Epic implements CurrentUserTodos & Noteable {
"""
@ -5603,7 +5603,7 @@ type EpicConnection {
}
"""
Counts of descendent epics.
Counts of descendent epics
"""
type EpicDescendantCount {
"""
@ -6203,7 +6203,7 @@ enum EpicSort {
}
"""
State of an epic.
State of an epic
"""
enum EpicState {
all
@ -8703,7 +8703,7 @@ enum IssueState {
}
"""
Represents total number of issues for the represented statuses.
Represents total number of issues for the represented statuses
"""
type IssueStatusCountsType {
"""
@ -8743,7 +8743,7 @@ enum IssueType {
}
"""
Represents an iteration object.
Represents an iteration object
"""
type Iteration implements TimeboxBurnupTimeSeriesInterface {
"""
@ -10606,7 +10606,7 @@ type MetricsDashboardAnnotationEdge {
}
"""
Represents a milestone.
Represents a milestone
"""
type Milestone implements TimeboxBurnupTimeSeriesInterface {
"""
@ -10868,7 +10868,7 @@ type Mutation {
}
"""
Different toggles for changing mutator behavior.
Different toggles for changing mutator behavior
"""
enum MutationOperationMode {
"""
@ -14236,7 +14236,7 @@ type Query {
}
"""
State of a Geo registry.
State of a Geo registry
"""
enum RegistryState {
"""
@ -14968,7 +14968,7 @@ enum RequirementState {
}
"""
Counts of requirements by their state.
Counts of requirements by their state
"""
type RequirementStatesCount {
"""
@ -15556,7 +15556,7 @@ type SecurityReportSummarySection {
}
"""
The type of the security scanner.
The type of the security scanner
"""
enum SecurityScannerType {
CONTAINER_SCANNING
@ -15588,7 +15588,7 @@ type SecurityScanners {
}
"""
A Sentry error.
A Sentry error
"""
type SentryDetailedError {
"""
@ -15733,7 +15733,7 @@ type SentryDetailedError {
}
"""
A Sentry error. A simplified version of SentryDetailedError.
A Sentry error. A simplified version of SentryDetailedError
"""
type SentryError {
"""
@ -15823,7 +15823,7 @@ type SentryError {
}
"""
An object containing a collection of Sentry errors, and a detailed error.
An object containing a collection of Sentry errors, and a detailed error
"""
type SentryErrorCollection {
"""
@ -15876,7 +15876,7 @@ type SentryErrorCollection {
searchTerm: String
"""
Attribute to sort on. Options are frequency, first_seen, last_seen. last_seen is default.
Attribute to sort on. Options are frequency, first_seen, last_seen. last_seen is default
"""
sort: String
): SentryErrorConnection
@ -15935,7 +15935,7 @@ type SentryErrorFrequency {
}
"""
An object containing a stack trace entry for a Sentry error.
An object containing a stack trace entry for a Sentry error
"""
type SentryErrorStackTrace {
"""
@ -15970,7 +15970,7 @@ type SentryErrorStackTraceContext {
}
"""
An object containing a stack trace entry for a Sentry error.
An object containing a stack trace entry for a Sentry error
"""
type SentryErrorStackTraceEntry {
"""
@ -16670,7 +16670,7 @@ type TerraformStateRegistryEdge {
}
"""
Represents a requirement test report.
Represents a requirement test report
"""
type TestReport {
"""
@ -18623,7 +18623,7 @@ type VulnerabilitiesCountByDayEdge {
}
"""
Represents a vulnerability.
Represents a vulnerability
"""
type Vulnerability {
"""
@ -18786,7 +18786,7 @@ enum VulnerabilityGrade {
}
"""
Represents a vulnerability identifier.
Represents a vulnerability identifier
"""
type VulnerabilityIdentifier {
"""
@ -18811,7 +18811,7 @@ type VulnerabilityIdentifier {
}
"""
Represents an issue link of a vulnerability.
Represents an issue link of a vulnerability
"""
type VulnerabilityIssueLink {
"""
@ -18866,7 +18866,7 @@ type VulnerabilityIssueLinkEdge {
}
"""
The type of the issue link related to a vulnerability.
The type of the issue link related to a vulnerability
"""
enum VulnerabilityIssueLinkType {
CREATED
@ -19074,7 +19074,7 @@ type VulnerabilityPermissions {
}
"""
The type of the security scan that found the vulnerability.
The type of the security scan that found the vulnerability
"""
enum VulnerabilityReportType {
CONTAINER_SCANNING
@ -19086,7 +19086,7 @@ enum VulnerabilityReportType {
}
"""
Represents a vulnerability scanner.
Represents a vulnerability scanner
"""
type VulnerabilityScanner {
"""
@ -19181,7 +19181,7 @@ type VulnerabilitySeveritiesCount {
}
"""
The severity of the vulnerability.
The severity of the vulnerability
"""
enum VulnerabilitySeverity {
CRITICAL
@ -19208,7 +19208,7 @@ enum VulnerabilitySort {
}
"""
The state of the vulnerability.
The state of the vulnerability
"""
enum VulnerabilityState {
CONFIRMED

View File

@ -1837,7 +1837,7 @@
{
"kind": "OBJECT",
"name": "AwardEmoji",
"description": "An emoji awarded by a user.",
"description": "An emoji awarded by a user",
"fields": [
{
"name": "description",
@ -3894,7 +3894,7 @@
{
"kind": "OBJECT",
"name": "BurnupChartDailyTotals",
"description": "Represents the total number of issues and their weights for a particular day.",
"description": "Represents the total number of issues and their weights for a particular day",
"fields": [
{
"name": "completedCount",
@ -8544,7 +8544,7 @@
{
"kind": "OBJECT",
"name": "DastScannerProfile",
"description": "Represents a DAST scanner profile.",
"description": "Represents a DAST scanner profile",
"fields": [
{
"name": "editPath",
@ -9181,7 +9181,7 @@
{
"kind": "OBJECT",
"name": "DastSiteProfile",
"description": "Represents a DAST Site Profile.",
"description": "Represents a DAST Site Profile",
"fields": [
{
"name": "editPath",
@ -9930,7 +9930,7 @@
{
"kind": "OBJECT",
"name": "DeleteJobsResponse",
"description": "The response from the AdminSidekiqQueuesDeleteJobs mutation.",
"description": "The response from the AdminSidekiqQueuesDeleteJobs mutation",
"fields": [
{
"name": "completed",
@ -10446,11 +10446,11 @@
{
"kind": "OBJECT",
"name": "DesignAtVersion",
"description": "A design pinned to a specific version. The image field reflects the design as of the associated version.",
"description": "A design pinned to a specific version. The image field reflects the design as of the associated version",
"fields": [
{
"name": "design",
"description": "The underlying design.",
"description": "The underlying design",
"args": [
],
@ -10787,7 +10787,7 @@
{
"kind": "OBJECT",
"name": "DesignCollection",
"description": "A collection of designs.",
"description": "A collection of designs",
"fields": [
{
"name": "design",
@ -14358,7 +14358,7 @@
{
"kind": "OBJECT",
"name": "Epic",
"description": "Represents an epic.",
"description": "Represents an epic",
"fields": [
{
"name": "author",
@ -15683,7 +15683,7 @@
{
"kind": "OBJECT",
"name": "EpicDescendantCount",
"description": "Counts of descendent epics.",
"description": "Counts of descendent epics",
"fields": [
{
"name": "closedEpics",
@ -17370,7 +17370,7 @@
{
"kind": "ENUM",
"name": "EpicState",
"description": "State of an epic.",
"description": "State of an epic",
"fields": null,
"inputFields": null,
"interfaces": null,
@ -23989,7 +23989,7 @@
{
"kind": "OBJECT",
"name": "IssueStatusCountsType",
"description": "Represents total number of issues for the represented statuses.",
"description": "Represents total number of issues for the represented statuses",
"fields": [
{
"name": "all",
@ -24073,7 +24073,7 @@
{
"kind": "OBJECT",
"name": "Iteration",
"description": "Represents an iteration object.",
"description": "Represents an iteration object",
"fields": [
{
"name": "burnupTimeSeries",
@ -29481,7 +29481,7 @@
{
"kind": "OBJECT",
"name": "Milestone",
"description": "Represents a milestone.",
"description": "Represents a milestone",
"fields": [
{
"name": "burnupTimeSeries",
@ -32390,7 +32390,7 @@
{
"kind": "ENUM",
"name": "MutationOperationMode",
"description": "Different toggles for changing mutator behavior.",
"description": "Different toggles for changing mutator behavior",
"fields": null,
"inputFields": null,
"interfaces": null,
@ -41556,7 +41556,7 @@
{
"kind": "ENUM",
"name": "RegistryState",
"description": "State of a Geo registry.",
"description": "State of a Geo registry",
"fields": null,
"inputFields": null,
"interfaces": null,
@ -43592,7 +43592,7 @@
{
"kind": "OBJECT",
"name": "RequirementStatesCount",
"description": "Counts of requirements by their state.",
"description": "Counts of requirements by their state",
"fields": [
{
"name": "archived",
@ -45271,7 +45271,7 @@
{
"kind": "ENUM",
"name": "SecurityScannerType",
"description": "The type of the security scanner.",
"description": "The type of the security scanner",
"fields": null,
"inputFields": null,
"interfaces": null,
@ -45397,7 +45397,7 @@
{
"kind": "OBJECT",
"name": "SentryDetailedError",
"description": "A Sentry error.",
"description": "A Sentry error",
"fields": [
{
"name": "count",
@ -45882,7 +45882,7 @@
{
"kind": "OBJECT",
"name": "SentryError",
"description": "A Sentry error. A simplified version of SentryDetailedError.",
"description": "A Sentry error. A simplified version of SentryDetailedError",
"fields": [
{
"name": "count",
@ -46205,7 +46205,7 @@
{
"kind": "OBJECT",
"name": "SentryErrorCollection",
"description": "An object containing a collection of Sentry errors, and a detailed error.",
"description": "An object containing a collection of Sentry errors, and a detailed error",
"fields": [
{
"name": "detailedError",
@ -46317,7 +46317,7 @@
},
{
"name": "sort",
"description": "Attribute to sort on. Options are frequency, first_seen, last_seen. last_seen is default.",
"description": "Attribute to sort on. Options are frequency, first_seen, last_seen. last_seen is default",
"type": {
"kind": "SCALAR",
"name": "String",
@ -46520,7 +46520,7 @@
{
"kind": "OBJECT",
"name": "SentryErrorStackTrace",
"description": "An object containing a stack trace entry for a Sentry error.",
"description": "An object containing a stack trace entry for a Sentry error",
"fields": [
{
"name": "dateReceived",
@ -46644,7 +46644,7 @@
{
"kind": "OBJECT",
"name": "SentryErrorStackTraceEntry",
"description": "An object containing a stack trace entry for a Sentry error.",
"description": "An object containing a stack trace entry for a Sentry error",
"fields": [
{
"name": "col",
@ -48884,7 +48884,7 @@
{
"kind": "OBJECT",
"name": "TestReport",
"description": "Represents a requirement test report.",
"description": "Represents a requirement test report",
"fields": [
{
"name": "author",
@ -54445,7 +54445,7 @@
{
"kind": "OBJECT",
"name": "Vulnerability",
"description": "Represents a vulnerability.",
"description": "Represents a vulnerability",
"fields": [
{
"name": "description",
@ -54934,7 +54934,7 @@
{
"kind": "OBJECT",
"name": "VulnerabilityIdentifier",
"description": "Represents a vulnerability identifier.",
"description": "Represents a vulnerability identifier",
"fields": [
{
"name": "externalId",
@ -55003,7 +55003,7 @@
{
"kind": "OBJECT",
"name": "VulnerabilityIssueLink",
"description": "Represents an issue link of a vulnerability.",
"description": "Represents an issue link of a vulnerability",
"fields": [
{
"name": "id",
@ -55182,7 +55182,7 @@
{
"kind": "ENUM",
"name": "VulnerabilityIssueLinkType",
"description": "The type of the issue link related to a vulnerability.",
"description": "The type of the issue link related to a vulnerability",
"fields": null,
"inputFields": null,
"interfaces": null,
@ -55817,7 +55817,7 @@
{
"kind": "ENUM",
"name": "VulnerabilityReportType",
"description": "The type of the security scan that found the vulnerability.",
"description": "The type of the security scan that found the vulnerability",
"fields": null,
"inputFields": null,
"interfaces": null,
@ -55864,7 +55864,7 @@
{
"kind": "OBJECT",
"name": "VulnerabilityScanner",
"description": "Represents a vulnerability scanner.",
"description": "Represents a vulnerability scanner",
"fields": [
{
"name": "externalId",
@ -56142,7 +56142,7 @@
{
"kind": "ENUM",
"name": "VulnerabilitySeverity",
"description": "The severity of the vulnerability.",
"description": "The severity of the vulnerability",
"fields": null,
"inputFields": null,
"interfaces": null,
@ -56212,7 +56212,7 @@
{
"kind": "ENUM",
"name": "VulnerabilityState",
"description": "The state of the vulnerability.",
"description": "The state of the vulnerability",
"fields": null,
"inputFields": null,
"interfaces": null,

File diff suppressed because it is too large Load Diff

View File

@ -170,6 +170,7 @@ You can also type in this search bar to see autocomplete suggestions for:
- Various help pages (try and type **API help**)
- Project feature pages (try and type **milestones**)
- Various settings pages (try and type **user settings**)
- Recently viewed issues (try and type some word from the title of a recently viewed issue)
## To-Do List

View File

@ -25,7 +25,7 @@ module Gitlab
content = "### #{object[:name]}\n"
if object[:description].present?
content += "\n#{object[:description]}\n"
content += "\n#{object[:description]}.\n"
end
content

View File

@ -13,8 +13,6 @@ module Gitlab
end
def log_view(issue)
return unless recent_items_enabled?
with_redis do |redis|
redis.zadd(key, Time.now.to_f, issue.id)
redis.expire(key, @expires_after)
@ -29,8 +27,6 @@ module Gitlab
end
def search(term)
return Issue.none unless recent_items_enabled?
ids = with_redis do |redis|
redis.zrevrange(key, 0, @items_limit - 1)
end.map(&:to_i)
@ -51,10 +47,6 @@ module Gitlab
def type
Issue
end
def recent_items_enabled?
Feature.enabled?(:recent_items_search, @user)
end
end
end
end

View File

@ -428,7 +428,7 @@ module Gitlab
{
jira_imports_total_imported_count: count(finished_jira_imports),
jira_imports_projects_count: distinct_count(finished_jira_imports, :project_id),
jira_imports_total_imported_issues_count: alt_usage_data { JiraImportState.finished_imports_count }
jira_imports_total_imported_issues_count: sum(JiraImportState.finished, :imported_issues_count)
}
# rubocop: enable UsageData/LargeTable
end

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
module Gitlab
# This class is used by the `gitlab:usage_data:dump_sql` rake tasks to output SQL instead of running it.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/41091
class UsageDataQueries < UsageData
class << self
def count(relation, column = nil, *rest)
@ -19,6 +21,10 @@ module Gitlab
end
end
def sum(relation, column, *rest)
relation.select(relation.all.table[column].sum).to_sql # rubocop:disable CodeReuse/ActiveRecord
end
private
def raw_sql(relation, column, distinct = nil)

View File

@ -59,6 +59,12 @@ module Gitlab
FALLBACK
end
def sum(relation, column, batch_size: nil, start: nil, finish: nil)
Gitlab::Database::BatchCount.batch_sum(relation, column, batch_size: batch_size, start: start, finish: finish)
rescue ActiveRecord::StatementInvalid
FALLBACK
end
def alt_usage_data(value = nil, fallback: FALLBACK, &block)
if block_given?
yield

View File

@ -87,6 +87,22 @@ RSpec.describe Projects::MergeRequestsController do
end
end
context 'with `default_merge_ref_for_diffs` feature flag enabled' do
before do
stub_feature_flags(default_merge_ref_for_diffs: true)
go
end
it 'adds the diff_head parameter' do
expect(assigns["endpoint_metadata_url"]).to eq(
diffs_metadata_project_json_merge_request_path(
project,
merge_request,
'json',
diff_head: true))
end
end
context 'when diff is missing' do
render_views

View File

@ -378,7 +378,7 @@ RSpec.describe 'Pipeline', :js do
find('.js-tests-tab-link').click
expect(page).to have_content('Jobs')
expect(page).to have_selector('.js-tests-detail', visible: :all)
expect(page).to have_selector('[data-testid="tests-detail"]', visible: :all)
end
end

View File

@ -1,4 +1,5 @@
import Vuex from 'vuex';
import { GlLoadingIcon } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { getJSONFixture } from 'helpers/fixtures';
import TestReports from '~/pipelines/components/test_reports/test_reports.vue';
@ -15,9 +16,9 @@ describe('Test reports app', () => {
const testReports = getJSONFixture('pipelines/test_report.json');
const loadingSpinner = () => wrapper.find('.js-loading-spinner');
const testsDetail = () => wrapper.find('.js-tests-detail');
const noTestsToShow = () => wrapper.find('.js-no-tests-to-show');
const loadingSpinner = () => wrapper.find(GlLoadingIcon);
const testsDetail = () => wrapper.find('[data-testid="tests-detail"]');
const noTestsToShow = () => wrapper.find('[data-testid="no-tests-to-show"]');
const testSummary = () => wrapper.find(TestSummary);
const testSummaryTable = () => wrapper.find(TestSummaryTable);
@ -88,6 +89,10 @@ describe('Test reports app', () => {
expect(wrapper.vm.testReports).toBeTruthy();
expect(wrapper.vm.showTests).toBeTruthy();
});
it('shows tests details', () => {
expect(testsDetail().exists()).toBe(true);
});
});
describe('when a suite is clicked', () => {

View File

@ -7,11 +7,7 @@ exports[`Confidential Issue Sidebar Block renders for confidential = false and i
>
<div
class="sidebar-collapsed-icon"
data-boundary="viewport"
data-container="body"
data-original-title="Not confidential"
data-placement="left"
title=""
title="Not confidential"
>
<gl-icon-stub
aria-hidden="true"
@ -59,11 +55,7 @@ exports[`Confidential Issue Sidebar Block renders for confidential = false and i
>
<div
class="sidebar-collapsed-icon"
data-boundary="viewport"
data-container="body"
data-original-title="Not confidential"
data-placement="left"
title=""
title="Not confidential"
>
<gl-icon-stub
aria-hidden="true"
@ -119,11 +111,7 @@ exports[`Confidential Issue Sidebar Block renders for confidential = true and is
>
<div
class="sidebar-collapsed-icon"
data-boundary="viewport"
data-container="body"
data-original-title="Confidential"
data-placement="left"
title=""
title="Confidential"
>
<gl-icon-stub
aria-hidden="true"
@ -170,11 +158,7 @@ exports[`Confidential Issue Sidebar Block renders for confidential = true and is
>
<div
class="sidebar-collapsed-icon"
data-boundary="viewport"
data-container="body"
data-original-title="Confidential"
data-placement="left"
title=""
title="Confidential"
>
<gl-icon-stub
aria-hidden="true"

View File

@ -8,10 +8,6 @@ RSpec.describe ::Gitlab::Search::RecentIssues, :clean_gitlab_redis_shared_state
let(:recent_issues) { described_class.new(user: user, items_limit: 5) }
let(:project) { create(:project, :public) }
before do
stub_feature_flags(recent_items_search: true)
end
describe '#log_viewing' do
it 'adds the item to the recent items' do
recent_issues.log_view(issue)
@ -51,24 +47,6 @@ RSpec.describe ::Gitlab::Search::RecentIssues, :clean_gitlab_redis_shared_state
expect(results).to eq([issue])
end
context 'when recent_items_search feature flag is disabled' do
before do
stub_feature_flags(recent_items_search: false)
end
it 'does not store anything' do
recent_issues.log_view(issue)
# Re-enable before searching to prove that the `log_view` call did
# not persist it
stub_feature_flags(recent_items_search: true)
results = recent_issues.search('hello')
expect(results).to be_empty
end
end
end
describe '#search' do
@ -105,19 +83,5 @@ RSpec.describe ::Gitlab::Search::RecentIssues, :clean_gitlab_redis_shared_state
expect(recent_issues.search('matching')).not_to include(private_issue)
end
context 'when recent_items_search feature flag is disabled' do
it 'does not return anything' do
recent_issues.log_view(issue)
# Disable after persisting to prove that the `search` is not searching
# anything
stub_feature_flags(recent_items_search: false)
results = recent_issues.search('hello')
expect(results).to be_empty
end
end
end
end

View File

@ -32,4 +32,10 @@ RSpec.describe Gitlab::UsageDataQueries do
expect(redis_usage_data[:redis_usage_data_block]).to start_with('#<Proc:')
end
end
describe '.sum' do
it 'returns the raw SQL' do
expect(described_class.sum(Issue, :weight)).to eq('SELECT SUM("issues"."weight") FROM "issues"')
end
end
end

View File

@ -37,6 +37,28 @@ RSpec.describe Gitlab::Utils::UsageData do
end
end
describe '#sum' do
let(:relation) { double(:relation) }
it 'returns the count when counting succeeds' do
allow(Gitlab::Database::BatchCount)
.to receive(:batch_sum)
.with(relation, :column, batch_size: 100, start: 2, finish: 3)
.and_return(1)
expect(described_class.sum(relation, :column, batch_size: 100, start: 2, finish: 3)).to eq(1)
end
it 'returns the fallback value when counting fails' do
stub_const("Gitlab::Utils::UsageData::FALLBACK", 15)
allow(Gitlab::Database::BatchCount)
.to receive(:batch_sum)
.and_raise(ActiveRecord::StatementInvalid.new(''))
expect(described_class.sum(relation, :column)).to eq(15)
end
end
describe '#alt_usage_data' do
it 'returns the fallback when it gets an error' do
expect(described_class.alt_usage_data { raise StandardError } ).to eq(-1)