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

Add latest changes from gitlab-org/gitlab@master

parent 5a6b36b6
No related branches found
No related tags found
No related merge requests found
Showing
with 165 additions and 17 deletions
Loading
Loading
@@ -48,3 +48,11 @@ Dangerfile @gl-quality/eng-prod
 
# Delivery owner files
/.gitlab/ci/releases.gitlab-ci.yml @gitlab-org/delivery
# Telemetry owner files
/ee/lib/gitlab/usage_data_counters/ @gitlab-org/growth/telemetry
/ee/lib/ee/gitlab/usage_data.rb @gitlab-org/growth/telemetry
/lib/gitlab/grafana_embed_usage_data.rb @gitlab-org/growth/telemetry
/lib/gitlab/usage_data.rb @gitlab-org/growth/telemetry
/lib/gitlab/cycle_analytics/usage_data.rb @gitlab-org/growth/telemetry
/lib/gitlab/usage_data_counters/ @gitlab-org/growth/telemetry
Loading
Loading
@@ -51,7 +51,9 @@ docs lint:
script:
- scripts/lint-doc.sh
# Prepare docs for build
- mv doc/ /tmp/gitlab-docs/content/$DOCS_GITLAB_REPO_SUFFIX
# The path must be 'ee/' because we have hardcoded links relying on it
# https://gitlab.com/gitlab-org/gitlab-docs/-/blob/887850752fc0e72856da6632db132f005ba77f16/content/index.erb#L44-63
- mv doc/ /tmp/gitlab-docs/content/ee
- cd /tmp/gitlab-docs
# Build HTML from Markdown
- bundle exec nanoc
Loading
Loading
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
import { s__, sprintf } from '~/locale';
 
const MARKDOWN_LINK_TEXT = {
markdown: '[Link Title](page-slug)',
rdoc: '{Link title}[link:page-slug]',
asciidoc: 'link:page-slug[Link title]',
org: '[[page-slug]]',
};
export default class Wikis {
constructor() {
this.sidebarEl = document.querySelector('.js-wiki-sidebar');
Loading
Loading
@@ -28,6 +35,15 @@ export default class Wikis {
 
window.addEventListener('resize', () => this.renderSidebar());
this.renderSidebar();
const changeFormatSelect = document.querySelector('#wiki_format');
const linkExample = document.querySelector('.js-markup-link-example');
if (changeFormatSelect) {
changeFormatSelect.addEventListener('change', e => {
linkExample.innerHTML = MARKDOWN_LINK_TEXT[e.target.value];
});
}
}
 
handleWikiTitleChange(e) {
Loading
Loading
Loading
Loading
@@ -149,10 +149,6 @@ class ApplicationController < ActionController::Base
payload[:username] = logged_user.try(:username)
end
 
if response.status == 422 && response.body.present? && response.content_type == 'application/json'
payload[:response] = response.body
end
payload[:queue_duration] = request.env[::Gitlab::Middleware::RailsQueueDuration::GITLAB_RAILS_QUEUE_DURATION_KEY]
end
 
Loading
Loading
Loading
Loading
@@ -16,7 +16,13 @@ class Import::GiteaController < Import::GithubController
 
# Must be defined or it will 404
def status
super
if blocked_url?
session[access_token_key] = nil
redirect_to new_import_url, alert: _('Specified URL cannot be used.')
else
super
end
end
 
private
Loading
Loading
@@ -54,4 +60,19 @@ class Import::GiteaController < Import::GithubController
def client_options
{ host: provider_url, api_version: 'v1' }
end
def blocked_url?
Gitlab::UrlBlocker.blocked_url?(
provider_url,
{
allow_localhost: allow_local_requests?,
allow_local_network: allow_local_requests?,
schemes: %w(http https)
}
)
end
def allow_local_requests?
Gitlab::CurrentSettings.allow_local_requests_from_web_hooks_and_services?
end
end
Loading
Loading
@@ -280,12 +280,12 @@ class Deployment < ApplicationRecord
errors.add(:ref, _('The branch or tag does not exist'))
end
 
private
def ref_path
File.join(environment.ref_path, 'deployments', iid.to_s)
end
 
private
def legacy_finished_at
self.created_at if success? && !read_attribute(:finished_at)
end
Loading
Loading
Loading
Loading
@@ -911,10 +911,8 @@ class Repository
def merged_branch_names(branch_names = [])
# Currently we should skip caching if requesting all branch names
# This is only used in a few places, notably app/services/branches/delete_merged_service.rb,
# and it could potentially result in a very large cache/performance issues with the current
# implementation.
skip_cache = branch_names.empty? || Feature.disabled?(:merged_branch_names_redis_caching, default_enabled: true)
return raw_repository.merged_branch_names(branch_names) if skip_cache
# and it could potentially result in a very large cache.
return raw_repository.merged_branch_names(branch_names) if branch_names.empty?
 
cache = redis_hash_cache
 
Loading
Loading
Loading
Loading
@@ -34,6 +34,7 @@ class Service < ApplicationRecord
 
validates :project_id, presence: true, unless: -> { template? }
validates :type, presence: true
validates :template, uniqueness: { scope: :type }, if: -> { template? }
 
scope :visible, -> { where.not(type: 'GitlabIssueTrackerService') }
scope :issue_trackers, -> { where(category: 'issue_tracker') }
Loading
Loading
Loading
Loading
@@ -35,7 +35,7 @@ module Ci
{
text: job.artifacts_expose_as,
url: path_for_entries(metadata_entries, job),
job_path: project_job_path(project, job),
job_path: project_job_path(job.project, job),
job_name: job.name
}
end
Loading
Loading
@@ -59,9 +59,9 @@ module Ci
return if entries.empty?
 
if single_artifact?(entries)
file_project_job_artifacts_path(project, job, entries.first.path)
file_project_job_artifacts_path(job.project, job, entries.first.path)
else
browse_project_job_artifacts_path(project, job)
browse_project_job_artifacts_path(job.project, job)
end
end
 
Loading
Loading
Loading
Loading
@@ -43,8 +43,16 @@
 
.form-text.text-muted
= succeed '.' do
= (s_("WikiMarkdownTip|To link to a (new) page, simply type %{link_example}") % { link_example: '<code>[Link Title](page-slug)</code>' }).html_safe
- case @page.format.to_s
- when 'rdoc'
- link_example = '{Link title}[link:page-slug]'
- when 'asciidoc'
- link_example = 'link:page-slug[Link title]'
- when 'org'
- link_example = '[[page-slug]]'
- else
- link_example = '[Link Title](page-slug)'
= (s_('WikiMarkdownTip|To link to a (new) page, simply type <code class="js-markup-link-example">%{link_example}</code>') % { link_example: link_example }).html_safe
= succeed '.' do
- markdown_link = link_to s_("WikiMarkdownDocs|documentation"), help_page_path('user/markdown', anchor: 'wiki-specific-markdown')
= (s_("WikiMarkdownDocs|More examples are in the %{docs_link}") % { docs_link: markdown_link }).html_safe
Loading
Loading
---
title: Markup tips for Markdown shown while editing wiki pages in other formats
merge_request: 25974
author:
type: fixed
---
title: Optimize project representation in large imports
merge_request: !22598
author:
type: performance
---
title: Fix links to exposed artifacts in MRs from forks
merge_request: 25868
author: Daniel Stone
type: fixed
---
title: Fix 500 Error when using Gitea Importer
merge_request: 26166
author:
type: fixed
---
title: Improve performance of Repository#merged_branch_names
merge_request: 26005
author:
type: performance
---
title: Validates only one service template per type
merge_request: 26380
author:
type: other
# frozen_string_literal: true
Gitlab::Database::ConnectionTimer.configure do |config|
config.interval = Rails.application.config_for(:database)[:force_reconnect_interval]
end
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(Gitlab::Database::PostgresqlAdapter::ForceDisconnectableMixin)
# frozen_string_literal: true
TELEMETRY_CHANGED_FILES_MESSAGE = <<~MSG
This merge request adds or changes files that require a
review from the Data team and Telemetry team @gitlab-org/growth/telemetry.
The specific group is mentioned in order to send a notification to team members.
MSG
usage_data_changed_files = git.modified_files.grep(%r{usage_data})
if usage_data_changed_files.any?
warn format(TELEMETRY_CHANGED_FILES_MESSAGE)
USAGE_DATA_FILES_MESSAGE = <<~MSG
The following files require a review from the [Data team and Telemetry team](https://gitlab.com/groups/gitlab-org/growth/telemetry/-/group_members?with_inherited_permissions=exclude):
MSG
markdown(USAGE_DATA_FILES_MESSAGE + helper.markdown_list(usage_data_changed_files))
end
# frozen_string_literal: true
class DeleteTemplateServicesDuplicatedByType < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
# Delete service templates with duplicated types. Keep the service
# template with the lowest `id` because that is the service template used:
# https://gitlab.com/gitlab-org/gitlab/-/blob/v12.8.1-ee/app/controllers/admin/services_controller.rb#L37
execute <<~SQL
DELETE
FROM services
WHERE TEMPLATE = TRUE
AND id NOT IN
(SELECT MIN(id)
FROM services
WHERE TEMPLATE = TRUE
GROUP BY TYPE);
SQL
end
def down
# This migration cannot be reversed.
end
end
# frozen_string_literal: true
class AddIndexToServiceUniqueTemplatePerType < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index(:services, [:type, :template], unique: true, where: 'template IS TRUE')
end
def down
remove_concurrent_index(:services, [:type, :template])
end
end
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