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

Add latest changes from gitlab-org/gitlab@master

parent 15a2d004
No related branches found
No related tags found
No related merge requests found
Showing
with 293 additions and 82 deletions
---
title: Fix serverless function descriptions not showing on Knative 0.7
merge_request: 18973
author:
type: fixed
---
title: Save dashboard changes by the user into the vuex store
merge_request: 18862
author:
type: changed
---
title: Add ability to select a Cluster management project
merge_request: 18928
author:
type: added
---
title: Dependency Scanning template that doesn't rely on Docker-in-Docker
merge_request:
author:
type: other
Loading
Loading
@@ -433,6 +433,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
 
Gitlab.ee do
get :logs
get '/pods/(:pod_name)/containers/(:container_name)/logs', to: 'environments#k8s_pod_logs', as: :k8s_pod_logs
end
end
 
Loading
Loading
Loading
Loading
@@ -473,6 +473,14 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
| `cherryPickOnCurrentMergeRequest` | Boolean! | Whether or not a user can perform `cherry_pick_on_current_merge_request` on this resource |
| `revertOnCurrentMergeRequest` | Boolean! | Whether or not a user can perform `revert_on_current_merge_request` on this resource |
 
### MergeRequestSetMilestonePayload
| Name | Type | Description |
| --- | ---- | ---------- |
| `clientMutationId` | String | A unique identifier for the client performing the mutation. |
| `errors` | String! => Array | Reasons why the mutation failed. |
| `mergeRequest` | MergeRequest | The merge request after mutation |
### MergeRequestSetWipPayload
 
| Name | Type | Description |
Loading
Loading
@@ -492,6 +500,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
 
| Name | Type | Description |
| --- | ---- | ---------- |
| `id` | ID! | ID of the milestone |
| `description` | String | Description of the milestone |
| `title` | String! | Title of the milestone |
| `state` | String! | State of the milestone |
Loading
Loading
Loading
Loading
@@ -4,6 +4,12 @@
# List of the variables: https://gitlab.com/gitlab-org/security-products/dependency-scanning#settings
# How to set: https://docs.gitlab.com/ee/ci/yaml/#variables
 
variables:
DS_ANALYZER_IMAGE_PREFIX: "registry.gitlab.com/gitlab-org/security-products/analyzers"
DS_DEFAULT_ANALYZERS: "gemnasium, retire.js, gemnasium-python, gemnasium-maven, bundler-audit"
DS_MAJOR_VERSION: 2
DS_DISABLE_DIND: "false"
dependency_scanning:
stage: test
image: docker:stable
Loading
Loading
@@ -61,3 +67,63 @@ dependency_scanning:
except:
variables:
- $DEPENDENCY_SCANNING_DISABLED
- $DS_DISABLE_DIND == 'true'
.analyzer:
extends: dependency_scanning
services: []
except:
variables:
- $DS_DISABLE_DIND == 'false'
script:
- /analyzer run
gemnasium-dependency_scanning:
extends: .analyzer
image:
name: "$DS_ANALYZER_IMAGE_PREFIX/gemnasium:$DS_MAJOR_VERSION"
only:
variables:
- $GITLAB_FEATURES =~ /\bdependency_scanning\b/ &&
$DS_DEFAULT_ANALYZERS =~ /gemnasium/ &&
$CI_PROJECT_REPOSITORY_LANGUAGES =~ /ruby|javascript|php/
gemnasium-maven-dependency_scanning:
extends: .analyzer
image:
name: "$DS_ANALYZER_IMAGE_PREFIX/gemnasium-maven:$DS_MAJOR_VERSION"
only:
variables:
- $GITLAB_FEATURES =~ /\bdependency_scanning\b/ &&
$DS_DEFAULT_ANALYZERS =~ /gemnasium-maven/ &&
$CI_PROJECT_REPOSITORY_LANGUAGES =~ /\bjava\b/
gemnasium-python-dependency_scanning:
extends: .analyzer
image:
name: "$DS_ANALYZER_IMAGE_PREFIX/gemnasium-python:$DS_MAJOR_VERSION"
only:
variables:
- $GITLAB_FEATURES =~ /\bdependency_scanning\b/ &&
$DS_DEFAULT_ANALYZERS =~ /gemnasium-python/ &&
$CI_PROJECT_REPOSITORY_LANGUAGES =~ /python/
bundler-audit-dependency_scanning:
extends: .analyzer
image:
name: "$DS_ANALYZER_IMAGE_PREFIX/bundler-audit:$DS_MAJOR_VERSION"
only:
variables:
- $GITLAB_FEATURES =~ /\bdependency_scanning\b/ &&
$DS_DEFAULT_ANALYZERS =~ /bundler-audit/ &&
$CI_PROJECT_REPOSITORY_LANGUAGES =~ /ruby/
retire-js-dependency_scanning:
extends: .analyzer
image:
name: "$DS_ANALYZER_IMAGE_PREFIX/retire.js:$DS_MAJOR_VERSION"
only:
variables:
- $GITLAB_FEATURES =~ /\bdependency_scanning\b/ &&
$DS_DEFAULT_ANALYZERS =~ /retire.js/ &&
$CI_PROJECT_REPOSITORY_LANGUAGES =~ /javascript/
Loading
Loading
@@ -176,19 +176,11 @@ module Gitlab
end
 
def prometheus_enabled?
Gitlab.config.prometheus.enable if Gitlab.config.prometheus
rescue Settingslogic::MissingSetting
log_error('prometheus.enable is not present in config/gitlab.yml')
false
::Gitlab::Prometheus::Internal.prometheus_enabled?
end
 
def prometheus_listen_address
Gitlab.config.prometheus.listen_address.to_s if Gitlab.config.prometheus
rescue Settingslogic::MissingSetting
log_error('Prometheus listen_address is not present in config/gitlab.yml')
nil
::Gitlab::Prometheus::Internal.listen_address
end
 
def instance_admins
Loading
Loading
@@ -231,23 +223,7 @@ module Gitlab
end
 
def internal_prometheus_listen_address_uri
if prometheus_listen_address.starts_with?('0.0.0.0:')
# 0.0.0.0:9090
port = ':' + prometheus_listen_address.split(':').second
'http://localhost' + port
elsif prometheus_listen_address.starts_with?(':')
# :9090
'http://localhost' + prometheus_listen_address
elsif prometheus_listen_address.starts_with?('http')
# https://localhost:9090
prometheus_listen_address
else
# localhost:9090
'http://' + prometheus_listen_address
end
::Gitlab::Prometheus::Internal.uri
end
 
def prometheus_service_attributes
Loading
Loading
Loading
Loading
@@ -3,8 +3,6 @@
module Gitlab
module EtagCaching
class Router
prepend_if_ee('EE::Gitlab::EtagCaching::Router') # rubocop: disable Cop/InjectEnterpriseEditionModule
Route = Struct.new(:regexp, :name)
# We enable an ETag for every request matching the regex.
# To match a regex the path needs to match the following:
Loading
Loading
@@ -80,3 +78,5 @@ module Gitlab
end
end
end
Gitlab::EtagCaching::Router.prepend_if_ee('EE::Gitlab::EtagCaching::Router')
# frozen_string_literal: true
module Gitlab
module Prometheus
class Internal
def self.uri
return if listen_address.blank?
if listen_address.starts_with?('0.0.0.0:')
# 0.0.0.0:9090
port = ':' + listen_address.split(':').second
'http://localhost' + port
elsif listen_address.starts_with?(':')
# :9090
'http://localhost' + listen_address
elsif listen_address.starts_with?('http')
# https://localhost:9090
listen_address
else
# localhost:9090
'http://' + listen_address
end
end
def self.listen_address
Gitlab.config.prometheus.listen_address.to_s if Gitlab.config.prometheus
rescue Settingslogic::MissingSetting
Gitlab::AppLogger.error('Prometheus listen_address is not present in config/gitlab.yml')
nil
end
def self.prometheus_enabled?
Gitlab.config.prometheus.enable if Gitlab.config.prometheus
rescue Settingslogic::MissingSetting
Gitlab::AppLogger.error('prometheus.enable is not present in config/gitlab.yml')
false
end
end
end
end
Loading
Loading
@@ -3399,6 +3399,9 @@ msgstr ""
msgid "ClusterIntegration|%{title} updated successfully."
msgstr ""
 
msgid "ClusterIntegration|A cluster management project can be used to run deployment jobs with Kubernetes <code>cluster-admin</code> privileges."
msgstr ""
msgid "ClusterIntegration|A service token scoped to %{code}kube-system%{end_code} with %{code}cluster-admin%{end_code} privileges."
msgstr ""
 
Loading
Loading
@@ -3507,6 +3510,9 @@ msgstr ""
msgid "ClusterIntegration|Cluster health"
msgstr ""
 
msgid "ClusterIntegration|Cluster management project (alpha)"
msgstr ""
msgid "ClusterIntegration|Cluster name is required."
msgstr ""
 
Loading
Loading
@@ -15587,6 +15593,9 @@ msgstr ""
msgid "Something went wrong while fetching latest comments."
msgstr ""
 
msgid "Something went wrong while fetching projects"
msgstr ""
msgid "Something went wrong while fetching related merge requests."
msgstr ""
 
Loading
Loading
# frozen_string_literal: true
 
module QA
context 'Create' do
# Failure issue: https://gitlab.com/gitlab-org/gitlab/issues/34551
context 'Create', :quarantine do
describe 'File templates' do
include Runtime::Fixtures
 
Loading
Loading
# frozen_string_literal: true
 
module QA
context 'Create' do
# Failure issue: https://gitlab.com/gitlab-org/gitlab/issues/34551
context 'Create', :quarantine do
describe 'Web IDE file templates' do
include Runtime::Fixtures
 
Loading
Loading
Loading
Loading
@@ -13,6 +13,10 @@ describe Projects::Serverless::FunctionsController do
let(:environment) { create(:environment, project: project) }
let!(:deployment) { create(:deployment, :success, environment: environment, cluster: cluster) }
let(:knative_services_finder) { environment.knative_services_finder }
let(:function_description) { 'A serverless function' }
let(:knative_stub_options) do
{ namespace: namespace.namespace, name: cluster.project.name, description: function_description }
end
 
let(:namespace) do
create(:cluster_kubernetes_namespace,
Loading
Loading
@@ -114,40 +118,33 @@ describe Projects::Serverless::FunctionsController do
expect(response).to have_gitlab_http_status(200)
 
expect(json_response).to include(
"name" => project.name,
"url" => "http://#{project.name}.#{namespace.namespace}.example.com",
"podcount" => 1
'name' => project.name,
'url' => "http://#{project.name}.#{namespace.namespace}.example.com",
'description' => function_description,
'podcount' => 1
)
end
end
 
context 'on Knative 0.5' do
context 'on Knative 0.5.0' do
before do
prepare_knative_stubs(knative_05_service(knative_stub_options))
end
include_examples 'GET #show with valid data'
end
context 'on Knative 0.6.0' do
before do
stub_kubeclient_service_pods
stub_reactive_cache(knative_services_finder,
{
services: kube_knative_services_body(
legacy_knative: true,
namespace: namespace.namespace,
name: cluster.project.name
)["items"],
pods: kube_knative_pods_body(cluster.project.name, namespace.namespace)["items"]
},
*knative_services_finder.cache_args)
prepare_knative_stubs(knative_06_service(knative_stub_options))
end
 
include_examples 'GET #show with valid data'
end
 
context 'on Knative 0.6 or 0.7' do
context 'on Knative 0.7.0' do
before do
stub_kubeclient_service_pods
stub_reactive_cache(knative_services_finder,
{
services: kube_knative_services_body(namespace: namespace.namespace, name: cluster.project.name)["items"],
pods: kube_knative_pods_body(cluster.project.name, namespace.namespace)["items"]
},
*knative_services_finder.cache_args)
prepare_knative_stubs(knative_07_service(knative_stub_options))
end
 
include_examples 'GET #show with valid data'
Loading
Loading
@@ -172,11 +169,12 @@ describe Projects::Serverless::FunctionsController do
expect(response).to have_gitlab_http_status(200)
 
expect(json_response).to match({
"knative_installed" => "checking",
"functions" => [
'knative_installed' => 'checking',
'functions' => [
a_hash_including(
"name" => project.name,
"url" => "http://#{project.name}.#{namespace.namespace}.example.com"
'name' => project.name,
'url' => "http://#{project.name}.#{namespace.namespace}.example.com",
'description' => function_description
)
]
})
Loading
Loading
@@ -189,36 +187,38 @@ describe Projects::Serverless::FunctionsController do
end
end
 
context 'on Knative 0.5' do
context 'on Knative 0.5.0' do
before do
stub_kubeclient_service_pods
stub_reactive_cache(knative_services_finder,
{
services: kube_knative_services_body(
legacy_knative: true,
namespace: namespace.namespace,
name: cluster.project.name
)["items"],
pods: kube_knative_pods_body(cluster.project.name, namespace.namespace)["items"]
},
*knative_services_finder.cache_args)
prepare_knative_stubs(knative_05_service(knative_stub_options))
end
 
include_examples 'GET #index with data'
end
 
context 'on Knative 0.6 or 0.7' do
context 'on Knative 0.6.0' do
before do
stub_kubeclient_service_pods
stub_reactive_cache(knative_services_finder,
{
services: kube_knative_services_body(namespace: namespace.namespace, name: cluster.project.name)["items"],
pods: kube_knative_pods_body(cluster.project.name, namespace.namespace)["items"]
},
*knative_services_finder.cache_args)
prepare_knative_stubs(knative_06_service(knative_stub_options))
end
 
include_examples 'GET #index with data'
end
context 'on Knative 0.7.0' do
before do
prepare_knative_stubs(knative_07_service(knative_stub_options))
end
include_examples 'GET #index with data'
end
end
def prepare_knative_stubs(knative_service)
stub_kubeclient_service_pods
stub_reactive_cache(knative_services_finder,
{
services: [knative_service],
pods: kube_knative_pods_body(cluster.project.name, namespace.namespace)["items"]
},
*knative_services_finder.cache_args)
end
end
Loading
Loading
@@ -467,6 +467,26 @@ describe('Api', () => {
});
});
 
describe('user projects', () => {
it('fetches all projects that belong to a particular user', done => {
const query = 'dummy query';
const options = { unused: 'option' };
const userId = '123456';
const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/users/${userId}/projects`;
mock.onGet(expectedUrl).reply(200, [
{
name: 'test',
},
]);
Api.userProjects(userId, query, options, response => {
expect(response.length).toBe(1);
expect(response[0].name).toBe('test');
done();
});
});
});
describe('commitPipelines', () => {
it('fetches pipelines for a given commit', done => {
const projectId = 'example/foobar';
Loading
Loading
Loading
Loading
@@ -10,8 +10,10 @@ import axios from '~/lib/utils/axios_utils';
import { loadHTMLFixture } from 'helpers/fixtures';
import { setTestTimeout } from 'helpers/timeout';
import $ from 'jquery';
import initProjectSelectDropdown from '~/project_select';
 
jest.mock('~/lib/utils/poll');
jest.mock('~/project_select');
 
const { INSTALLING, INSTALLABLE, INSTALLED, UNINSTALLING } = APPLICATION_STATUS;
 
Loading
Loading
@@ -44,6 +46,7 @@ describe('Clusters', () => {
afterEach(() => {
cluster.destroy();
mock.restore();
jest.clearAllMocks();
});
 
describe('class constructor', () => {
Loading
Loading
@@ -55,6 +58,10 @@ describe('Clusters', () => {
it('should call initPolling on construct', () => {
expect(cluster.initPolling).toHaveBeenCalled();
});
it('should call initProjectSelectDropdown on construct', () => {
expect(initProjectSelectDropdown).toHaveBeenCalled();
});
});
 
describe('toggle', () => {
Loading
Loading
Loading
Loading
@@ -2,7 +2,8 @@
class="js-kubernetes-logs"
data-current-environment-name="production"
data-environments-path="/root/my-project/environments.json"
data-logs-endpoint="/root/my-project/environments/1/logs.json"
data-project-full-path="root/my-project"
data-environment-id=1
>
<div class="build-page-pod-logs">
<div class="build-trace-container prepend-top-default">
Loading
Loading
Loading
Loading
@@ -61,8 +61,8 @@ describe('Embed', () => {
 
describe('metrics are available', () => {
beforeEach(() => {
store.state.monitoringDashboard.groups = groups;
store.state.monitoringDashboard.groups[0].metrics = metricsData;
store.state.monitoringDashboard.dashboard.panel_groups = groups;
store.state.monitoringDashboard.dashboard.panel_groups[0].metrics = metricsData;
store.state.monitoringDashboard.metricsWithData = metricsWithData;
 
mountComponent();
Loading
Loading
Loading
Loading
@@ -81,7 +81,9 @@ export const metricsData = [
 
export const initialState = {
monitoringDashboard: {},
groups: [],
dashboard: {
panel_groups: [],
},
metricsWithData: [],
useDashboardEndpoint: true,
};
# frozen_string_literal: true
require 'spec_helper'
describe Mutations::MergeRequests::SetMilestone do
let(:merge_request) { create(:merge_request) }
let(:user) { create(:user) }
subject(:mutation) { described_class.new(object: nil, context: { current_user: user }) }
describe '#resolve' do
let(:milestone) { create(:milestone, project: merge_request.project) }
let(:mutated_merge_request) { subject[:merge_request] }
subject { mutation.resolve(project_path: merge_request.project.full_path, iid: merge_request.iid, milestone: milestone) }
it 'raises an error if the resource is not accessible to the user' do
expect { subject }.to raise_error(Gitlab::Graphql::Errors::ResourceNotAvailable)
end
context 'when the user can update the merge request' do
before do
merge_request.project.add_developer(user)
end
it 'returns the merge request with the milestone' do
expect(mutated_merge_request).to eq(merge_request)
expect(mutated_merge_request.milestone).to eq(milestone)
expect(subject[:errors]).to be_empty
end
it 'returns errors merge request could not be updated' do
# Make the merge request invalid
merge_request.allow_broken = true
merge_request.update!(source_project: nil)
expect(subject[:errors]).not_to be_empty
end
context 'when passing milestone_id as nil' do
let(:milestone) { nil }
it 'removes the milestone' do
merge_request.update!(milestone: create(:milestone, project: merge_request.project))
expect(mutated_merge_request.milestone).to eq(nil)
end
it 'does not do anything if the MR already does not have a milestone' do
expect(mutated_merge_request.milestone).to eq(nil)
end
end
end
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