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

Add latest changes from gitlab-org/gitlab@master

parent 575ccb03
No related branches found
No related tags found
No related merge requests found
Showing
with 86 additions and 152 deletions
Loading
Loading
@@ -2,10 +2,6 @@
documentation](doc/development/changelog.md) for instructions on adding your own
entry.
 
## 12.4.3
- No changes.
## 12.4.2
 
### Fixed (10 changes)
Loading
Loading
Loading
Loading
@@ -168,7 +168,7 @@ export default {
}
 
const recentBoardsPromise = new Promise((resolve, reject) =>
gl.boardService
boardsStore
.recentBoards()
.then(resolve)
.catch(err => {
Loading
Loading
@@ -184,7 +184,7 @@ export default {
}),
);
 
Promise.all([gl.boardService.allBoards(), recentBoardsPromise])
Promise.all([boardsStore.allBoards(), recentBoardsPromise])
.then(([allBoards, recentBoards]) => [allBoards.data, recentBoards.data])
.then(([allBoardsJson, recentBoardsJson]) => {
this.loading = false;
Loading
Loading
/* eslint-disable func-names, no-var, one-var, no-else-return */
/* eslint-disable func-names, no-else-return */
 
import $ from 'jquery';
import Api from './api';
Loading
Loading
@@ -7,7 +7,7 @@ import { s__ } from './locale';
 
const projectSelect = () => {
$('.ajax-project-select').each(function(i, select) {
var placeholder;
let placeholder;
const simpleFilter = $(select).data('simpleFilter') || false;
const isInstantiated = $(select).data('select2');
this.groupId = $(select).data('groupId');
Loading
Loading
@@ -31,20 +31,17 @@ const projectSelect = () => {
placeholder,
minimumInputLength: 0,
query: query => {
var finalCallback, projectsCallback;
finalCallback = function(projects) {
var data;
data = {
let projectsCallback;
const finalCallback = function(projects) {
const data = {
results: projects,
};
return query.callback(data);
};
if (this.includeGroups) {
projectsCallback = function(projects) {
var groupsCallback;
groupsCallback = function(groups) {
var data;
data = groups.concat(projects);
const groupsCallback = function(groups) {
const data = groups.concat(projects);
return finalCallback(data);
};
return Api.groups(query.term, {}, groupsCallback);
Loading
Loading
<script>
import { GlTooltipDirective, GlLink, GlButton, GlLoadingIcon } from '@gitlab/ui';
import defaultAvatarUrl from 'images/no_avatar.png';
import { sprintf, s__ } from '~/locale';
import Icon from '../../vue_shared/components/icon.vue';
import UserAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
Loading
Loading
@@ -83,6 +84,7 @@ export default {
this.showDescription = !this.showDescription;
},
},
defaultAvatarUrl,
};
</script>
 
Loading
Loading
@@ -97,6 +99,9 @@ export default {
:img-size="40"
class="avatar-cell"
/>
<span v-else class="avatar-cell user-avatar-link">
<img :src="$options.defaultAvatarUrl" width="40" height="40" class="avatar s40" />
</span>
<div class="commit-detail flex-list">
<div class="commit-content qa-commit-content">
<gl-link :href="commit.webUrl" class="commit-row-message item-title">
Loading
Loading
@@ -119,6 +124,9 @@ export default {
>
{{ commit.author.name }}
</gl-link>
<template v-else>
{{ commit.authorName }}
</template>
{{ s__('LastCommit|authored') }}
<timeago-tooltip :time="commit.authoredDate" tooltip-placement="bottom" />
</div>
Loading
Loading
@@ -132,9 +140,8 @@ export default {
</div>
<div class="commit-actions flex-row">
<div v-if="commit.signatureHtml" v-html="commit.signatureHtml"></div>
<div class="ci-status-link">
<div v-if="commit.pipeline" class="ci-status-link">
<gl-link
v-if="commit.pipeline"
v-gl-tooltip.left
:href="commit.pipeline.detailedStatus.detailsPath"
:title="statusTitle"
Loading
Loading
Loading
Loading
@@ -75,6 +75,7 @@ export default {
v-for="entry in val"
:id="entry.id"
:key="`${entry.flatPath}-${entry.id}`"
:sha="entry.sha"
:project-path="projectPath"
:current-path="path"
:name="entry.name"
Loading
Loading
Loading
Loading
@@ -37,6 +37,10 @@ export default {
type: String,
required: true,
},
sha: {
type: String,
required: true,
},
projectPath: {
type: String,
required: true,
Loading
Loading
@@ -98,7 +102,7 @@ export default {
return this.path.replace(new RegExp(`^${this.currentPath}/`), '');
},
shortSha() {
return this.id.slice(0, 8);
return this.sha.slice(0, 8);
},
hasLockLabel() {
return this.commit && this.commit.lockLabel;
Loading
Loading
Loading
Loading
@@ -26,9 +26,12 @@ export function fetchLogsTree(client, path, offset, resolver = null) {
const { ref } = client.readQuery({ query: getRef });
 
fetchpromise = axios
.get(`${gon.gitlab_url}/${projectPath}/refs/${ref}/logs_tree/${path.replace(/^\//, '')}`, {
params: { format: 'json', offset },
})
.get(
`${gon.relative_url_root}/${projectPath}/refs/${ref}/logs_tree/${path.replace(/^\//, '')}`,
{
params: { format: 'json', offset },
},
)
.then(({ data, headers }) => {
const headerLogsOffset = headers['more-logs-offset'];
const { commits } = client.readQuery({ query: getCommits });
Loading
Loading
Loading
Loading
@@ -2,6 +2,7 @@
 
fragment TreeEntry on Entry {
id
sha
name
flatPath
type
Loading
Loading
Loading
Loading
@@ -8,6 +8,7 @@ query pathLastCommit($projectPath: ID!, $path: String, $ref: String!) {
description
webUrl
authoredDate
authorName
author {
name
avatarUrl
Loading
Loading
Loading
Loading
@@ -218,7 +218,7 @@ export default {
display: inline-block;
flex: 1;
max-width: inherit;
height: 18px;
height: 19px;
line-height: 16px;
text-overflow: ellipsis;
white-space: nowrap;
Loading
Loading
Loading
Loading
@@ -357,12 +357,18 @@
}
}
 
.filter-dropdown-container > div {
margin: 0;
.filter-dropdown-container {
> div {
margin: 0;
 
> .btn {
margin: 0 0 10px;
width: 100%;
> .btn {
margin: 0 0 10px;
width: 100%;
}
}
.board-labels-toggle-wrapper {
margin-bottom: $gl-input-padding;
}
}
 
Loading
Loading
Loading
Loading
@@ -497,7 +497,7 @@
.add-issues-footer-to-list {
padding-left: $gl-vert-padding;
padding-right: $gl-vert-padding;
line-height: 34px;
line-height: $input-height;
}
 
.issue-card-selected {
Loading
Loading
@@ -551,9 +551,5 @@
* Make the wrapper the same height as a button so it aligns properly when the
* filtered-search-box input element increases in size on Linux smaller breakpoints
*/
height: 34px;
@include media-breakpoint-down(sm) {
margin-bottom: 10px;
}
height: $input-height;
}
Loading
Loading
@@ -24,6 +24,8 @@ module Types
description: 'Web URL of the commit'
field :signature_html, type: GraphQL::STRING_TYPE, null: true, calls_gitaly: true,
description: 'Rendered HTML of the commit signature'
field :author_name, type: GraphQL::STRING_TYPE, null: true,
description: 'Commit authors name'
 
# models/commit lazy loads the author by email
field :author, type: Types::UserType, null: true,
Loading
Loading
Loading
Loading
@@ -8,6 +8,7 @@ module Types
 
value 'DUE_DATE_ASC', 'Due date by ascending order', value: 'due_date_asc'
value 'DUE_DATE_DESC', 'Due date by descending order', value: 'due_date_desc'
value 'RELATIVE_POSITION_ASC', 'Relative position by ascending order', value: 'relative_position_asc'
end
# rubocop: enable Graphql/AuthorizeTypes
end
Loading
Loading
@@ -5,6 +5,7 @@ module Types
include Types::BaseInterface
 
field :id, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :sha, GraphQL::STRING_TYPE, null: false, description: "Last commit sha for entry", method: :id
field :name, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :type, Tree::TypeEnum, null: false # rubocop:disable Graphql/Descriptions
field :path, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
Loading
Loading
Loading
Loading
@@ -898,12 +898,6 @@ module Ci
value.with_indifferent_access
end
end
def build_attributes_from_config
return {} unless pipeline.config_processor
pipeline.config_processor.build_attributes(name)
end
end
end
 
Loading
Loading
Loading
Loading
@@ -551,23 +551,6 @@ module Ci
end
end
 
def stage_seeds
return [] unless config_processor
strong_memoize(:stage_seeds) do
seeds = config_processor.stages_attributes.inject([]) do |previous_stages, attributes|
seed = Gitlab::Ci::Pipeline::Seed::Stage.new(self, attributes, previous_stages)
previous_stages + [seed]
end
seeds.select(&:included?)
end
end
def seeds_size
stage_seeds.sum(&:size)
end
def has_kubernetes_active?
project.deployment_platform&.active?
end
Loading
Loading
@@ -587,62 +570,14 @@ module Ci
end
end
 
def set_config_source
if ci_yaml_from_repo
self.config_source = :repository_source
elsif implied_ci_yaml_file
self.config_source = :auto_devops_source
end
end
##
# TODO, setting yaml_errors should be moved to the pipeline creation chain.
#
def config_processor
return unless ci_yaml_file
return @config_processor if defined?(@config_processor)
@config_processor ||= begin
::Gitlab::Ci::YamlProcessor.new(ci_yaml_file, { project: project, sha: sha, user: user })
rescue Gitlab::Ci::YamlProcessor::ValidationError => e
self.yaml_errors = e.message
nil
rescue => ex
self.yaml_errors = "Undefined error (#{Labkit::Correlation::CorrelationId.current_id})"
Gitlab::Sentry.track_acceptable_exception(ex, extra: {
project_id: project.id,
sha: sha,
ci_yaml_file: ci_yaml_file_path
})
nil
end
end
def ci_yaml_file_path
# TODO: this logic is duplicate with Pipeline::Chain::Config::Content
# we should persist this is `ci_pipelines.config_path`
def config_path
return unless repository_source? || unknown_source?
 
project.ci_config_path.presence || '.gitlab-ci.yml'
end
 
def ci_yaml_file
return @ci_yaml_file if defined?(@ci_yaml_file)
@ci_yaml_file =
if auto_devops_source?
implied_ci_yaml_file
else
ci_yaml_from_repo
end
if @ci_yaml_file
@ci_yaml_file
else
self.yaml_errors = "Failed to load CI/CD config file for #{sha}"
nil
end
end
def has_yaml_errors?
yaml_errors.present?
end
Loading
Loading
@@ -711,7 +646,7 @@ module Ci
def predefined_variables
Gitlab::Ci::Variables::Collection.new.tap do |variables|
variables.append(key: 'CI_PIPELINE_IID', value: iid.to_s)
variables.append(key: 'CI_CONFIG_PATH', value: ci_yaml_file_path)
variables.append(key: 'CI_CONFIG_PATH', value: config_path)
variables.append(key: 'CI_PIPELINE_SOURCE', value: source.to_s)
variables.append(key: 'CI_COMMIT_MESSAGE', value: git_commit_message.to_s)
variables.append(key: 'CI_COMMIT_TITLE', value: git_commit_full_title.to_s)
Loading
Loading
@@ -906,24 +841,6 @@ module Ci
 
private
 
def ci_yaml_from_repo
return unless project
return unless sha
return unless ci_yaml_file_path
project.repository.gitlab_ci_yml_for(sha, ci_yaml_file_path)
rescue GRPC::NotFound, GRPC::Internal
nil
end
def implied_ci_yaml_file
return unless project
if project.auto_devops_enabled?
Gitlab::Template::GitlabCiYmlTemplate.find('Auto-DevOps').content
end
end
def pipeline_data
Gitlab::DataBuilder::Pipeline.build(self)
end
Loading
Loading
Loading
Loading
@@ -57,18 +57,20 @@ module Storage
# Move the namespace directory in all storages used by member projects
repository_storages(legacy_only: true).each do |repository_storage|
# Ensure old directory exists before moving it
gitlab_shell.add_namespace(repository_storage, full_path_before_last_save)
Gitlab::GitalyClient::NamespaceService.allow do
gitlab_shell.add_namespace(repository_storage, full_path_before_last_save)
 
# Ensure new directory exists before moving it (if there's a parent)
gitlab_shell.add_namespace(repository_storage, parent.full_path) if parent
# Ensure new directory exists before moving it (if there's a parent)
gitlab_shell.add_namespace(repository_storage, parent.full_path) if parent
 
unless gitlab_shell.mv_namespace(repository_storage, full_path_before_last_save, full_path)
unless gitlab_shell.mv_namespace(repository_storage, full_path_before_last_save, full_path)
 
Rails.logger.error "Exception moving path #{repository_storage} from #{full_path_before_last_save} to #{full_path}" # rubocop:disable Gitlab/RailsLogger
Rails.logger.error "Exception moving path #{repository_storage} from #{full_path_before_last_save} to #{full_path}" # rubocop:disable Gitlab/RailsLogger
 
# if we cannot move namespace directory we should rollback
# db changes in order to prevent out of sync between db and fs
raise Gitlab::UpdatePathError.new('namespace directory cannot be moved')
# if we cannot move namespace directory we should rollback
# db changes in order to prevent out of sync between db and fs
raise Gitlab::UpdatePathError.new('namespace directory cannot be moved')
end
end
end
end
Loading
Loading
@@ -95,13 +97,15 @@ module Storage
# We will remove it later async
new_path = "#{full_path}+#{id}+deleted"
 
if gitlab_shell.mv_namespace(repository_storage, full_path, new_path)
Gitlab::AppLogger.info %Q(Namespace directory "#{full_path}" moved to "#{new_path}")
Gitlab::GitalyClient::NamespaceService.allow do
if gitlab_shell.mv_namespace(repository_storage, full_path, new_path)
Gitlab::AppLogger.info %Q(Namespace directory "#{full_path}" moved to "#{new_path}")
 
# Remove namespace directory async with delay so
# GitLab has time to remove all projects first
run_after_commit do
GitlabShellWorker.perform_in(5.minutes, :rm_namespace, repository_storage, new_path)
# Remove namespace directory async with delay so
# GitLab has time to remove all projects first
run_after_commit do
GitlabShellWorker.perform_in(5.minutes, :rm_namespace, repository_storage, new_path)
end
end
end
end
Loading
Loading
# frozen_string_literal: true
 
class ProjectCiCdSetting < ApplicationRecord
# TODO: remove once GitLab 12.7 is released
# https://gitlab.com/gitlab-org/gitlab/issues/36651
self.ignored_columns += %i[merge_trains_enabled]
belongs_to :project, inverse_of: :ci_cd_settings
 
# The version of the schema that first introduced this model/table.
Loading
Loading
Loading
Loading
@@ -21,7 +21,6 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
 
def statistics_anchors(show_auto_devops_callout:)
[
license_anchor_data,
commits_anchor_data,
branches_anchor_data,
tags_anchor_data,
Loading
Loading
@@ -32,6 +31,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
def statistics_buttons(show_auto_devops_callout:)
[
readme_anchor_data,
license_anchor_data,
changelog_anchor_data,
contribution_guide_anchor_data,
autodevops_anchor_data(show_auto_devops_callout: show_auto_devops_callout),
Loading
Loading
@@ -41,15 +41,14 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
end
 
def empty_repo_statistics_anchors
[
license_anchor_data
].compact.select { |item| item.is_link }
[]
end
 
def empty_repo_statistics_buttons
[
new_file_anchor_data,
readme_anchor_data,
license_anchor_data,
changelog_anchor_data,
contribution_guide_anchor_data,
gitlab_ci_anchor_data
Loading
Loading
@@ -227,17 +226,18 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
icon = statistic_icon('scale')
 
if repository.license_blob.present?
AnchorData.new(true,
icon + content_tag(:strong, license_short_name, class: 'project-stat-value'),
license_path)
AnchorData.new(false,
icon + content_tag(:span, license_short_name, class: 'project-stat-value'),
license_path,
'default')
else
if current_user && can_current_user_push_to_default_branch?
AnchorData.new(true,
content_tag(:span, icon + _('Add license'), class: 'add-license-link d-flex'),
AnchorData.new(false,
content_tag(:span, statistic_icon + _('Add LICENSE'), class: 'add-license-link d-flex'),
add_license_path)
else
AnchorData.new(true,
icon + content_tag(:strong, _('No license. All rights reserved'), class: 'project-stat-value'),
AnchorData.new(false,
icon + content_tag(:span, _('No license. All rights reserved'), class: 'project-stat-value'),
nil)
end
end
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