Commit b49c809b authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 6331242afec6
......@@ -16,9 +16,6 @@ export default {
...mapState({ items: 'machineTypes' }),
...mapGetters(['hasZone', 'hasMachineType']),
allDropdownsSelected() {
return this.projectHasBillingEnabled && this.hasZone && this.hasMachineType;
isDisabled() {
return (
this.isLoading ||
......@@ -65,22 +62,10 @@ export default {
selectedMachineType() {
methods: {
...mapActions({ setItem: 'setMachineType' }),
enableSubmit() {
if (this.allDropdownsSelected) {
const submitButtonEl = document.querySelector('.js-gke-cluster-creation-submit');
if (submitButtonEl) {
import { mapGetters } from 'vuex';
export default {
computed: {
class="js-gke-cluster-creation-submit btn btn-success"
{{ s__('ClusterIntegration|Create Kubernetes cluster') }}
......@@ -4,6 +4,10 @@ import Flash from '~/flash';
import GkeProjectIdDropdown from './components/gke_project_id_dropdown.vue';
import GkeZoneDropdown from './components/gke_zone_dropdown.vue';
import GkeMachineTypeDropdown from './components/gke_machine_type_dropdown.vue';
import GkeSubmitButton from './components/gke_submit_button.vue';
import store from './store';
import * as CONSTANTS from './constants';
const mountComponent = (entryPoint, component, componentName, extraProps = {}) => {
......@@ -14,6 +18,7 @@ const mountComponent = (entryPoint, component, componentName, extraProps = {}) =
return new Vue({
components: {
[componentName]: component,
......@@ -50,6 +55,10 @@ const mountGkeMachineTypeDropdown = () => {
const mountGkeSubmitButton = () => {
mountComponent('.js-gke-cluster-creation-submit-container', GkeSubmitButton, 'gke-submit-button');
const gkeDropdownErrorHandler = () => {
......@@ -72,6 +81,7 @@ const initializeGapiClient = () => {
export const hasProject = state => Boolean(state.selectedProject.projectId);
export const hasZone = state => Boolean(state.selectedZone);
export const hasMachineType = state => Boolean(state.selectedMachineType);
export const hasValidData = (state, getters) =>
Boolean(state.projectHasBillingEnabled) && getters.hasZone && getters.hasMachineType;
......@@ -4,6 +4,7 @@ import { mapActions, mapState, mapGetters } from 'vuex';
import store from 'ee_else_ce/mr_notes/stores';
import notesApp from '../notes/components/notes_app.vue';
import discussionKeyboardNavigator from '../notes/components/discussion_keyboard_navigator.vue';
import initWidget from '../vue_merge_request_widget';
export default () => {
// eslint-disable-next-line no-new
......@@ -32,11 +33,22 @@ export default () => {
activeTab: state =>,
isShowTabActive() {
return this.activeTab === 'show';
watch: {
discussionTabCounter() {
isShowTabActive: {
handler(newVal) {
if (newVal) {
immediate: true,
created() {
......@@ -69,7 +81,7 @@ export default () => {
noteableData: this.noteableData,
notesData: this.notesData,
userData: this.currentUserData,
shouldShow: this.activeTab === 'show',
shouldShow: this.isShowTabActive,
helpPagePath: this.helpPagePath,
......@@ -7,7 +7,6 @@ import initPipelines from '~/commit/pipelines/pipelines_bundle';
import initVueIssuableSidebarApp from '~/issuable_sidebar/sidebar_bundle';
import initSourcegraph from '~/sourcegraph';
import initPopover from '~/mr_tabs_popover';
import initWidget from '../../../vue_merge_request_widget';
export default function() {
new ZenMode(); // eslint-disable-line no-new
......@@ -20,7 +19,6 @@ export default function() {
new ShortcutsIssuable(true); // eslint-disable-line no-new
const tabHighlightEl = document.querySelector('.js-tabs-feature-highlight');
......@@ -5,6 +5,8 @@ import Translate from '../vue_shared/translate';
export default () => {
if (gl.mrWidget) return;
gl.mrWidgetData.gitlabLogo = gon.gitlab_logo;
const vm = new Vue(MrWidgetOptions);
......@@ -135,15 +135,11 @@ export default {
mounted() {
if (gon && gon.features && gon.features.asyncMrWidget) {
.then(({ data }) => this.initWidget(data))
.catch(() =>
createFlash(__('Unable to load the merge request widget. Try reloading the page.')),
} else {
.then(({ data }) => this.initWidget(data))
.catch(() =>
createFlash(__('Unable to load the merge request widget. Try reloading the page.')),
beforeDestroy() {
eventHub.$off('mr.discussion.updated', this.checkStatus);
......@@ -25,7 +25,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action do
push_frontend_feature_flag(:async_mr_widget, @project)
around_action :allow_gitaly_ref_name_caching, only: [:index, :show, :discussions]
......@@ -67,14 +67,6 @@ class MergeRequestWidgetEntity < Grape::Entity
def as_json(options = {})
return super(options) if Feature.enabled?(:async_mr_widget)
.merge(, **@options.opts_hash).as_json(options))
.merge(, **@options.opts_hash).as_json(options))
delegate :current_user, to: :request
......@@ -11,6 +11,12 @@ def initialize(group:, user:, params: {})
def execute
unless @current_user.can?(:admin_group, @group)
"User with ID: %s does not have permission to Group %s with ID: %s." %
......@@ -79,6 +79,6 @@
= s_('ClusterIntegration|Allow GitLab to manage namespace and service accounts for this cluster.')
= link_to _('More information'), help_page_path('user/project/clusters/', anchor: 'gitlab-managed-clusters'), target: '_blank'
= field.submit s_('ClusterIntegration|Create Kubernetes cluster'),
class: 'js-gke-cluster-creation-submit btn btn-success', disabled: true
title: Remove invalid data from jira_tracker_data table
merge_request: 23621
type: fixed
title: Groups::ImportExport::ExportService to require admin_group permission
merge_request: 23434
type: changed
title: Fetch merge request widget data asynchronous
merge_request: 23594
type: changed
# frozen_string_literal: true
# See
# for more information on how to write migrations for GitLab.
class RemoveInvalidJiraData < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
sql = "DELETE FROM jira_tracker_data WHERE \
(length(encrypted_api_url) > 0 AND encrypted_api_url_iv IS NULL) \
OR (length(encrypted_url) > 0 AND encrypted_url_iv IS NULL) \
OR (length(encrypted_username) > 0 AND encrypted_username_iv IS NULL) \
OR (length(encrypted_password) > 0 AND encrypted_password_iv IS NULL)"
def down
# We need to figure out why migrating data to jira_tracker_data table
# failed and then can recreate the data
......@@ -10,7 +10,7 @@
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_01_21_132641) do
ActiveRecord::Schema.define(version: 2020_01_23_155929) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
......@@ -144,7 +144,7 @@ otherwise you will run into conflicts.
1. Validate using:
openssl s_client -showcerts -servername -connect > cacert.pem
......@@ -156,7 +156,7 @@ If your certificate provider provides the CA Bundle certificates, append them to
1. Open `/home/git/gitlab/config/gitlab.yml`, find the `registry` entry and
configure it with the following settings:
enabled: true
......@@ -408,7 +408,7 @@ when you [deployed your docker registry](
`s3` storage driver example:
accesskey: 's3-access-key'
......@@ -616,7 +616,7 @@ Before diving in to the following sections, here's some basic troubleshooting:
If you're using a self-signed certificate with your Container Registry, you
might encounter issues during the CI jobs like the following:
Error response from daemon: Get x509: certificate signed by unknown authority
......@@ -666,7 +666,7 @@ Container Registry > Authorization token duration (minutes)**.
When using AWS S3 with the GitLab registry, an error may occur when pushing
large images. Look in the Registry log for the following error:
level=error msg="response completed with error" err.code=unknown err.detail="unexpected EOF" err.message="unknown error"
......@@ -813,7 +813,7 @@ diagnose a problem with the S3 setup.
A user attempted to enable an S3-backed Registry. The `docker login` step went
fine. However, when pushing an image, the output showed:
The push refers to a repository []
dc5e59c14160: Pushing [==================================================>] 14.85 kB
03c20c1a019a: Pushing [==================================================>] 2.048 kB
......@@ -859,27 +859,27 @@ The following installation instructions assume you are running Ubuntu:
Enter <kbd>CTRL</kbd>-<kbd>C</kbd> to quit.
1. Install the certificate from `~/.mitmproxy` to your system:
sudo cp ~/.mitmproxy/mitmproxy-ca-cert.pem /usr/local/share/ca-certificates/mitmproxy-ca-cert.crt
sudo update-ca-certificates
If successful, the output should indicate that a certificate was added:
Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.
To verify that the certificates are properly installed, run:
mitmproxy --port 9000
This will run mitmproxy on port `9000`. In another window, run:
curl --proxy http://localhost:9000
......@@ -892,7 +892,7 @@ For Docker to connect through a proxy, you must start the Docker daemon with the
proper environment variables. The easiest way is to shutdown Docker (e.g. `sudo initctl stop docker`)
and then run Docker by hand. As root, run:
export HTTP_PROXY="http://localhost:9000"
export HTTPS_PROXY="https://localhost:9000"
docker daemon --debug
......@@ -905,7 +905,7 @@ This will launch the Docker daemon and proxy all connections through mitmproxy.
Now that we have mitmproxy and Docker running, we can attempt to login and push
a container image. You may need to run as root to do this. For example:
docker login
docker push
......@@ -54,6 +54,7 @@ description: 'Learn how to contribute to GitLab.'
- [How to dump production data to staging](
- [Working with the GitHub importer](
- [Import/Export development documentation](
- [Test Import Project](
- [Elasticsearch integration docs](
- [Working with Merge Request diffs](
- [Kubernetes integration guidelines](
# Test Import Project
For testing, we can import our own [GitLab CE]( project (named `gitlabhq` in this case) under a group named `qa-perf-testing`. Project tarballs that can be used for testing can be found over on the [performance-data]( project. A different project could be used if required.
There are several options for importing the project into your GitLab environment. They are detailed as follows with the assumption that the recommended group `qa-perf-testing` and project `gitlabhq` are being set up.
## Importing the project
There are several ways to import a project.
### Importing via UI
The first option is to simply [import the Project tarball file via the GitLab UI](../user/project/settings/
1. Create the group `qa-perf-testing`
1. Import the [GitLab FOSS project tarball]( into the Group.
It should take up to 15 minutes for the project to fully import. You can head to the project's main page for the current status.
NOTE: **Note:** This method ignores all the errors silently (including the ones related to `GITALY_DISABLE_REQUEST_LIMITS`) and is used by GitLab's users. For development and testing, check the other methods below.
### Importing via the `import-project` script
A convenient script, [`bin/import-project`](, is provided with [performance]( project to import the Project tarball into a GitLab environment via API from the terminal.
Note that to use the script, it will require some preparation if you haven't done so already:
1. First, set up [`Ruby`]( and [`Ruby Bundler`]( if they aren't already available on the machine.
1. Next, install the required Ruby Gems via Bundler with `bundle install`.
For details how to use `bin/import-project`, run:
bin/import-project --help
The process should take up to 15 minutes for the project to import fully. The script will keep checking periodically for the status and exit once import has completed.
### Importing via GitHub
There is also an option to [import the project via GitHub](../user/project/import/
1. Create the group `qa-perf-testing`
1. Import the GitLab FOSS repository that's [mirrored on GitHub]( into the group via the UI.
This method will take longer to import than the other methods and will depend on several factors. It's recommended to use the other methods.
### Importing via a rake task
[`import.rake`]( was introduced for importing large GitLab project exports.
As part of this script we also disable direct and background upload to avoid situations where a huge archive is being uploaded to GCS (while being inside a transaction, which can cause idle transaction timeouts).
We can simply run this script from the terminal:
bundle exec rake "gitlab:import_export:import[root, root, testingprojectimport, /path/to/file.tar.gz]"
### Importing via the Rails console
The last option is to import a project using a Rails console:
1. Start a Ruby on Rails console:
# Omnibus GitLab
gitlab-rails console
# For installations from source
sudo -u git -H bundle exec rails console RAILS_ENV=production
1. Create a project and run `ProjectTreeRestorer`:
shared_class = do
def error(message)
raise message
user = User.first
shared =
project =, { name: name, namespace: user.namespace }).execute
#Enable Request store
RequestStore.begin! user, shared: shared, project: project).restore
1. In case you need the repository as well, you can restore it using:
repo_path = File.join(shared.export_path, Gitlab::ImportExport.project_bundle_filename) repo_path,
shared: shared,
project: project).restore
We are storing all import failures in the `import_failures` data table.
To make sure that the project import finished without any issues, check:
## Performance testing
For Performance testing, we should:
- Import a quite large project, [`gitlabhq`]( should be a good example.
- Measure the execution time of `ProjectTreeRestorer`.
- Count the number of executed SQL queries during the restore.
- Observe the number of GC cycles happening.
You can use this [snippet](, which will restore the project, and measure the execution time of `ProjectTreeRestorer`, number of SQL queries and number of GC cycles happening.
You can execute the script from the `gdk/gitlab` directory like this:
bundle exec rails r /path_to_sript/script.rb project_name /path_to_extracted_project request_store_enabled
## Troubleshooting
In this section we'll detail any known issues we've seen when trying to import a project and how to manage them.
### Gitaly calls error when importing
If you're attempting to import a large project into a development environment, you may see Gitaly throw an error about too many calls or invocations, for example:
Error importing repository into qa-perf-testing/gitlabhq - GitalyClient#call called 31 times from single request. Potential n+1?
This is due to a [n+1 calls limit being set for development setups]( You can work around this by setting `GITALY_DISABLE_REQUEST_LIMITS=1` as an environment variable, restarting your development environment and importing again.
## Access token setup
Many of the tests also require a GitLab Personal Access Token. This is due to numerous endpoints themselves requiring authentication.
[The official GitLab docs detail how to create this token](../user/profile/ The tests require that the token is generated by an admin user and that it has the `API` and `read_repository` permissions.
Details on how to use the Access Token with each type of test are found in their respective documentation.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment