Commit 269ed8e3 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-07-10

# Conflicts:
#	spec/models/ci/build_spec.rb
#	spec/models/user_spec.rb

[ci skip]
parents bf89c2a3 255db3d5
...@@ -433,7 +433,7 @@ cloud-native-image: ...@@ -433,7 +433,7 @@ cloud-native-image:
cache: {} cache: {}
script: script:
- gem install gitlab --no-ri --no-rdoc - gem install gitlab --no-ri --no-rdoc
- ./trigger-build cng - ./scripts/trigger-build cng
only: only:
- tags@gitlab-org/gitlab-ce - tags@gitlab-org/gitlab-ce
- tags@gitlab-org/gitlab-ee - tags@gitlab-org/gitlab-ee
......
...@@ -107,7 +107,7 @@ gem 'hashie-forbidden_attributes' ...@@ -107,7 +107,7 @@ gem 'hashie-forbidden_attributes'
gem 'kaminari', '~> 1.0' gem 'kaminari', '~> 1.0'
# HAML # HAML
gem 'hamlit', '~> 2.6.1' gem 'hamlit', '~> 2.8.8'
# Files attachments # Files attachments
gem 'carrierwave', '~> 1.2' gem 'carrierwave', '~> 1.2'
......
...@@ -408,8 +408,8 @@ GEM ...@@ -408,8 +408,8 @@ GEM
rake (>= 10, < 13) rake (>= 10, < 13)
rubocop (>= 0.49.0) rubocop (>= 0.49.0)
sysexits (~> 1.1) sysexits (~> 1.1)
hamlit (2.6.1) hamlit (2.8.8)
temple (~> 0.7.6) temple (>= 0.8.0)
thor thor
tilt tilt
hashdiff (0.3.4) hashdiff (0.3.4)
...@@ -918,7 +918,7 @@ GEM ...@@ -918,7 +918,7 @@ GEM
sys-filesystem (1.1.6) sys-filesystem (1.1.6)
ffi ffi
sysexits (1.2.0) sysexits (1.2.0)
temple (0.7.7) temple (0.8.0)
test-prof (0.2.5) test-prof (0.2.5)
test_after_commit (1.1.0) test_after_commit (1.1.0)
activerecord (>= 3.2) activerecord (>= 3.2)
...@@ -929,7 +929,7 @@ GEM ...@@ -929,7 +929,7 @@ GEM
rack (>= 1, < 3) rack (>= 1, < 3)
thor (0.19.4) thor (0.19.4)
thread_safe (0.3.6) thread_safe (0.3.6)
tilt (2.0.6) tilt (2.0.8)
timecop (0.8.1) timecop (0.8.1)
timfel-krb5-auth (0.8.3) timfel-krb5-auth (0.8.3)
toml (0.1.2) toml (0.1.2)
...@@ -1093,7 +1093,7 @@ DEPENDENCIES ...@@ -1093,7 +1093,7 @@ DEPENDENCIES
grpc (~> 1.11.0) grpc (~> 1.11.0)
gssapi gssapi
haml_lint (~> 0.26.0) haml_lint (~> 0.26.0)
hamlit (~> 2.6.1) hamlit (~> 2.8.8)
hashie-forbidden_attributes hashie-forbidden_attributes
health_check (~> 2.6.0) health_check (~> 2.6.0)
hipchat (~> 1.5.0) hipchat (~> 1.5.0)
......
...@@ -87,7 +87,7 @@ GEM ...@@ -87,7 +87,7 @@ GEM
babosa (1.0.2) babosa (1.0.2)
base32 (0.3.2) base32 (0.3.2)
batch-loader (1.2.1) batch-loader (1.2.1)
bcrypt (3.1.11) bcrypt (3.1.12)
bcrypt_pbkdf (1.0.0) bcrypt_pbkdf (1.0.0)
benchmark-ips (2.3.0) benchmark-ips (2.3.0)
better_errors (2.1.1) better_errors (2.1.1)
...@@ -119,7 +119,7 @@ GEM ...@@ -119,7 +119,7 @@ GEM
capybara-screenshot (1.0.14) capybara-screenshot (1.0.14)
capybara (>= 1.0, < 3) capybara (>= 1.0, < 3)
launchy launchy
carrierwave (1.2.1) carrierwave (1.2.3)
activemodel (>= 4.0.0) activemodel (>= 4.0.0)
activesupport (>= 4.0.0) activesupport (>= 4.0.0)
mime-types (>= 1.16) mime-types (>= 1.16)
...@@ -411,8 +411,8 @@ GEM ...@@ -411,8 +411,8 @@ GEM
rake (>= 10, < 13) rake (>= 10, < 13)
rubocop (>= 0.49.0) rubocop (>= 0.49.0)
sysexits (~> 1.1) sysexits (~> 1.1)
hamlit (2.6.1) hamlit (2.8.8)
temple (~> 0.7.6) temple (>= 0.8.0)
thor thor
tilt tilt
hashdiff (0.3.4) hashdiff (0.3.4)
...@@ -543,7 +543,7 @@ GEM ...@@ -543,7 +543,7 @@ GEM
net-ssh (5.0.1) net-ssh (5.0.1)
netrc (0.11.0) netrc (0.11.0)
nio4r (2.3.1) nio4r (2.3.1)
nokogiri (1.8.2) nokogiri (1.8.3)
mini_portile2 (~> 2.3.0) mini_portile2 (~> 2.3.0)
nokogumbo (1.5.0) nokogumbo (1.5.0)
nokogiri nokogiri
...@@ -840,7 +840,7 @@ GEM ...@@ -840,7 +840,7 @@ GEM
rubyzip (1.2.1) rubyzip (1.2.1)
rufus-scheduler (3.4.0) rufus-scheduler (3.4.0)
et-orbi (~> 1.0) et-orbi (~> 1.0)
rugged (0.27.1) rugged (0.27.2)
safe_yaml (1.0.4) safe_yaml (1.0.4)
sanitize (4.6.5) sanitize (4.6.5)
crass (~> 1.0.2) crass (~> 1.0.2)
...@@ -906,7 +906,7 @@ GEM ...@@ -906,7 +906,7 @@ GEM
activesupport (>= 4.2) activesupport (>= 4.2)
spring-commands-rspec (1.0.4) spring-commands-rspec (1.0.4)
spring (>= 0.9.1) spring (>= 0.9.1)
sprockets (3.7.1) sprockets (3.7.2)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
rack (> 1, < 3) rack (> 1, < 3)
sprockets-rails (3.2.1) sprockets-rails (3.2.1)
...@@ -927,7 +927,7 @@ GEM ...@@ -927,7 +927,7 @@ GEM
sys-filesystem (1.1.6) sys-filesystem (1.1.6)
ffi ffi
sysexits (1.2.0) sysexits (1.2.0)
temple (0.7.7) temple (0.8.0)
test-prof (0.2.5) test-prof (0.2.5)
text (1.3.1) text (1.3.1)
thin (1.7.0) thin (1.7.0)
...@@ -1103,7 +1103,7 @@ DEPENDENCIES ...@@ -1103,7 +1103,7 @@ DEPENDENCIES
grpc (~> 1.11.0) grpc (~> 1.11.0)
gssapi gssapi
haml_lint (~> 0.26.0) haml_lint (~> 0.26.0)
hamlit (~> 2.6.1) hamlit (~> 2.8.8)
hashie-forbidden_attributes hashie-forbidden_attributes
health_check (~> 2.6.0) health_check (~> 2.6.0)
hipchat (~> 1.5.0) hipchat (~> 1.5.0)
......
...@@ -63,7 +63,8 @@ export default { ...@@ -63,7 +63,8 @@ export default {
plainDiffPath: state => state.diffs.plainDiffPath, plainDiffPath: state => state.diffs.plainDiffPath,
emailPatchPath: state => state.diffs.emailPatchPath, emailPatchPath: state => state.diffs.emailPatchPath,
}), }),
...mapGetters(['isParallelView', 'isNotesFetched']), ...mapGetters('diffs', ['isParallelView']),
...mapGetters(['isNotesFetched']),
targetBranch() { targetBranch() {
return { return {
branchName: this.targetBranchName, branchName: this.targetBranchName,
...@@ -115,7 +116,7 @@ export default { ...@@ -115,7 +116,7 @@ export default {
this.adjustView(); this.adjustView();
}, },
methods: { methods: {
...mapActions(['setBaseConfig', 'fetchDiffFiles']), ...mapActions('diffs', ['setBaseConfig', 'fetchDiffFiles']),
fetchData() { fetchData() {
this.fetchDiffFiles().catch(() => { this.fetchDiffFiles().catch(() => {
createFlash(__('Something went wrong on our end. Please try again!')); createFlash(__('Something went wrong on our end. Please try again!'));
......
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(['isInlineView', 'isParallelView', 'areAllFilesCollapsed']), ...mapGetters('diffs', ['isInlineView', 'isParallelView', 'areAllFilesCollapsed']),
sumAddedLines() { sumAddedLines() {
return this.sumValues('addedLines'); return this.sumValues('addedLines');
}, },
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
document.removeEventListener('scroll', this.handleScroll); document.removeEventListener('scroll', this.handleScroll);
}, },
methods: { methods: {
...mapActions(['setInlineDiffViewType', 'setParallelDiffViewType', 'expandAllFiles']), ...mapActions('diffs', ['setInlineDiffViewType', 'setParallelDiffViewType', 'expandAllFiles']),
pluralize, pluralize,
handleScroll() { handleScroll() {
if (!this.updating) { if (!this.updating) {
......
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
projectPath: state => state.diffs.projectPath, projectPath: state => state.diffs.projectPath,
endpoint: state => state.diffs.endpoint, endpoint: state => state.diffs.endpoint,
}), }),
...mapGetters(['isInlineView', 'isParallelView']), ...mapGetters('diffs', ['isInlineView', 'isParallelView']),
diffMode() { diffMode() {
const diffModeKey = Object.keys(diffModes).find(key => this.diffFile[`${key}File`]); const diffModeKey = Object.keys(diffModes).find(key => this.diffFile[`${key}File`]);
return diffModes[diffModeKey] || diffModes.replaced; return diffModes[diffModeKey] || diffModes.replaced;
......
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
document.removeEventListener('scroll', this.handleScroll); document.removeEventListener('scroll', this.handleScroll);
}, },
methods: { methods: {
...mapActions(['loadCollapsedDiff']), ...mapActions('diffs', ['loadCollapsedDiff']),
handleToggle() { handleToggle() {
const { collapsed, highlightedDiffLines, parallelDiffLines } = this.file; const { collapsed, highlightedDiffLines, parallelDiffLines } = this.file;
......
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
}, },
}, },
methods: { methods: {
...mapActions(['loadMoreLines', 'showCommentForm']), ...mapActions('diffs', ['loadMoreLines', 'showCommentForm']),
handleCommentButton() { handleCommentButton() {
this.showCommentForm({ lineCode: this.lineCode }); this.showCommentForm({ lineCode: this.lineCode });
}, },
......
...@@ -59,7 +59,8 @@ export default { ...@@ -59,7 +59,8 @@ export default {
} }
}, },
methods: { methods: {
...mapActions(['cancelCommentForm', 'saveNote', 'refetchDiscussionById']), ...mapActions('diffs', ['cancelCommentForm']),
...mapActions(['saveNote', 'refetchDiscussionById']),
handleCancelCommentForm() { handleCancelCommentForm() {
this.autosave.reset(); this.autosave.reset();
this.cancelCommentForm({ this.cancelCommentForm({
......
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(['isInlineView']), ...mapGetters('diffs', ['isInlineView']),
isContextLine() { isContextLine() {
return this.line.type === CONTEXT_LINE_TYPE; return this.line.type === CONTEXT_LINE_TYPE;
}, },
......
...@@ -20,7 +20,8 @@ export default { ...@@ -20,7 +20,8 @@ export default {
}, },
}, },
computed: { computed: {
...mapGetters(['commitId', 'discussionsByLineCode']), ...mapGetters('diffs', ['commitId']),
...mapGetters(['discussionsByLineCode']),
...mapState({ ...mapState({
diffLineCommentForms: state => state.diffs.diffLineCommentForms, diffLineCommentForms: state => state.diffs.diffLineCommentForms,
}), }),
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(['isParallelView']), ...mapGetters('diffs', ['isParallelView']),
isContextLine() { isContextLine() {
return this.line.left.type === CONTEXT_LINE_TYPE; return this.line.left.type === CONTEXT_LINE_TYPE;
}, },
......
...@@ -21,7 +21,8 @@ export default { ...@@ -21,7 +21,8 @@ export default {
}, },
}, },
computed: { computed: {
...mapGetters(['commitId', 'discussionsByLineCode']), ...mapGetters('diffs', ['commitId']),
...mapGetters(['discussionsByLineCode']),
...mapState({ ...mapState({
diffLineCommentForms: state => state.diffs.diffLineCommentForms, diffLineCommentForms: state => state.diffs.diffLineCommentForms,
}), }),
......
...@@ -4,6 +4,7 @@ import mutations from '../mutations'; ...@@ -4,6 +4,7 @@ import mutations from '../mutations';
import createState from './diff_state'; import createState from './diff_state';
export default { export default {
namespaced: true,
state: createState(), state: createState(),
getters, getters,
actions, actions,
......
...@@ -171,6 +171,8 @@ export default class DueDateSelectors { ...@@ -171,6 +171,8 @@ export default class DueDateSelectors {
initMilestoneDatePicker() { initMilestoneDatePicker() {
$('.datepicker').each(function initPikadayMilestone() { $('.datepicker').each(function initPikadayMilestone() {
const $datePicker = $(this); const $datePicker = $(this);
const datePickerVal = $datePicker.val();
const calendar = new Pikaday({ const calendar = new Pikaday({
field: $datePicker.get(0), field: $datePicker.get(0),
theme: 'gitlab-theme animate-picker', theme: 'gitlab-theme animate-picker',
...@@ -183,7 +185,7 @@ export default class DueDateSelectors { ...@@ -183,7 +185,7 @@ export default class DueDateSelectors {
}, },
}); });
calendar.setDate(parsePikadayDate($datePicker.val())); calendar.setDate(parsePikadayDate(datePickerVal));
$datePicker.data('pikaday', calendar); $datePicker.data('pikaday', calendar);
}); });
......
...@@ -224,7 +224,10 @@ ...@@ -224,7 +224,10 @@
.form-control { .form-control {
position: relative; position: relative;
min-width: 200px; min-width: 200px;
padding: 5px 25px 6px 0; padding-right: 25px;
padding-left: 0;
height: $input-height;
line-height: inherit;
border-color: transparent; border-color: transparent;
&:focus, &:focus,
......
...@@ -61,7 +61,9 @@ ...@@ -61,7 +61,9 @@
- if header_link?(:sign_in) - if header_link?(:sign_in)
%li.nav-item %li.nav-item
%div %div
= link_to "Sign in / Register", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in' - sign_in_text = allow_signup? ? 'Sign in / Register' : 'Sign in'
= link_to sign_in_text, new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in'
%button.navbar-toggler.d-block.d-sm-none{ type: 'button' } %button.navbar-toggler.d-block.d-sm-none{ type: 'button' }
%span.sr-only Toggle navigation %span.sr-only Toggle navigation
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
%h5 Request body: %h5 Request body:
%pre %pre
:plain :escaped
#{JSON.pretty_generate(hook_log.request_data)} #{JSON.pretty_generate(hook_log.request_data)}
%h5 Response headers: %h5 Response headers:
%pre %pre
...@@ -40,5 +40,5 @@ ...@@ -40,5 +40,5 @@
%h5 Response body: %h5 Response body:
%pre %pre
:plain :escaped
#{hook_log.response_body} #{hook_log.response_body}
---
title: "Fixing milestone date change when editing"
merge_request: 20279
author: Orlando Del Aguila
type: fixed
\ No newline at end of file
---
title: Fix search bar text input alignment
merge_request:
author:
type: fixed
---
title: Add /uploads subdirectory to allowed upload paths.
merge_request:
author:
type: fixed
---
title: Rails5 fix mysql milliseconds problem in specs
merge_request: 20464
author: Jasper Maes
type: fixed
---
title: Rails5 mysql fix milliseconds problem in pull request importer spec
merge_request: 20475
author: Jasper Maes
type: fixed
---
title: Update Gemfile.rails5.lock with latest Gemfile.lock changes
merge_request: 20466
author: Jasper Maes
type: fixed
---
title: Fix handling of annotated tags when Gitaly is not in use
merge_request:
author:
type: fixed
---
title: 'Update hamlit to fix ruby 2.5 incompatibilities, fixes #42045'
merge_request:
author: Matthew Dawson
type: fixed
...@@ -49,8 +49,8 @@ supporting custom domains a secondary IP is not needed. ...@@ -49,8 +49,8 @@ supporting custom domains a secondary IP is not needed.
Before proceeding with the Pages configuration, you will need to: Before proceeding with the Pages configuration, you will need to:
1. Have a separate domain under which the GitLab Pages will be served. In this 1. Have an exclusive root domain for serving GitLab Pages. Note that you cannot
document we assume that to be `example.io`. use a subdomain of your GitLab's instance domain.
1. Configure a **wildcard DNS record**. 1. Configure a **wildcard DNS record**.
1. (Optional) Have a **wildcard certificate** for that domain if you decide to 1. (Optional) Have a **wildcard certificate** for that domain if you decide to
serve Pages under HTTPS. serve Pages under HTTPS.
......
# Frontend Development Process # Frontend Development Process
You can find more about the organization of the frontend team in the [handbook](https://about.gitlab.com/handbook/frontend/). You can find more about the organization of the frontend team in the [handbook](https://about.gitlab.com/handbook/engineering/frontend/).
## Development Checklist ## Development Checklist
...@@ -34,7 +34,7 @@ Please use your best judgement when to use it and please contribute new points t ...@@ -34,7 +34,7 @@ Please use your best judgement when to use it and please contribute new points t
- [ ] **Cookie Mode** Think about hiding the feature behind a cookie flag if the implementation is on top of existing features - [ ] **Cookie Mode** Think about hiding the feature behind a cookie flag if the implementation is on top of existing features
- [ ] **New route** Are you refactoring something big then you might consider adding a new route where you implement the new feature and when finished delete the current route and rename the new one. (for example 'merge_request' and 'new_merge_request') - [ ] **New route** Are you refactoring something big then you might consider adding a new route where you implement the new feature and when finished delete the current route and rename the new one. (for example 'merge_request' and 'new_merge_request')
- [ ] **Setup** Is there any specific setup needed for your implementation (for example a kubernetes cluster)? Then let everyone know if it is not already mentioned where they can find documentation (if it doesn't exist - create it) - [ ] **Setup** Is there any specific setup needed for your implementation (for example a kubernetes cluster)? Then let everyone know if it is not already mentioned where they can find documentation (if it doesn't exist - create it)
- [ ] **Security** Are there any new security relevant implementations? Then please contact the security team for an app security review. If you are not sure ask our [domain expert](https://about.gitlab.com/handbook/frontend/#frontend-domain-experts) - [ ] **Security** Are there any new security relevant implementations? Then please contact the security team for an app security review. If you are not sure ask our [domain expert](https://about.gitlab.com/handbook/engineering/frontend/#frontend-domain-experts)
#### During development #### During development
...@@ -51,7 +51,7 @@ Please use your best judgement when to use it and please contribute new points t ...@@ -51,7 +51,7 @@ Please use your best judgement when to use it and please contribute new points t
- [ ] **Performance** Have you checked performance? For example do the same thing with 500 comments instead of 1. Document the tests and possible findings in the MR so a reviewer can directly see it. - [ ] **Performance** Have you checked performance? For example do the same thing with 500 comments instead of 1. Document the tests and possible findings in the MR so a reviewer can directly see it.
- [ ] Have you tested with a variety of our [supported browsers](../../install/requirements.md#supported-web-browsers)? You can use [browserstack](https://www.browserstack.com/) to be able to access a wide variety of browsers and operating systems. - [ ] Have you tested with a variety of our [supported browsers](../../install/requirements.md#supported-web-browsers)? You can use [browserstack](https://www.browserstack.com/) to be able to access a wide variety of browsers and operating systems.
- [ ] Did you check the mobile view? - [ ] Did you check the mobile view?
- [ ] Check the built webpack bundle (For the report run `WEBPACK_REPORT=true gdk run`, then open `webpack-report/index.html`) if we have unnecessary bloat due to wrong references, including libraries multiple times, etc.. If you need help contact the webpack [domain expert](https://about.gitlab.com/handbook/frontend/#frontend-domain-experts) - [ ] Check the built webpack bundle (For the report run `WEBPACK_REPORT=true gdk run`, then open `webpack-report/index.html`) if we have unnecessary bloat due to wrong references, including libraries multiple times, etc.. If you need help contact the webpack [domain expert](https://about.gitlab.com/handbook/engineering/frontend/#frontend-domain-experts)
- [ ] **Tests** Not only greenfield tests - Test also all bad cases that come to your mind. - [ ] **Tests** Not only greenfield tests - Test also all bad cases that come to your mind.
- [ ] If you have multiple MR's then also smoke test against the final merge. - [ ] If you have multiple MR's then also smoke test against the final merge.
- [ ] Are there any big changes on how and especially how frequently we use the API then let production know about it - [ ] Are there any big changes on how and especially how frequently we use the API then let production know about it
......
...@@ -11,6 +11,7 @@ are very appreciative of the work done by translators and proofreaders! ...@@ -11,6 +11,7 @@ are very appreciative of the work done by translators and proofreaders!
- Chinese Traditional - Chinese Traditional
- Huang Tao - [GitLab](https://gitlab.com/htve), [Crowdin](https://crowdin.com/profile/htve) - Huang Tao - [GitLab](https://gitlab.com/htve), [Crowdin](https://crowdin.com/profile/htve)
- Weizhe Ding - [GitLab](https://gitlab.com/d.weizhe), [Crowdin](https://crowdin.com/profile/d.weizhe) - Weizhe Ding - [GitLab](https://gitlab.com/d.weizhe), [Crowdin](https://crowdin.com/profile/d.weizhe)
- Yi-Jyun Pan - [GitLab](https://gitlab.com/pan93412), [Crowdin](https://crowdin.com/profile/pan93412)
- Chinese Traditional, Hong Kong - Chinese Traditional, Hong Kong
- Huang Tao - [GitLab](https://gitlab.com/htve), [Crowdin](https://crowdin.com/profile/htve) - Huang Tao - [GitLab](https://gitlab.com/htve), [Crowdin](https://crowdin.com/profile/htve)
- Dutch - Dutch
......
...@@ -172,6 +172,10 @@ object which can be treated like any other jasmine spy object. ...@@ -172,6 +172,10 @@ object which can be treated like any other jasmine spy object.
Further documentation on the babel rewire pluign API can be found on Further documentation on the babel rewire pluign API can be found on
[its repository Readme doc](https://github.com/speedskater/babel-plugin-rewire#babel-plugin-rewire). [its repository Readme doc](https://github.com/speedskater/babel-plugin-rewire#babel-plugin-rewire).
#### Waiting in tests
If you cannot avoid using [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout) in tests, please use the [Jasmine mock clock](https://jasmine.github.io/api/2.9/Clock.html).
### Vue.js unit tests ### Vue.js unit tests
See this [section][vue-test]. See this [section][vue-test].
......
...@@ -77,6 +77,8 @@ Note that Public SSH key may also be named as follows: ...@@ -77,6 +77,8 @@ Note that Public SSH key may also be named as follows:
If you want to change the password of your SSH key pair, you can use If you want to change the password of your SSH key pair, you can use
`ssh-keygen -p <keyname>`. `ssh-keygen -p <keyname>`.
## Adding a SSH key to your GitLab account
1. The next step is to copy the public SSH key as we will need it afterwards. 1. The next step is to copy the public SSH key as we will need it afterwards.
To copy your public SSH key to the clipboard, use the appropriate code below: To copy your public SSH key to the clipboard, use the appropriate code below:
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
> For the best result, we encourage you to check this document out as rendered > For the best result, we encourage you to check this document out as rendered
by GitLab: [markdown.md] by GitLab: [markdown.md]
_GitLab uses (as of 11.1) the [CommonMark Ruby Library][commonmarker] for Markdown processing of all new issues, merge requests, comments, and other Markdown content in the GitLab system. Previous content and Markdown files `.md` in the repositories are still processed using the [Redcarpet Ruby library][redcarpet]._ _GitLab uses (as of 11.1) the [CommonMark Ruby Library][commonmarker] for Markdown processing of all new issues, merge requests, comments, and other Markdown content in the GitLab system. Previous content, wiki pages and Markdown files (`.md`) in the repositories are still processed using the [Redcarpet Ruby library][redcarpet]._
_Where there are significant differences, we will try to call them out in this document._ _Where there are significant differences, we will try to call them out in this document._
...@@ -22,7 +22,7 @@ You can use GFM in the following areas: ...@@ -22,7 +22,7 @@ You can use GFM in the following areas:
- merge requests - merge requests
- milestones - milestones
- snippets (the snippet must be named with a `.md` extension) - snippets (the snippet must be named with a `.md` extension)
- wiki pages - wiki pages (currently only rendered by Redcarpet)
- markdown documents inside the repository (currently only rendered by Redcarpet) - markdown documents inside the repository (currently only rendered by Redcarpet)
- epics - epics
......
...@@ -625,8 +625,14 @@ module Gitlab ...@@ -625,8 +625,14 @@ module Gitlab
end end
def update_branch(branch_name, user:, newrev:, oldrev:) def update_branch(branch_name, user:, newrev:, oldrev:)
gitaly_migrate(:operation_user_update_branch) do |is_enabled|
if is_enabled
gitaly_operations_client.user_update_branch(branch_name, user, newrev, oldrev)
else
OperationService.new(user, self).update_branch(branch_name, newrev, oldrev) OperationService.new(user, self).update_branch(branch_name, newrev, oldrev)
end end
end
end
def rm_branch(branch_name, user:) def rm_branch(branch_name, user:)
wrapped_gitaly_errors do wrapped_gitaly_errors do
......
...@@ -68,6 +68,22 @@ module Gitlab ...@@ -68,6 +68,22 @@ module Gitlab
raise Gitlab::Git::Repository::InvalidRef, ex raise Gitlab::Git::Repository::InvalidRef, ex
end end
def user_update_branch(branch_name, user, newrev, oldrev)
request = Gitaly::UserUpdateBranchRequest.new(
repository: @gitaly_repo,
branch_name: encode_binary(branch_name),
user: Gitlab::Git::User.from_gitlab(user).to_gitaly,
newrev: encode_binary(newrev),
oldrev: encode_binary(oldrev)
)
response = GitalyClient.call(@repository.storage, :operation_service, :user_update_branch, request)
if pre_receive_error = response.pre_receive_error.presence
raise Gitlab::Git::PreReceiveError, pre_receive_error
end
end
def user_delete_branch(branch_name, user) def user_delete_branch(branch_name, user)
request = Gitaly::UserDeleteBranchRequest.new( request = Gitaly::UserDeleteBranchRequest.new(
repository: @gitaly_repo, repository: @gitaly_repo,
......
...@@ -84,7 +84,7 @@ module Gitlab ...@@ -84,7 +84,7 @@ module Gitlab
def open_file(params, key) def open_file(params, key)
::UploadedFile.from_params( ::UploadedFile.from_params(
params, key, params, key,
Gitlab.config.uploads.storage_path) [FileUploader.root, Gitlab.config.uploads.storage_path])
end end
end end
......
...@@ -28,7 +28,7 @@ class UploadedFile ...@@ -28,7 +28,7 @@ class UploadedFile
@tempfile = File.new(path, 'rb') @tempfile = File.new(path, 'rb')
end end
def self.from_params(params, field, upload_path) def self.from_params(params, field, upload_paths)
unless params["#{field}.path"] unless params["#{field}.path"]
raise InvalidPathError, "file is invalid" if params["#{field}.remote_id"] raise InvalidPathError, "file is invalid" if params["#{field}.remote_id"]
...@@ -37,7 +37,8 @@ class UploadedFile ...@@ -37,7 +37,8 @@ class UploadedFile
file_path = File.realpath(params["#{field}.path"]) file_path = File.realpath(params["#{field}.path"])
unless self.allowed_path?(file_path, [upload_path, Dir.tmpdir].compact) paths = Array(upload_paths) << Dir.tmpdir
unless self.allowed_path?(file_path, paths.compact)
raise InvalidPathError, "insecure path used '#{file_path}'" raise InvalidPathError, "insecure path used '#{file_path}'"
end end
......
require "rails_helper"
describe "User edits milestone", :js do
set(:user) { create(:user) }
set(:project) { create(:project) }
set(:milestone) { create(:milestone, project: project, start_date: Date.today, due_date: 5.days.from_now) }
before do
project.add_developer(user)
sign_in(user)
visit(edit_project_milestone_path(project, milestone))
end
it "shows the right start date and due date" do
start_date = milestone.start_date.strftime("%F")
due_date = milestone.due_date.strftime("%F")
expect(page).to have_field(with: start_date)
expect(page).to have_field(with: due_date)
end
end
...@@ -14,4 +14,28 @@ describe 'User page' do ...@@ -14,4 +14,28 @@ describe 'User page' do
expect(page).to have_link('Snippets') expect(page).to have_link('Snippets')
end end
end end
context 'signup disabled' do
it 'shows the sign in link' do
stub_application_setting(signup_enabled: false)
visit(user_path(user))
page.within '.navbar-nav' do
expect(page).to have_link('Sign in')
end
end
end
context 'signup enabled' do
it 'shows the sign in and register link' do
stub_application_setting(signup_enabled: true)
visit(user_path(user))
page.within '.navbar-nav' do
expect(page).to have_link('Sign in / Register')
end
end
end
end end
...@@ -13,7 +13,7 @@ describe('InlineDiffView', () => { ...@@ -13,7 +13,7 @@ describe('InlineDiffView', () => {
beforeEach(() => { beforeEach(() => {
const diffFile = getDiffFileMock(); const diffFile = getDiffFileMock();
store.dispatch('setInlineDiffViewType'); store.dispatch('diffs/setInlineDiffViewType');
component = createComponentWithStore(Vue.extend(InlineDiffView), store, { component = createComponentWithStore(Vue.extend(InlineDiffView), store, {
diffFile, diffFile,
diffLines: diffFile.highlightedDiffLines, diffLines: diffFile.highlightedDiffLines,
......
...@@ -53,6 +53,47 @@ describe Gitlab::GitalyClient::OperationService do ...@@ -53,6 +53,47 @@ describe Gitlab::GitalyClient::OperationService do
end end
end end
describe '#user_update_branch' do
let(:branch_name) { 'my-branch' }
let(:newrev) { '01e' }
let(:oldrev) { '01d' }
let(:request) do
Gitaly::UserUpdateBranchRequest.new(
repository: repository.gitaly_repository,
branch_name: branch_name,
newrev: newrev,
oldrev: oldrev,
user: gitaly_user
)
end
let(:response) { Gitaly::UserUpdateBranchResponse.new }
subject { client.user_update_branch(branch_name, user, newrev, oldrev) }
it 'sends a user_update_branch message' do
expect_any_instance_of(Gitaly::OperationService::Stub)
.to receive(:user_update_branch).with(request, kind_of(Hash))
.and_return(response)
subject
end
context "when pre_receive_error is present" do
let(:response) do
Gitaly::UserUpdateBranchResponse.new(pre_receive_error: "something failed")
end
it "throws a PreReceive exception" do
expect_any_instance_of(Gitaly::OperationService::Stub)
.to receive(:user_update_branch).with(request, kind_of(Hash))
.and_return(response)
expect { subject }.to raise_error(
Gitlab::Git::PreReceiveError, "something failed")
end
end
end
describe '#user_delete_branch' do describe '#user_delete_branch' do
let(:branch_name) { 'my-branch' } let(:branch_name) { 'my-branch' }
let(:request) do let(:request) do
......
...@@ -27,9 +27,9 @@ describe Gitlab::GithubImport::Importer::PullRequestsImporter do ...@@ -27,9 +27,9 @@ describe Gitlab::GithubImport::Importer::PullRequestsImporter do
milestone: double(:milestone, number: 4), milestone: double(:milestone, number: 4),
user: double(:user, id: 4, login: 'alice'), user: double(:user, id: 4, login: 'alice'),
assignee: double(:user, id: 4, login: 'alice'), assignee: double(:user, id: 4, login: 'alice'),
created_at: Time.zone.now, created_at: 1.second.ago,
updated_at: Time.zone.now, updated_at: 1.second.ago,
merged_at: Time.zone.now merged_at: 1.second.ago
) )
end end
......
...@@ -75,6 +75,33 @@ describe Gitlab::Middleware::Multipart do ...@@ -75,6 +75,33 @@ describe Gitlab::Middleware::Multipart do
it_behaves_like 'multipart upload files' it_behaves_like 'multipart upload files'
end end
it 'allows symlinks for uploads dir' do
Tempfile.open('two-levels') do |tempfile|
symlinked_dir = '/some/dir/uploads'
symlinked_path = File.join(symlinked_dir, File.basename(tempfile.path))
env = post_env({ 'file' => symlinked_path }, { 'file.name' => original_filename, 'file.path' => symlinked_path }, Gitlab::Workhorse.secret, 'gitlab-workhorse')
allow(FileUploader).to receive(:root).and_return(symlinked_dir)
allow(UploadedFile).to receive(:allowed_paths).and_return([symlinked_dir, Gitlab.config.uploads.storage_path])
allow(File).to receive(:realpath).and_call_original
allow(File).to receive(:realpath).with(symlinked_dir).and_return(Dir.tmpdir)
allow(File).to receive(:realpath).with(symlinked_path).and_return(tempfile.path)
allow(File).to receive(:exist?).and_call_original
allow(File).to receive(:exist?).with(symlinked_dir).and_return(true)
# override Dir.tmpdir because this dir is in the list of allowed paths
# and it would match FileUploader.root path (which in this test is linked
# to /tmp too)
allow(Dir).to receive(:tmpdir).and_return(File.join(Dir.tmpdir, 'tmpsubdir'))
expect(app).to receive(:call) do |env|
expect(Rack::Request.new(env).params['file']).to be_a(::UploadedFile)
end
middleware.call(env)
end
end
def post_env(rewritten_fields, params, secret, issuer) def post_env(rewritten_fields, params, secret, issuer)
token = JWT.encode({ 'iss' => issuer, 'rewritten_fields' => rewritten_fields }, secret, 'HS256') token = JWT.encode({ 'iss' => issuer, 'rewritten_fields' => rewritten_fields }, secret, 'HS256')
Rack::MockRequest.env_for( Rack::MockRequest.env_for(
......
...@@ -263,6 +263,7 @@ describe Ci::Build do ...@@ -263,6 +263,7 @@ describe Ci::Build do
context 'artifacts metadata does not exist' do context 'artifacts metadata does not exist' do
before do before do
build.update(legacy_artifacts_metadata: nil) build.update(legacy_artifacts_metadata: nil)
<<<<<<< HEAD
end end
it { is_expected.to be_falsy } it { is_expected.to be_falsy }
...@@ -281,6 +282,8 @@ describe Ci::Build do ...@@ -281,6 +282,8 @@ describe Ci::Build do
context 'artifacts metadata does not exist' do context 'artifacts metadata does not exist' do
before do before do
build.update(legacy_artifacts_metadata: nil) build.update(legacy_artifacts_metadata: nil)
=======
>>>>>>> upstream/master
end end
it { is_expected.to be_falsy } it { is_expected.to be_falsy }
......
...@@ -2564,7 +2564,13 @@ describe User do ...@@ -2564,7 +2564,13 @@ describe User do
it 'changes the namespace (just to compare to when username is not changed)' do it 'changes the namespace (just to compare to when username is not changed)' do
expect do expect do
<<<<<<< HEAD
user.update!(username: new_username) user.update!(username: new_username)
=======
Timecop.freeze(1.second.from_now) do
user.update!(username: new_username)
end
>>>>>>> upstream/master
end.to change { user.namespace.updated_at } end.to change { user.namespace.updated_at }
end end
......
...@@ -100,7 +100,11 @@ describe Ci::RetryBuildService do ...@@ -100,7 +100,11 @@ describe Ci::RetryBuildService do
end end
describe '#execute' do describe '#execute' do
let(:new_build) { service.execute(build) } let(:new_build) do
Timecop.freeze(1.second.from_now) do
service.execute(build)
end
end
context 'when user has ability to execute build' do context 'when user has ability to execute build' do
before do before do
...@@ -150,7 +154,11 @@ describe Ci::RetryBuildService do ...@@ -150,7 +154,11 @@ describe Ci::RetryBuildService do
end end
describe '#reprocess' do describe '#reprocess' do
let(:new_build) { service.reprocess!(build) } let(:new_build) do
Timecop.freeze(1.second.from_now) do
service.reprocess!(build)
end
end
context 'when user has ability to execute build' do context 'when user has ability to execute build' do
before do before do
......
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