Skip to content
Snippets Groups Projects
Commit 85e49493 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 4ce0bee9
No related branches found
No related tags found
No related merge requests found
Showing
with 173 additions and 40 deletions
# 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:
Loading
Loading
@@ -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
Loading
Loading
@@ -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"
Loading
Loading
@@ -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"
Loading
Loading
Loading
Loading
@@ -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
 
 
Loading
Loading
Loading
Loading
@@ -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'
Loading
Loading
@@ -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'
 
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
@@ -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)
Loading
Loading
@@ -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)
Loading
Loading
@@ -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)
Loading
Loading
@@ -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)
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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"
Loading
Loading
Loading
Loading
@@ -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>
Loading
Loading
Loading
Loading
@@ -34,6 +34,11 @@ export default {
type: Boolean,
required: true,
},
loadingPath: {
type: String,
required: false,
default: '',
},
},
data() {
return {
Loading
Loading
@@ -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"
Loading
Loading
@@ -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">
Loading
Loading
<script>
import { GlLoadingIcon } from '@gitlab/ui';
export default {
components: {
GlLoadingIcon,
},
props: {
commitRef: {
type: String,
Loading
Loading
@@ -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: {
Loading
Loading
@@ -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>
Loading
Loading
<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';
Loading
Loading
@@ -12,6 +12,7 @@ export default {
GlBadge,
GlLink,
GlSkeletonLoading,
GlLoadingIcon,
TimeagoTooltip,
Icon,
},
Loading
Loading
@@ -76,6 +77,11 @@ export default {
required: false,
default: null,
},
loadingPath: {
type: String,
required: false,
default: '',
},
},
data() {
return {
Loading
Loading
@@ -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>
Loading
Loading
Loading
Loading
@@ -27,6 +27,11 @@ export default {
required: false,
default: '/',
},
loadingPath: {
type: String,
required: false,
default: '',
},
},
data() {
return {
Loading
Loading
@@ -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,
Loading
Loading
@@ -34,5 +36,5 @@ export default {
</script>
 
<template>
<tree-content :path="path" />
<tree-content :path="path" :loading-path="loadingPath" />
</template>
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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
)
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
Loading
Loading
@@ -5,6 +5,7 @@ class Deployment < ApplicationRecord
include IidRoutes
include AfterCommitQueue
include UpdatedAtFilterable
include Importable
include Gitlab::Utils::StrongMemoize
 
belongs_to :project, required: true
Loading
Loading
@@ -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
 
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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? }
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment