Commit 5ee0773b authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-04-14

# Conflicts:
#	Gemfile.lock

[ci skip]
parents e1cff4bb 160f1fd2
...@@ -850,7 +850,7 @@ codequality: ...@@ -850,7 +850,7 @@ codequality:
tags: [] tags: []
before_script: [] before_script: []
services: services:
- docker:dind - docker:stable-dind
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
......
...@@ -1103,7 +1103,10 @@ DEPENDENCIES ...@@ -1103,7 +1103,10 @@ DEPENDENCIES
gitlab-flowdock-git-hook (~> 1.0.1) gitlab-flowdock-git-hook (~> 1.0.1)
gitlab-gollum-lib (~> 4.2) gitlab-gollum-lib (~> 4.2)
gitlab-gollum-rugged_adapter (~> 0.4.4) gitlab-gollum-rugged_adapter (~> 0.4.4)
<<<<<<< HEAD
gitlab-license (~> 1.0) gitlab-license (~> 1.0)
=======
>>>>>>> upstream/master
gitlab-markup (~> 1.6.2) gitlab-markup (~> 1.6.2)
gitlab-styles (~> 2.3) gitlab-styles (~> 2.3)
gitlab_omniauth-ldap (~> 2.0.4) gitlab_omniauth-ldap (~> 2.0.4)
......
...@@ -37,9 +37,9 @@ export const setLastCommitMessage = ({ rootState, commit }, data) => { ...@@ -37,9 +37,9 @@ export const setLastCommitMessage = ({ rootState, commit }, data) => {
const commitMsg = sprintf( const commitMsg = sprintf(
__('Your changes have been committed. Commit %{commitId} %{commitStats}'), __('Your changes have been committed. Commit %{commitId} %{commitStats}'),
{ {
commitId: `<a href="${currentProject.web_url}/commit/${ commitId: `<a href="${currentProject.web_url}/commit/${data.short_id}" class="commit-sha">${
data.short_id data.short_id
}" class="commit-sha">${data.short_id}</a>`, }</a>`,
commitStats, commitStats,
}, },
false, false,
...@@ -54,9 +54,7 @@ export const checkCommitStatus = ({ rootState }) => ...@@ -54,9 +54,7 @@ export const checkCommitStatus = ({ rootState }) =>
.then(({ data }) => { .then(({ data }) => {
const { id } = data.commit; const { id } = data.commit;
const selectedBranch = const selectedBranch =
rootState.projects[rootState.currentProjectId].branches[ rootState.projects[rootState.currentProjectId].branches[rootState.currentBranchId];
rootState.currentBranchId
];
if (selectedBranch.workingReference !== id) { if (selectedBranch.workingReference !== id) {
return true; return true;
...@@ -135,32 +133,15 @@ export const updateFilesAfterCommit = ( ...@@ -135,32 +133,15 @@ export const updateFilesAfterCommit = (
if (state.commitAction === consts.COMMIT_TO_NEW_BRANCH) { if (state.commitAction === consts.COMMIT_TO_NEW_BRANCH) {
router.push( router.push(
`/project/${rootState.currentProjectId}/blob/${branch}/${ `/project/${rootState.currentProjectId}/blob/${branch}/${rootGetters.activeFile.path}`,
rootGetters.activeFile.path
}`,
); );
} }
dispatch('updateCommitAction', consts.COMMIT_TO_CURRENT_BRANCH);
}; };
export const commitChanges = ({ export const commitChanges = ({ commit, state, getters, dispatch, rootState }) => {
commit,
state,
getters,
dispatch,
rootState,
}) => {
const newBranch = state.commitAction !== consts.COMMIT_TO_CURRENT_BRANCH; const newBranch = state.commitAction !== consts.COMMIT_TO_CURRENT_BRANCH;
const payload = createCommitPayload( const payload = createCommitPayload(getters.branchName, newBranch, state, rootState);
getters.branchName, const getCommitStatus = newBranch ? Promise.resolve(false) : dispatch('checkCommitStatus');
newBranch,
state,
rootState,
);
const getCommitStatus = newBranch
? Promise.resolve(false)
: dispatch('checkCommitStatus');
commit(types.UPDATE_LOADING, true); commit(types.UPDATE_LOADING, true);
...@@ -182,12 +163,16 @@ export const commitChanges = ({ ...@@ -182,12 +163,16 @@ export const commitChanges = ({
if (!data.short_id) { if (!data.short_id) {
flash(data.message, 'alert', document, null, false, true); flash(data.message, 'alert', document, null, false, true);
return; return null;
} }
dispatch('setLastCommitMessage', data); dispatch('setLastCommitMessage', data);
dispatch('updateCommitMessage', ''); dispatch('updateCommitMessage', '');
return dispatch('updateFilesAfterCommit', {
data,
branch: getters.branchName,
})
.then(() => {
if (state.commitAction === consts.COMMIT_TO_NEW_BRANCH_MR) { if (state.commitAction === consts.COMMIT_TO_NEW_BRANCH_MR) {
dispatch( dispatch(
'redirectToUrl', 'redirectToUrl',
...@@ -198,13 +183,10 @@ export const commitChanges = ({ ...@@ -198,13 +183,10 @@ export const commitChanges = ({
), ),
{ root: true }, { root: true },
); );
} else {
dispatch('updateFilesAfterCommit', {
data,
branch: getters.branchName,
});
} }
}) })
.then(() => dispatch('updateCommitAction', consts.COMMIT_TO_CURRENT_BRANCH));
})
.catch(err => { .catch(err => {
let errMsg = __('Error committing changes. Please try again.'); let errMsg = __('Error committing changes. Please try again.');
if (err.response.data && err.response.data.message) { if (err.response.data && err.response.data.message) {
......
...@@ -146,8 +146,8 @@ export default { ...@@ -146,8 +146,8 @@ export default {
</p> </p>
<p <p
v-if="shouldShowMemoryGraph" v-if="shouldShowMemoryGraph"
class="usage-info js-usage-info"> class="usage-info js-usage-info"
{{ memoryChangeMessage }} v-html="memoryChangeMessage">
</p> </p>
<p <p
v-if="shouldShowLoadFailure" v-if="shouldShowLoadFailure"
......
---
title: Replacing gollum libraries for gitlab custom libs
merge_request: 18343
author:
type: other
---
title: Removed alert box in IDE when redirecting to new merge request
merge_request:
author:
type: fixed
...@@ -101,12 +101,12 @@ In order to do that, follow the steps: ...@@ -101,12 +101,12 @@ In order to do that, follow the steps:
--registration-token REGISTRATION_TOKEN \ --registration-token REGISTRATION_TOKEN \
--executor docker \ --executor docker \
--description "My Docker Runner" \ --description "My Docker Runner" \
--docker-image "docker:latest" \ --docker-image "docker:stable" \
--docker-privileged --docker-privileged
``` ```
The above command will register a new Runner to use the special The above command will register a new Runner to use the special
`docker:latest` image which is provided by Docker. **Notice that it's using `docker:stable` image which is provided by Docker. **Notice that it's using
the `privileged` mode to start the build and service containers.** If you the `privileged` mode to start the build and service containers.** If you
want to use [docker-in-docker] mode, you always have to use `privileged = true` want to use [docker-in-docker] mode, you always have to use `privileged = true`
in your Docker containers. in your Docker containers.
...@@ -120,7 +120,7 @@ In order to do that, follow the steps: ...@@ -120,7 +120,7 @@ In order to do that, follow the steps:
executor = "docker" executor = "docker"
[runners.docker] [runners.docker]
tls_verify = false tls_verify = false
image = "docker:latest" image = "docker:stable"
privileged = true privileged = true
disable_cache = false disable_cache = false
volumes = ["/cache"] volumes = ["/cache"]
...@@ -132,7 +132,7 @@ In order to do that, follow the steps: ...@@ -132,7 +132,7 @@ In order to do that, follow the steps:
`docker:dind` service): `docker:dind` service):
```yaml ```yaml
image: docker:latest image: docker:stable
# When using dind, it's wise to use the overlayfs driver for # When using dind, it's wise to use the overlayfs driver for
# improved performance. # improved performance.
...@@ -201,12 +201,12 @@ In order to do that, follow the steps: ...@@ -201,12 +201,12 @@ In order to do that, follow the steps:
--registration-token REGISTRATION_TOKEN \ --registration-token REGISTRATION_TOKEN \
--executor docker \ --executor docker \
--description "My Docker Runner" \ --description "My Docker Runner" \
--docker-image "docker:latest" \ --docker-image "docker:stable" \
--docker-volumes /var/run/docker.sock:/var/run/docker.sock --docker-volumes /var/run/docker.sock:/var/run/docker.sock
``` ```
The above command will register a new Runner to use the special The above command will register a new Runner to use the special
`docker:latest` image which is provided by Docker. **Notice that it's using `docker:stable` image which is provided by Docker. **Notice that it's using
the Docker daemon of the Runner itself, and any containers spawned by docker the Docker daemon of the Runner itself, and any containers spawned by docker
commands will be siblings of the Runner rather than children of the runner.** commands will be siblings of the Runner rather than children of the runner.**
This may have complications and limitations that are unsuitable for your workflow. This may have complications and limitations that are unsuitable for your workflow.
...@@ -220,7 +220,7 @@ In order to do that, follow the steps: ...@@ -220,7 +220,7 @@ In order to do that, follow the steps:
executor = "docker" executor = "docker"
[runners.docker] [runners.docker]
tls_verify = false tls_verify = false
image = "docker:latest" image = "docker:stable"
privileged = false privileged = false
disable_cache = false disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"] volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
...@@ -232,7 +232,7 @@ In order to do that, follow the steps: ...@@ -232,7 +232,7 @@ In order to do that, follow the steps:
include the `docker:dind` service as when using the Docker in Docker executor): include the `docker:dind` service as when using the Docker in Docker executor):
```yaml ```yaml
image: docker:latest image: docker:stable
before_script: before_script:
- docker info - docker info
...@@ -286,7 +286,7 @@ any image that's used with the `--cache-from` argument must first be pulled ...@@ -286,7 +286,7 @@ any image that's used with the `--cache-from` argument must first be pulled
Here's a simple `.gitlab-ci.yml` file showing how Docker caching can be utilized: Here's a simple `.gitlab-ci.yml` file showing how Docker caching can be utilized:
```yaml ```yaml
image: docker:latest image: docker:stable
services: services:
- docker:dind - docker:dind
...@@ -388,7 +388,7 @@ could look like: ...@@ -388,7 +388,7 @@ could look like:
```yaml ```yaml
build: build:
image: docker:latest image: docker:stable
services: services:
- docker:dind - docker:dind
stage: build stage: build
...@@ -434,7 +434,7 @@ when needed. Changes to `master` also get tagged as `latest` and deployed using ...@@ -434,7 +434,7 @@ when needed. Changes to `master` also get tagged as `latest` and deployed using
an application-specific deploy script: an application-specific deploy script:
```yaml ```yaml
image: docker:latest image: docker:stable
services: services:
- docker:dind - docker:dind
......
...@@ -86,7 +86,7 @@ services](#accessing-the-services). ...@@ -86,7 +86,7 @@ services](#accessing-the-services).
### How the health check of services works ### How the health check of services works
Services are designed to provide additional functionality which is **network accessible**. Services are designed to provide additional functionality which is **network accessible**.
It may be a database like MySQL, or Redis, and even `docker:dind` which It may be a database like MySQL, or Redis, and even `docker:stable-dind` which
allows you to use Docker in Docker. It can be practically anything that is allows you to use Docker in Docker. It can be practically anything that is
required for the CI/CD job to proceed and is accessed by network. required for the CI/CD job to proceed and is accessed by network.
......
...@@ -17,7 +17,7 @@ performance: ...@@ -17,7 +17,7 @@ performance:
variables: variables:
URL: https://example.com URL: https://example.com
services: services:
- docker:dind - docker:stable-dind
script: script:
- mkdir gitlab-exporter - mkdir gitlab-exporter
- wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/master/index.js - wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/master/index.js
...@@ -94,7 +94,7 @@ performance: ...@@ -94,7 +94,7 @@ performance:
stage: performance stage: performance
image: docker:git image: docker:git
services: services:
- docker:dind - docker:stable-dind
dependencies: dependencies:
- review - review
script: script:
......
...@@ -80,7 +80,7 @@ runners: ...@@ -80,7 +80,7 @@ runners:
image: ubuntu:16.04 image: ubuntu:16.04
## Run all containers with the privileged flag enabled ## Run all containers with the privileged flag enabled
## This will allow the docker:dind image to run if you need to run Docker ## This will allow the docker:stable-dind image to run if you need to run Docker
## commands. Please read the docs before turning this on: ## commands. Please read the docs before turning this on:
## ref: https://docs.gitlab.com/runner/executors/kubernetes.html#using-docker-dind ## ref: https://docs.gitlab.com/runner/executors/kubernetes.html#using-docker-dind
## ##
...@@ -147,7 +147,7 @@ enable privileged mode in `values.yaml`: ...@@ -147,7 +147,7 @@ enable privileged mode in `values.yaml`:
```yaml ```yaml
runners: runners:
## Run all containers with the privileged flag enabled ## Run all containers with the privileged flag enabled
## This will allow the docker:dind image to run if you need to run Docker ## This will allow the docker:stable-dind image to run if you need to run Docker
## commands. Please read the docs before turning this on: ## commands. Please read the docs before turning this on:
## ref: https://docs.gitlab.com/runner/executors/kubernetes.html#using-docker-dind ## ref: https://docs.gitlab.com/runner/executors/kubernetes.html#using-docker-dind
## ##
......
...@@ -1474,7 +1474,7 @@ module Gitlab ...@@ -1474,7 +1474,7 @@ module Gitlab
return [] if empty? || safe_query.blank? return [] if empty? || safe_query.blank?
args = %W(ls-tree --full-tree -r #{ref || root_ref} --name-status | #{safe_query}) args = %W(ls-tree -r --name-status --full-tree #{ref || root_ref} -- #{safe_query})
run_git(args).first.lines.map(&:strip) run_git(args).first.lines.map(&:strip)
end end
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"webpack-prod": "NODE_ENV=production webpack --config config/webpack.config.js" "webpack-prod": "NODE_ENV=production webpack --config config/webpack.config.js"
}, },
"dependencies": { "dependencies": {
"@gitlab-org/gitlab-svgs": "^1.17.0", "@gitlab-org/gitlab-svgs": "^1.18.0",
"autosize": "^4.0.0", "autosize": "^4.0.0",
"axios": "^0.17.1", "axios": "^0.17.1",
"babel-core": "^6.26.0", "babel-core": "^6.26.0",
......
...@@ -206,7 +206,7 @@ FactoryBot.define do ...@@ -206,7 +206,7 @@ FactoryBot.define do
options do options do
{ {
image: { name: 'ruby:2.1', entrypoint: '/bin/sh' }, image: { name: 'ruby:2.1', entrypoint: '/bin/sh' },
services: ['postgres', { name: 'docker:dind', entrypoint: '/bin/sh', command: 'sleep 30', alias: 'docker' }], services: ['postgres', { name: 'docker:stable-dind', entrypoint: '/bin/sh', command: 'sleep 30', alias: 'docker' }],
after_script: %w(ls date), after_script: %w(ls date),
artifacts: { artifacts: {
name: 'artifacts_file', name: 'artifacts_file',
......
...@@ -133,10 +133,7 @@ describe('IDE commit module actions', () => { ...@@ -133,10 +133,7 @@ describe('IDE commit module actions', () => {
store store
.dispatch('commit/checkCommitStatus') .dispatch('commit/checkCommitStatus')
.then(() => { .then(() => {
expect(service.getBranchData).toHaveBeenCalledWith( expect(service.getBranchData).toHaveBeenCalledWith('abcproject', 'master');
'abcproject',
'master',
);
done(); done();
}) })
...@@ -230,9 +227,7 @@ describe('IDE commit module actions', () => { ...@@ -230,9 +227,7 @@ describe('IDE commit module actions', () => {
branch, branch,
}) })
.then(() => { .then(() => {
expect( expect(store.state.projects.abcproject.branches.master.workingReference).toBe(data.id);
store.state.projects.abcproject.branches.master.workingReference,
).toBe(data.id);
}) })
.then(done) .then(done)
.catch(done.fail); .catch(done.fail);
...@@ -317,26 +312,7 @@ describe('IDE commit module actions', () => { ...@@ -317,26 +312,7 @@ describe('IDE commit module actions', () => {
branch, branch,
}) })
.then(() => { .then(() => {
expect(router.push).toHaveBeenCalledWith( expect(router.push).toHaveBeenCalledWith(`/project/abcproject/blob/master/${f.path}`);
`/project/abcproject/blob/master/${f.path}`,
);
})
.then(done)
.catch(done.fail);
});
it('resets stores commit actions', done => {
store.state.commit.commitAction = consts.COMMIT_TO_NEW_BRANCH;
store
.dispatch('commit/updateFilesAfterCommit', {
data,
branch,
})
.then(() => {
expect(store.state.commit.commitAction).not.toBe(
consts.COMMIT_TO_NEW_BRANCH,
);
}) })
.then(done) .then(done)
.catch(done.fail); .catch(done.fail);
...@@ -448,15 +424,26 @@ describe('IDE commit module actions', () => { ...@@ -448,15 +424,26 @@ describe('IDE commit module actions', () => {
store store
.dispatch('commit/commitChanges') .dispatch('commit/commitChanges')
.then(() => { .then(() => {
expect(store.state.openFiles[0].lastCommit.message).toBe( expect(store.state.openFiles[0].lastCommit.message).toBe('test message');
'test message',
);
done(); done();
}) })
.catch(done.fail); .catch(done.fail);
}); });
it('resets stores commit actions', done => {
store.state.commit.commitAction = consts.COMMIT_TO_NEW_BRANCH;
store
.dispatch('commit/commitChanges')
.then(() => {
expect(store.state.commit.commitAction).not.toBe(consts.COMMIT_TO_NEW_BRANCH);
})
.then(done)
.catch(done.fail);
});
describe('merge request', () => {
it('redirects to new merge request page', done => { it('redirects to new merge request page', done => {
spyOn(eventHub, '$on'); spyOn(eventHub, '$on');
...@@ -475,6 +462,22 @@ describe('IDE commit module actions', () => { ...@@ -475,6 +462,22 @@ describe('IDE commit module actions', () => {
}) })
.catch(done.fail); .catch(done.fail);
}); });
it('resets changed files before redirecting', done => {
spyOn(eventHub, '$on');
store.state.commit.commitAction = '3';
store
.dispatch('commit/commitChanges')
.then(() => {
expect(store.state.changedFiles.length).toBe(0);
done();
})
.catch(done.fail);
});
});
}); });
describe('failed', () => { describe('failed', () => {
......
...@@ -51,8 +51,7 @@ const createComponent = () => { ...@@ -51,8 +51,7 @@ const createComponent = () => {
const messages = { const messages = {
loadingMetrics: 'Loading deployment statistics', loadingMetrics: 'Loading deployment statistics',
hasMetrics: hasMetrics: 'Memory usage is unchanged at 0MB',
'<a href="/root/acets-review-apps/environments/15/metrics"> Memory </a> usage is <b> unchanged </b> at 0MB',
loadFailed: 'Failed to load deployment statistics', loadFailed: 'Failed to load deployment statistics',
metricsUnavailable: 'Deployment statistics are not available currently', metricsUnavailable: 'Deployment statistics are not available currently',
}; };
......
...@@ -408,7 +408,7 @@ describe API::Runner do ...@@ -408,7 +408,7 @@ describe API::Runner do
expect(json_response['image']).to eq({ 'name' => 'ruby:2.1', 'entrypoint' => '/bin/sh' }) expect(json_response['image']).to eq({ 'name' => 'ruby:2.1', 'entrypoint' => '/bin/sh' })
expect(json_response['services']).to eq([{ 'name' => 'postgres', 'entrypoint' => nil, expect(json_response['services']).to eq([{ 'name' => 'postgres', 'entrypoint' => nil,
'alias' => nil, 'command' => nil }, 'alias' => nil, 'command' => nil },
{ 'name' => 'docker:dind', 'entrypoint' => '/bin/sh', { 'name' => 'docker:stable-dind', 'entrypoint' => '/bin/sh',
'alias' => 'docker', 'command' => 'sleep 30' }]) 'alias' => 'docker', 'command' => 'sleep 30' }])
expect(json_response['steps']).to eq(expected_steps) expect(json_response['steps']).to eq(expected_steps)
expect(json_response['artifacts']).to eq(expected_artifacts) expect(json_response['artifacts']).to eq(expected_artifacts)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
image: "chef/chefdk" image: "chef/chefdk"
services: services:
- docker:dind - docker:stable-dind
variables: variables:
DOCKER_HOST: "tcp://docker:2375" DOCKER_HOST: "tcp://docker:2375"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
image: docker:latest image: docker:latest
services: services:
- docker:dind - docker:stable-dind
before_script: before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
......
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
lodash "^4.2.0" lodash "^4.2.0"
to-fast-properties "^2.0.0" to-fast-properties "^2.0.0"
"@gitlab-org/gitlab-svgs@^1.17.0": "@gitlab-org/gitlab-svgs@^1.18.0":
version "1.17.0" version "1.18.0"
resolved "https://registry.yarnpkg.com/@gitlab-org/gitlab-svgs/-/gitlab-svgs-1.17.0.tgz#d0c74d9e44c127ccfad16941f352088b86f86c89" resolved "https://registry.yarnpkg.com/@gitlab-org/gitlab-svgs/-/gitlab-svgs-1.18.0.tgz#7829f0e6de0647dace54c1fcd597ee3424afb233"
"@types/jquery@^2.0.40": "@types/jquery@^2.0.40":
version "2.0.48" version "2.0.48"
......
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