Commit 85e49493 authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖

Add latest changes from gitlab-org/[email protected]

parent 4ce0bee9
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-default: &if-default
if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME =~ /^security\// || $CI_MERGE_REQUEST_IID || $CI_COMMIT_TAG'
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-default-ee: &if-default-ee
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME =~ /^security\// || $CI_MERGE_REQUEST_IID || $CI_COMMIT_TAG) && $CI_PROJECT_NAME =~ /^gitlab(-ee)?$/'
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-master: &if-master
if: '$CI_COMMIT_REF_NAME == "master"'
# Make sure to update all the similar patterns in other CI config files if you modify these patterns
.code-backstage-patterns: &code-backstage-patterns
- ".gitlab/ci/**/*"
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
- ".csscomb.json"
- "Dockerfile.assets"
- "*_VERSION"
- "Gemfile{,.lock}"
- "Rakefile"
- "{babel.config,jest.config}.js"
- "config.ru"
- "{package.json,yarn.lock}"
- "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*"
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
# Backstage changes
- "Dangerfile"
- "danger/**/*"
- "{,ee/}fixtures/**/*"
- "{,ee/}rubocop/**/*"
- "{,ee/}spec/**/*"
- "doc/README.md" # Some RSpec test rely on this file
.assets-compile-cache:
cache:
paths:
......@@ -132,7 +167,6 @@ compile-assets pull-cache foss:
- .use-pg9
stage: test
needs: ["setup-test-env", "compile-assets pull-cache"]
dependencies: ["setup-test-env", "compile-assets pull-cache"]
.karma-base:
extends: .only-code-frontend-job-base
......@@ -204,9 +238,10 @@ jest-foss:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .only:changes-code-backstage
stage: test
rules:
- <<: *if-master
when: on_success
dependencies: []
cache:
key: "$CI_JOB_NAME"
......@@ -237,11 +272,12 @@ webpack-dev-server:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .only:changes-code-backstage
stage: test
rules:
- <<: *if-default
changes: *code-backstage-patterns
when: on_success
needs: ["setup-test-env", "compile-assets pull-cache"]
dependencies: ["setup-test-env", "compile-assets pull-cache"]
variables:
WEBPACK_MEMORY_TEST: "true"
WEBPACK_VENDOR_DLL: "true"
......
......@@ -5,7 +5,7 @@ Please describe the proposal and add a link to the source (for example, http://w
-->
- [ ] Mention the proposal in the next backend weekly call and the #backend channel to encourage contribution
- [ ] Proceed with the proposal once 50% of the maintainers have weighed in, and 80% of the votes are :+1:
- [ ] Proceed with the proposal once 50% of the maintainers have weighed in, and 80% of their votes are :+1:
- [ ] Once approved, mention it again in the next backend weekly call and the #backend channel
......
......@@ -283,7 +283,7 @@ gem 'rack-proxy', '~> 0.6.0'
gem 'sassc-rails', '~> 2.1.0'
gem 'uglifier', '~> 2.7.2'
gem 'addressable', '~> 2.5.2'
gem 'addressable', '~> 2.7'
gem 'font-awesome-rails', '~> 4.7'
gem 'gemojione', '~> 3.3'
gem 'gon', '~> 6.2'
......@@ -419,7 +419,7 @@ group :test do
gem 'guard-rspec'
end
gem 'octokit', '~> 4.9'
gem 'octokit', '~> 4.15'
gem 'mail_room', '~> 0.10.0'
......
......@@ -55,8 +55,8 @@ GEM
adamantium (0.2.0)
ice_nine (~> 0.11.0)
memoizable (~> 0.4.0)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
aes_key_wrap (1.0.1)
akismet (3.0.0)
apollo_upload_server (2.0.0.beta.3)
......@@ -650,7 +650,8 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
octokit (4.9.0)
octokit (4.15.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
omniauth (1.9.0)
hashie (>= 3.4.6, < 3.7.0)
......@@ -762,7 +763,7 @@ GEM
pry (~> 0.10)
pry-rails (0.3.6)
pry (>= 0.10.4)
public_suffix (3.1.1)
public_suffix (4.0.3)
pyu-ruby-sasl (0.0.3.3)
raabro (1.1.6)
rack (2.0.7)
......@@ -961,9 +962,9 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
scss_lint (0.56.0)
rake (>= 0.9, < 13)
sass (~> 3.5.3)
......@@ -1130,7 +1131,7 @@ DEPENDENCIES
acme-client (~> 2.0.2)
activerecord-explain-analyze (~> 0.1)
acts-as-taggable-on (~> 6.0)
addressable (~> 2.5.2)
addressable (~> 2.7)
akismet (~> 3.0)
apollo_upload_server (~> 2.0.0.beta3)
asana (~> 0.9)
......@@ -1272,7 +1273,7 @@ DEPENDENCIES
net-ssh (~> 5.2)
nokogiri (~> 1.10.5)
oauth2 (~> 1.4)
octokit (~> 4.9)
octokit (~> 4.15)
omniauth (~> 1.8)
omniauth-auth0 (~> 2.0.0)
omniauth-authentiq (~> 0.3.3)
......
......@@ -90,7 +90,7 @@ export default {
<template>
<div class="info-well d-none d-sm-flex project-last-commit commit p-3">
<gl-loading-icon v-if="isLoading" size="md" class="m-auto" />
<gl-loading-icon v-if="isLoading" size="md" color="dark" class="m-auto" />
<template v-else>
<user-avatar-link
v-if="commit.author"
......
......@@ -44,7 +44,7 @@ export default {
</div>
</div>
<div class="blob-viewer">
<gl-loading-icon v-if="loading > 0" size="md" class="my-4 mx-auto" />
<gl-loading-icon v-if="loading > 0" size="md" color="dark" class="my-4 mx-auto" />
<div v-else-if="readme" v-html="readme.html"></div>
</div>
</article>
......
......@@ -34,6 +34,11 @@ export default {
type: Boolean,
required: true,
},
loadingPath: {
type: String,
required: false,
default: '',
},
},
data() {
return {
......@@ -69,7 +74,12 @@ export default {
<table :aria-label="tableCaption" class="table tree-table qa-file-tree" aria-live="polite">
<table-header v-once />
<tbody>
<parent-row v-show="showParentRow" :commit-ref="ref" :path="path" />
<parent-row
v-show="showParentRow"
:commit-ref="ref"
:path="path"
:loading-path="loadingPath"
/>
<template v-for="val in entries">
<table-row
v-for="entry in val"
......@@ -84,6 +94,7 @@ export default {
:url="entry.webUrl"
:submodule-tree-url="entry.treeUrl"
:lfs-oid="entry.lfsOid"
:loading-path="loadingPath"
/>
</template>
<template v-if="isLoading">
......
<script>
import { GlLoadingIcon } from '@gitlab/ui';
export default {
components: {
GlLoadingIcon,
},
props: {
commitRef: {
type: String,
......@@ -9,13 +14,21 @@ export default {
type: String,
required: true,
},
loadingPath: {
type: String,
required: false,
default: null,
},
},
computed: {
parentRoute() {
parentPath() {
const splitArray = this.path.split('/');
splitArray.pop();
return { path: `/tree/${this.commitRef}/${splitArray.join('/')}` };
return splitArray.join('/');
},
parentRoute() {
return { path: `/tree/${this.commitRef}/${this.parentPath}` };
},
},
methods: {
......@@ -29,7 +42,13 @@ export default {
<template>
<tr class="tree-item">
<td colspan="3" class="tree-item-file-name" @click.self="clickRow">
<router-link :to="parentRoute" :aria-label="__('Go to parent')">
<gl-loading-icon
v-if="parentPath === loadingPath"
size="sm"
inline
class="d-inline-block align-text-bottom"
/>
<router-link v-else :to="parentRoute" :aria-label="__('Go to parent')">
..
</router-link>
</td>
......
<script>
import { GlBadge, GlLink, GlSkeletonLoading, GlTooltipDirective } from '@gitlab/ui';
import { GlBadge, GlLink, GlSkeletonLoading, GlTooltipDirective, GlLoadingIcon } from '@gitlab/ui';
import { visitUrl } from '~/lib/utils/url_utility';
import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import Icon from '~/vue_shared/components/icon.vue';
......@@ -12,6 +12,7 @@ export default {
GlBadge,
GlLink,
GlSkeletonLoading,
GlLoadingIcon,
TimeagoTooltip,
Icon,
},
......@@ -76,6 +77,11 @@ export default {
required: false,
default: null,
},
loadingPath: {
type: String,
required: false,
default: '',
},
},
data() {
return {
......@@ -125,7 +131,13 @@ export default {
<template>
<tr :class="`file_${id}`" class="tree-item" @click="openRow">
<td class="tree-item-file-name">
<i :aria-label="type" role="img" :class="iconName" class="fa fa-fw"></i>
<gl-loading-icon
v-if="path === loadingPath"
size="sm"
inline
class="d-inline-block align-text-bottom fa-fw"
/>
<i v-else :aria-label="type" role="img" :class="iconName" class="fa fa-fw"></i>
<component :is="linkComponent" :to="routerLinkTo" :href="url" class="str-truncated">
{{ fullPath }}
</component>
......
......@@ -27,6 +27,11 @@ export default {
required: false,
default: '/',
},
loadingPath: {
type: String,
required: false,
default: '',
},
},
data() {
return {
......@@ -109,7 +114,12 @@ export default {
<template>
<div>
<file-table :path="path" :entries="entries" :is-loading="isLoadingFiles" />
<file-table
:path="path"
:entries="entries"
:is-loading="isLoadingFiles"
:loading-path="loadingPath"
/>
<file-preview v-if="readme" :blob="readme" />
</div>
</template>
import getFiles from '../queries/getFiles.query.graphql';
import getRefMixin from './get_ref';
import getProjectPath from '../queries/getProjectPath.query.graphql';
export default {
mixins: [getRefMixin],
apollo: {
projectPath: {
query: getProjectPath,
},
},
data() {
return { projectPath: '', loadingPath: null };
},
beforeRouteUpdate(to, from, next) {
this.preload(to.params.pathMatch, next);
},
methods: {
preload(path, next) {
this.loadingPath = path.replace(/^\//, '');
return this.$apollo
.query({
query: getFiles,
variables: {
projectPath: this.projectPath,
ref: this.ref,
path: this.loadingPath,
nextPageCursor: '',
pageSize: 100,
},
})
.then(() => next());
},
},
};
<script>
import TreeContent from '../components/tree_content.vue';
import { updateElementsVisibility } from '../utils/dom';
import preloadMixin from '../mixins/preload';
export default {
components: {
TreeContent,
},
mixins: [preloadMixin],
props: {
path: {
type: String,
......@@ -34,5 +36,5 @@ export default {
</script>
<template>
<tree-content :path="path" />
<tree-content :path="path" :loading-path="loadingPath" />
</template>
......@@ -39,6 +39,10 @@ class Projects::WikisController < Projects::ApplicationController
if @page
set_encoding_error unless valid_encoding?
# Assign vars expected by MarkupHelper
@ref = params[:version_id]
@path = @page.path
render 'show'
elsif file_blob
send_blob(@project_wiki.repository, file_blob)
......
......@@ -132,6 +132,7 @@ module MarkupHelper
pipeline: :wiki,
project: @project,
project_wiki: @project_wiki,
repository: @project_wiki.repository,
page_slug: wiki_page.slug,
issuable_state_filter_enabled: true
)
......
......@@ -26,7 +26,7 @@ module Ci
belongs_to :merge_request, class_name: 'MergeRequest'
belongs_to :external_pull_request
has_internal_id :iid, scope: :project, presence: false, ensure_if: -> { !importing? }, init: ->(s) do
has_internal_id :iid, scope: :project, presence: false, track_if: -> { !importing? }, ensure_if: -> { !importing? }, init: ->(s) do
s&.project&.all_pipelines&.maximum(:iid) || s&.project&.all_pipelines&.count
end
......
......@@ -27,13 +27,13 @@ module AtomicInternalId
extend ActiveSupport::Concern
class_methods do
def has_internal_id(column, scope:, init:, ensure_if: nil, presence: true) # rubocop:disable Naming/PredicateName
def has_internal_id(column, scope:, init:, ensure_if: nil, track_if: nil, presence: true) # rubocop:disable Naming/PredicateName
# We require init here to retain the ability to recalculate in the absence of a
# InternaLId record (we may delete records in `internal_ids` for example).
# InternalId record (we may delete records in `internal_ids` for example).
raise "has_internal_id requires a init block, none given." unless init
raise "has_internal_id needs to be defined on association." unless self.reflect_on_association(scope)
before_validation :"track_#{scope}_#{column}!", on: :create
before_validation :"track_#{scope}_#{column}!", on: :create, if: track_if
before_validation :"ensure_#{scope}_#{column}!", on: :create, if: ensure_if
validates column, presence: presence
......
......@@ -5,6 +5,7 @@ class Deployment < ApplicationRecord
include IidRoutes
include AfterCommitQueue
include UpdatedAtFilterable
include Importable
include Gitlab::Utils::StrongMemoize
belongs_to :project, required: true
......@@ -17,7 +18,7 @@ class Deployment < ApplicationRecord
has_many :merge_requests,
through: :deployment_merge_requests
has_internal_id :iid, scope: :project, init: ->(s) do
has_internal_id :iid, scope: :project, track_if: -> { !importing? }, init: ->(s) do
Deployment.where(project: s.project).maximum(:iid) if s&.project
end
......
......@@ -31,7 +31,7 @@ class Issue < ApplicationRecord
belongs_to :duplicated_to, class_name: 'Issue'
belongs_to :closed_by, class_name: 'User'
has_internal_id :iid, scope: :project, init: ->(s) { s&.project&.issues&.maximum(:iid) }
has_internal_id :iid, scope: :project, track_if: -> { !importing? }, init: ->(s) { s&.project&.issues&.maximum(:iid) }
has_many :issue_milestones
has_many :milestones, through: :issue_milestones
......@@ -78,8 +78,8 @@ class Issue < ApplicationRecord
ignore_column :state, remove_with: '12.7', remove_after: '2019-12-22'
after_commit :expire_etag_cache
after_save :ensure_metrics, unless: :imported?
after_commit :expire_etag_cache, unless: :importing?
after_save :ensure_metrics, unless: :importing?
attr_spammable :title, spam_title: true
attr_spammable :description, spam_description: true
......
......@@ -31,7 +31,7 @@ class MergeRequest < ApplicationRecord
belongs_to :source_project, class_name: "Project"
belongs_to :merge_user, class_name: "User"
has_internal_id :iid, scope: :target_project, init: ->(s) { s&.target_project&.merge_requests&.maximum(:iid) }
has_internal_id :iid, scope: :target_project, track_if: -> { !importing? }, init: ->(s) { s&.target_project&.merge_requests&.maximum(:iid) }
has_many :merge_request_diffs
......@@ -97,8 +97,8 @@ class MergeRequest < ApplicationRecord
after_create :ensure_merge_request_diff
after_update :clear_memoized_shas
after_update :reload_diff_if_branch_changed
after_save :ensure_metrics
after_commit :expire_etag_cache
after_save :ensure_metrics, unless: :importing?
after_commit :expire_etag_cache, unless: :importing?
# When this attribute is true some MR validation is ignored
# It allows us to close or modify broken merge requests
......
......@@ -138,7 +138,7 @@ class MergeRequestDiff < ApplicationRecord
# All diff information is collected from repository after object is created.
# It allows you to override variables like head_commit_sha before getting diff.
after_create :save_git_content, unless: :importing?
after_create_commit :set_as_latest_diff
after_create_commit :set_as_latest_diff, unless: :importing?
after_save :update_external_diff_store, if: -> { !importing? && saved_change_to_external_diff? }
......
......@@ -17,6 +17,7 @@ class Milestone < ApplicationRecord
include StripAttribute
include Milestoneish
include FromUnion
include Importable
include Gitlab::SQL::Pattern
prepend_if_ee('::EE::Milestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
......@@ -30,8 +31,8 @@ class Milestone < ApplicationRecord
has_many :milestone_releases
has_many :releases, through: :milestone_releases
has_internal_id :iid, scope: :project, init: ->(s) { s&.project&.milestones&.maximum(:iid) }
has_internal_id :iid, scope: :group, init: ->(s) { s&.group&.milestones&.maximum(:iid) }
has_internal_id :iid, scope: :project, track_if: -> { !importing? }, init: ->(s) { s&.project&.milestones&.maximum(:iid) }
has_internal_id :iid, scope: :group, track_if: -> { !importing? }, init: ->(s) { s&.group&.milestones&.maximum(:iid) }
has_many :issues
has_many :labels, -> { distinct.reorder('labels.title') }, through: :issues
......
......@@ -3,6 +3,7 @@
class Release < ApplicationRecord
include Presentable
include CacheMarkdownField
include Importable
include Gitlab::Utils::StrongMemoize
cache_markdown_field :description
......@@ -33,8 +34,8 @@ class Release < ApplicationRecord
delegate :repository, to: :project
after_commit :create_evidence!, on: :create
after_commit :notify_new_release, on: :create
after_commit :create_evidence!, on: :create, unless: :importing?
after_commit :notify_new_release, on: :create, unless: :importing?
MAX_NUMBER_TO_DISPLAY = 3
......
......@@ -20,6 +20,7 @@ class User < ApplicationRecord
include WithUploads
include OptionallySearch
include FromUnion
include BatchDestroyDependentAssociations
DEFAULT_NOTIFICATION_LEVEL = :participating
......
......@@ -56,6 +56,13 @@ module Users
MigrateToGhostUserService.new(user).execute unless options[:hard_delete]
if Feature.enabled?(:destroy_user_associations_in_batches)
# Rails attempts to load all related records into memory before
# destroying: https://github.com/rails/rails/issues/22510
# This ensures we delete records in batches.
user.destroy_dependent_associations_in_batches
end
# Destroy the namespace after destroying the user since certain methods may depend on the namespace existing
user_data = user.destroy
namespace.destroy
......
---
title: Fix error in Wiki when rendering the AsciiDoc include directive
merge_request: 22565
author:
type: fixed
---
title: 'Fix Issue API: creating with manual IID returns conflict when IID already
in use'
merge_request: 22788
author: Mara Sophie Grosch
type: fixed
---
title: Add comment_on_event_enabled to services API
merge_request:
author:
type: added
---
title: Add `importing?` to disable some callbacks
merge_request:
author:
type: performance
---
title: Upgrade octokit and its dependencies
merge_request: 22946
author:
type: other
---
title: 'Use IS08601.3 format for app level logging of timestamps'
merge_request: 22793
author:
type: other
......@@ -32,7 +32,8 @@ Example response:
"confidential_note_events": true,
"pipeline_events": true,
"wiki_page_events": true,
"job_events": true
"job_events": true,
"comment_on_event_enabled": true
}
{
"id": 76,
......@@ -50,7 +51,8 @@ Example response:
"confidential_note_events": true,
"pipeline_events": true,
"wiki_page_events": true,
"job_events": true
"job_events": true,
"comment_on_event_enabled": true
}
]
```
......@@ -723,6 +725,7 @@ Parameters:
| `jira_issue_transition_id` | string | no | The ID of a transition that moves issues to a closed state. You can find this number under the Jira workflow administration (**Administration > Issues > Workflows**) by selecting **View** under **Operations** of the desired workflow of your project. The ID of each state can be found inside the parenthesis of each transition name under the **Transitions (id)** column. By default, this ID is set to `2`. |
| `commit_events` | boolean | false | Enable notifications for commit events |
| `merge_requests_events` | boolean | false | Enable notifications for merge request events |
| `comment_on_event_enabled` | boolean | false | Enable comments inside Jira issues on each GitLab event (commit / merge request) |
### Delete Jira service
......@@ -761,6 +764,7 @@ Example response:
"note_events": true,
"job_events": true,
"pipeline_events": true,
"comment_on_event_enabled": false,
"properties": {
"token": "<your_access_token>"
}
......
......@@ -191,7 +191,7 @@ Here are some examples of how messages would be handled by both the loggers.
FancyMultiLogger.info("Information")
# UnstructuredLogger
I, [2020-01-13T12:02:41.566219 #6652] INFO -- : Information
I, [2020-01-13T18:48:49.201Z #5647] INFO -- : Information