Commit fe5a7f00 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'ce-to-ee-2018-06-14' into 'master'

CE upstream - 2018-06-14 18:24 UTC

See merge request gitlab-org/gitlab-ee!6144
parents 5f087c0b a94579b0
......@@ -370,10 +370,10 @@ package-and-qa:
<<: *single-script-job
variables:
<<: *single-script-job-variables
SCRIPT_NAME: trigger-build-omnibus
SCRIPT_NAME: trigger-build
retry: 0
script:
- ./$SCRIPT_NAME
- ./$SCRIPT_NAME omnibus
when: manual
only:
- //@gitlab-org/gitlab-ce
......
......@@ -487,7 +487,7 @@ Style/EmptyLiteral:
- 'lib/gitlab/fogbugz_import/importer.rb'
- 'lib/gitlab/git/diff_collection.rb'
- 'lib/gitlab/gitaly_client.rb'
- 'scripts/trigger-build-omnibus'
- 'scripts/trigger-build'
- 'spec/features/merge_requests/versions_spec.rb'
- 'spec/helpers/merge_requests_helper_spec.rb'
- 'spec/lib/gitlab/request_context_spec.rb'
......
......@@ -304,7 +304,7 @@ The UX team uses labels to manage their workflow.
The ~"UX" label on an issue is a signal to the UX team that it will need UX attention.
To better understand the priority by which UX tackles issues, see the [UX section](https://about.gitlab.com/handbook/engineering/ux) of the handbook.
Once an issue has been worked on and is ready for development, a UXer applies the ~"UX ready" label to that issue.
Once an issue has been worked on and is ready for development, a UXer removes the ~"UX" label and applies the ~"UX ready" label to that issue.
The UX team has a special type label called ~"design artifact". This label indicates that the final output
for an issue is a UX solution/design. The solution will be developed by frontend and/or backend in a subsequent milestone.
......
......@@ -20,7 +20,13 @@ export default {
},
},
computed: {
...mapState(['rightPanelCollapsed', 'viewer', 'panelResizing', 'currentActivityView']),
...mapState([
'rightPanelCollapsed',
'viewer',
'panelResizing',
'currentActivityView',
'rightPane',
]),
...mapGetters([
'currentMergeRequest',
'getStagedFile',
......@@ -88,6 +94,9 @@ export default {
this.editor.updateDimensions();
}
},
rightPane() {
this.editor.updateDimensions();
},
},
beforeDestroy() {
this.editor.dispose();
......
......@@ -31,15 +31,16 @@ export const openMergeRequest = ({ commit, dispatch }, { projectPath, id }) => {
commit(rootTypes.CLEAR_PROJECTS, null, { root: true });
commit(rootTypes.SET_CURRENT_MERGE_REQUEST, `${id}`, { root: true });
commit(rootTypes.RESET_OPEN_FILES, null, { root: true });
dispatch('pipelines/resetLatestPipeline', null, { root: true });
dispatch('setCurrentBranchId', '', { root: true });
dispatch('pipelines/stopPipelinePolling', null, { root: true })
.then(() => {
dispatch('pipelines/resetLatestPipeline', null, { root: true });
dispatch('pipelines/clearEtagPoll', null, { root: true });
})
.catch(e => {
throw e;
});
dispatch('setRightPane', null, { root: true });
router.push(`/project/${projectPath}/merge_requests/${id}`);
};
......
......@@ -106,7 +106,9 @@ export const fetchJobTrace = ({ dispatch, state }) => {
.catch(() => dispatch('receiveJobTraceError'));
};
export const resetLatestPipeline = ({ commit }) =>
export const resetLatestPipeline = ({ commit }) => {
commit(types.RECEIVE_LASTEST_PIPELINE_SUCCESS, null);
commit(types.SET_DETAIL_JOB, null);
};
export default () => {};
......@@ -1675,7 +1675,7 @@ export default class Notes {
<div class="note-header">
<div class="note-header-info">
<a href="/${_.escape(currentUsername)}">
<span class="d-none d-sm-block">${_.escape(
<span class="d-none d-sm-inline-block">${_.escape(
currentUsername,
)}</span>
<span class="note-headline-light">${_.escape(
......@@ -1694,7 +1694,7 @@ export default class Notes {
</li>`,
);
$tempNote.find('.d-none.d-sm-block').text(_.escape(currentUserFullname));
$tempNote.find('.d-none.d-sm-inline-block').text(_.escape(currentUserFullname));
$tempNote
.find('.note-headline-light')
.text(`@${_.escape(currentUsername)}`);
......
......@@ -180,7 +180,7 @@ export default class UserTabs {
}
toggleLoading(status) {
return this.$parentEl.find('.loading-status .loading').toggleClass('hidden', !status);
return this.$parentEl.find('.loading-status .loading').toggleClass('hide', !status);
}
setCurrentAction(source) {
......
......@@ -56,7 +56,7 @@ export default {
<gl-modal
:id="`modal-peek-${metric}-details`"
:header-title-text="header"
modal-size="lg"
modal-size="xl"
class="performance-bar-modal"
>
<table
......@@ -71,7 +71,7 @@ export default {
<td
v-for="key in keys"
:key="key"
class="break-word all-words"
class="break-word"
>
{{ item[key] }}
</td>
......
<script>
const buttonVariants = ['danger', 'primary', 'success', 'warning'];
const sizeVariants = ['sm', 'md', 'lg'];
const sizeVariants = ['sm', 'md', 'lg', 'xl'];
export default {
name: 'GlModal',
......
......@@ -54,7 +54,7 @@
<div class="note-header">
<div class="note-header-info">
<a :href="getUserData.path">
<span class="d-none d-sm-block">{{ getUserData.name }}</span>
<span class="d-none d-sm-inline-block">{{ getUserData.name }}</span>
<span class="note-headline-light">@{{ getUserData.username }}</span>
</a>
</div>
......
......@@ -444,10 +444,6 @@ img.emoji {
.break-word {
word-wrap: break-word;
&.all-words {
word-break: break-word;
}
}
/** COMMON CLASSES **/
......
......@@ -19,6 +19,7 @@
.gfm-color_chip {
display: inline-block;
line-height: 1;
margin: 0 0 2px 4px;
vertical-align: middle;
border-radius: 3px;
......
.modal-xl {
max-width: 98%;
}
.modal-header {
background-color: $modal-body-bg;
......
......@@ -868,3 +868,5 @@ $input-border-color: $theme-gray-200;
$input-color: $gl-text-color;
$font-family-sans-serif: $regular_font;
$font-family-monospace: $monospace_font;
$input-line-height: 20px;
$btn-line-height: 20px;
......@@ -220,7 +220,7 @@
.label-link {
display: inline-flex;
vertical-align: top;
vertical-align: text-bottom;
&:hover .color-label {
text-decoration: underline;
......
......@@ -36,6 +36,7 @@
}
.table-holder {
overflow: unset;
width: 100%;
}
......
......@@ -107,12 +107,12 @@
}
.performance-bar-modal {
.modal-footer {
display: none;
.modal-body {
padding: 0;
}
.modal-dialog {
width: 860px;
.modal-footer {
display: none;
}
}
}
......
......@@ -5,4 +5,4 @@
- anchors.each do |anchor|
%li.nav-item
= link_to_if anchor.link, anchor.label, anchor.link, class: anchor.enabled ? 'nav-link stat-link' : "nav-link btn btn-#{anchor.class_modifier || 'missing'}" do
%span.stat-text= anchor.label
.stat-text= anchor.label
......@@ -25,7 +25,7 @@
= custom_icon ('illustration_no_commits')
- else
%ul.merge-request-tabs.nav.nav-tabs.nav-links.no-top.no-bottom
%li.commits-tab.active
%li.commits-tab
= link_to url_for(safe_params), data: {target: 'div#commits', action: 'new', toggle: 'tab'} do
Commits
%span.badge.badge-pill= @commits.size
......
---
title: Line height fixed
merge_request:
author: Murat Dogan
type: fixed
---
title: Fix active tab highlight when creating new merge request
merge_request: 19781
author: Jan Beckmann
type: fixed
---
title: Change label link vertical alignment property
merge_request: 18777
author: George Tsiolis
type: changed
......@@ -300,4 +300,4 @@ Read through the documentation on [LDAP users permissions](../administration/aut
[ce-18994]: https://gitlab.com/gitlab-org/gitlab-ce/issues/18994
[new-mod]: project/new_ci_build_permissions_model.md
[ee-998]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/998
[eep]: https://about.gitlab.com/products/
\ No newline at end of file
[eep]: https://about.gitlab.com/products/
......@@ -41,7 +41,7 @@ module Peek
]
end.sort_by{ |a,b,c,d,e,f| -f }
output = "<div class='modal-dialog modal-lg'><div class='modal-content'>"
output = "<div class='modal-dialog modal-xl'><div class='modal-content'>"
output << "<div class='modal-header'>"
output << "<h4>Line profiling: #{human_description(params[:lineprofiler])}</h4>"
output << "<button class='close' type='button' data-dismiss='modal' aria-label='close'><span aria-hidden='true'>&times;</span></button>"
......
......@@ -4,44 +4,44 @@ require 'net/http'
require 'json'
require 'cgi'
module Omnibus
PROJECT_PATH = 'gitlab-org/omnibus-gitlab'.freeze
module Trigger
OMNIBUS_PROJECT_PATH = 'gitlab-org/omnibus-gitlab'.freeze
CNG_PROJECT_PATH = 'gitlab-org/build/CNG'.freeze
TOKEN = ENV['BUILD_TRIGGER_TOKEN']
class Trigger
TOKEN = ENV['BUILD_TRIGGER_TOKEN']
TRIGGERER = ENV['CI_PROJECT_NAME']
def self.ee?
ENV['CI_PROJECT_NAME'] == 'gitlab-ee' || File.exist?('CHANGELOG-EE.md')
end
class Omnibus
def initialize
@uri = URI("https://gitlab.com/api/v4/projects/#{CGI.escape(Omnibus::PROJECT_PATH)}/trigger/pipeline")
@params = env_params.merge(file_params).merge(token: TOKEN)
@uri = URI("https://gitlab.com/api/v4/projects/#{CGI.escape(Trigger::OMNIBUS_PROJECT_PATH)}/trigger/pipeline")
@params = env_params.merge(file_params).merge(token: Trigger::TOKEN)
end
def invoke!
res = Net::HTTP.post_form(@uri, @params)
id = JSON.parse(res.body)['id']
project = Trigger::OMNIBUS_PROJECT_PATH
if id
puts "Triggered https://gitlab.com/#{Omnibus::PROJECT_PATH}/pipelines/#{id}"
puts "Triggered https://gitlab.com/#{project}/pipelines/#{id}"
puts "Waiting for downstream pipeline status"
else
raise "Trigger failed! The response from the trigger is: #{res.body}"
end
Omnibus::Pipeline.new(id)
Trigger::Pipeline.new(project, id)
end
private
def ee?
TRIGGERER == 'gitlab-ee' || File.exist?('CHANGELOG-EE.md')
end
def env_params
{
"ref" => ENV["OMNIBUS_BRANCH"] || "master",
"variables[GITLAB_VERSION]" => ENV["CI_COMMIT_SHA"],
"variables[ALTERNATIVE_SOURCES]" => true,
"variables[ee]" => ee? ? 'true' : 'false',
"variables[ee]" => Trigger.ee? ? 'true' : 'false',
"variables[TRIGGERED_USER]" => ENV["GITLAB_USER_NAME"],
"variables[TRIGGER_SOURCE]" => "https://gitlab.com/gitlab-org/#{ENV['CI_PROJECT_NAME']}/-/jobs/#{ENV['CI_JOB_ID']}"
}
......@@ -56,13 +56,77 @@ module Omnibus
end
end
class CNG
def initialize
@uri = URI("https://gitlab.com/api/v4/projects/#{CGI.escape(Trigger::CNG_PROJECT_PATH)}/trigger/pipeline")
@ref_name = ENV['CI_COMMIT_REF_NAME']
@username = ENV['GITLAB_USER_NAME']
@project_name = ENV['CI_PROJECT_NAME']
@job_id = ENV['CI_JOB_ID']
@params = env_params.merge(file_params).merge(token: Trigger::TOKEN)
end
#
# Trigger a pipeline
#
def invoke!
res = Net::HTTP.post_form(@uri, @params)
id = JSON.parse(res.body)['id']
project = Trigger::CNG_PROJECT_PATH
if id
puts "Triggered https://gitlab.com/#{project}/pipelines/#{id}"
puts "Waiting for downstream pipeline status"
else
raise "Trigger failed! The response from the trigger is: #{res.body}"
end
Trigger::Pipeline.new(project, id)
end
private
def env_params
params = {
"ref" => ENV["CNG_BRANCH"] || "master",
"variables[TRIGGERED_USER]" => @username,
"variables[TRIGGER_SOURCE]" => "https://gitlab.com/gitlab-org/#{@project_name}/-/jobs/#{@job_id}"
}
if Trigger.ee?
params["variables[GITLAB_EE_VERSION]"] = @ref_name
params["variables[EE_PIPELINE]"] = 'true'
else
params["variables[GITLAB_CE_VERSION]"] = @ref_name
params["variables[CE_PIPELINE]"] = 'true'
end
params
end
# Read version files from all components
def file_params
Dir.glob("*_VERSION").each_with_object({}) do |version_file, params|
raw_version = File.read(version_file).strip
# if the version matches semver format, treat it as a tag and prepend `v`
version = if raw_version =~ Regexp.compile(/^\d+\.\d+\.\d+(-rc\d+)?(-ee)?$/)
"v#{raw_version}"
else
raw_version
end
params["variables[#{version_file}]"] = version
end
end
end
class Pipeline
INTERVAL = 60 # seconds
MAX_DURATION = 3600 * 3 # 3 hours
def initialize(id)
def initialize(project, id)
@start = Time.now.to_i
@uri = URI("https://gitlab.com/api/v4/projects/#{CGI.escape(Omnibus::PROJECT_PATH)}/pipelines/#{id}")
@uri = URI("https://gitlab.com/api/v4/projects/#{CGI.escape(project)}/pipelines/#{id}")
end
def wait!
......@@ -74,10 +138,10 @@ module Omnibus
print "."
sleep INTERVAL
when :success
puts "Omnibus pipeline succeeded in #{duration} minutes!"
puts "Pipeline succeeded in #{duration} minutes!"
break
else
raise "Omnibus pipeline did not succeed!"
raise "Pipeline did not succeed!"
end
STDOUT.flush
......@@ -105,4 +169,13 @@ module Omnibus
end
end
Omnibus::Trigger.new.invoke!.wait!
case ARGV[0]
when 'omnibus'
Trigger::Omnibus.new.invoke!.wait!
when 'cng'
Trigger::CNG.new.invoke!.wait!
else
puts "Please provide a valid option:
omnibus - Triggers a pipeline that builds the omnibus-gitlab package
cng - Triggers a pipeline that builds images used by the GitLab helm chart"
end
#!/usr/bin/env ruby
require 'gitlab'
#
# Configure credentials to be used with gitlab gem
#
Gitlab.configure do |config|
config.endpoint = 'https://gitlab.com/api/v4'
end
#
# The remote project
#
GITLAB_CNG_REPO = 'gitlab-org/build/CNG'.freeze
def ee?
ENV['CI_PROJECT_NAME'] == 'gitlab-ee' || File.exist?('CHANGELOG-EE.md')
end
def read_file_version(filename)
raw_version = File.read(filename).strip
# if the version matches semver format, treat it as a tag and prepend `v`
if raw_version =~ Regexp.compile(/^\d+\.\d+\.\d+(-rc\d+)?(-ee)?$/)
"v#{raw_version}"
else
raw_version
end
end
def params
params = {
'GITLAB_SHELL_VERSION' => read_file_version('GITLAB_SHELL_VERSION'),
'GITALY_VERSION' => read_file_version('GITALY_SERVER_VERSION'),
'TRIGGERED_USER' => ENV['GITLAB_USER_NAME'],
'TRIGGER_SOURCE' => "https://gitlab.com/gitlab-org/#{ENV['CI_PROJECT_NAME']}/-/jobs/#{ENV['CI_JOB_ID']}"
}
if ee?
params['EE_PIPELINE'] = 'true'
params['GITLAB_EE_VERSION'] = ENV['CI_COMMIT_REF_NAME']
else
params['CE_PIPELINE'] = 'true'
params['GITLAB_CE_VERSION'] = ENV['CI_COMMIT_REF_NAME']
end
params
end
#
# Trigger a pipeline
#
def trigger_pipeline
# Create the cross project pipeline using CI_JOB_TOKEN
pipeline = Gitlab.run_trigger(GITLAB_CNG_REPO, ENV['CI_JOB_TOKEN'], 'master', params)
puts "Triggered https://gitlab.com/#{GITLAB_CNG_REPO}/pipelines/#{pipeline.id}"
end
trigger_pipeline
......@@ -315,6 +315,17 @@ describe('RepoEditor', () => {
done();
});
});
it('calls updateDimensions when rightPane is updated', done => {
vm.$store.state.rightPane = 'testing';
vm.$nextTick(() => {
expect(vm.editor.updateDimensions).toHaveBeenCalled();
expect(vm.editor.updateDiffView).toHaveBeenCalled();
done();
});
});
});
describe('show tabs', () => {
......
......@@ -208,18 +208,19 @@ describe('IDE merge requests actions', () => {
expect(commit.calls.argsFor(1)).toEqual(['SET_CURRENT_MERGE_REQUEST', '1', { root: true }]);
expect(commit.calls.argsFor(2)).toEqual(['RESET_OPEN_FILES', null, { root: true }]);
expect(dispatch.calls.argsFor(0)).toEqual([
'pipelines/resetLatestPipeline',
expect(dispatch.calls.argsFor(0)).toEqual(['setCurrentBranchId', '', { root: true }]);
expect(dispatch.calls.argsFor(1)).toEqual([
'pipelines/stopPipelinePolling',
null,
{ root: true },
]);
expect(dispatch.calls.argsFor(1)).toEqual(['setCurrentBranchId', '', { root: true }]);
expect(dispatch.calls.argsFor(2)).toEqual([
'pipelines/stopPipelinePolling',
expect(dispatch.calls.argsFor(2)).toEqual(['setRightPane', null, { root: true }]);
expect(dispatch.calls.argsFor(3)).toEqual([
'pipelines/resetLatestPipeline',
null,
{ root: true },
]);
expect(dispatch.calls.argsFor(3)).toEqual([
expect(dispatch.calls.argsFor(4)).toEqual([
'pipelines/clearEtagPoll',
null,
{ root: true },
......
......@@ -18,6 +18,7 @@ import actions, {
receiveJobTraceError,
receiveJobTraceSuccess,
fetchJobTrace,
resetLatestPipeline,
} from '~/ide/stores/modules/pipelines/actions';
import state from '~/ide/stores/modules/pipelines/state';
import * as types from '~/ide/stores/modules/pipelines/mutation_types';
......@@ -416,4 +417,20 @@ describe('IDE pipelines actions', () => {
});
});
});
describe('resetLatestPipeline', () => {
it('commits reset mutations', done => {
testAction(
resetLatestPipeline,
null,
mockedState,
[
{ type: types.RECEIVE_LASTEST_PIPELINE_SUCCESS, payload: null },
{ type: types.SET_DETAIL_JOB, payload: null },
],
[],
done,
);
});
});
});
......@@ -974,7 +974,7 @@ import timeoutPromise from './helpers/set_timeout_promise_helper';
).toBeFalsy();
expect(
$tempNoteHeader
.find('.d-none.d-sm-block')
.find('.d-none.d-sm-inline-block')
.text()
.trim(),
).toEqual(currentUserFullname);
......@@ -1020,7 +1020,7 @@ import timeoutPromise from './helpers/set_timeout_promise_helper';
const $tempNoteHeader = $tempNote.find('.note-header');
expect(
$tempNoteHeader
.find('.d-none.d-sm-block')
.find('.d-none.d-sm-inline-block')
.text()
.trim(),
).toEqual('Foo &lt;script&gt;alert(&quot;XSS&quot;)&lt;/script&gt;');
......
......@@ -208,6 +208,14 @@ describe('GlModal', () => {
expect(vm.$el.querySelector('.modal-dialog').classList.contains('modal-lg')).toEqual(true);
});
it('should render modal-xl', () => {
vm = mountComponent(modalComponent, {
modalSize: 'xl',
});
expect(vm.$el.querySelector('.modal-dialog').classList.contains('modal-xl')).toEqual(true);
});
it('should not add modal size classes when md size is passed', () => {
vm = mountComponent(modalComponent, {
modalSize: 'md',
......
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