From d79e20e8ab44b88a42c5847435fa9c72a76e0c33 Mon Sep 17 00:00:00 2001 From: samdbeckham Date: Fri, 8 Jun 2018 11:47:30 +0100 Subject: Adds the white color back to the alret banners --- app/assets/stylesheets/bootstrap_migration.scss | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/bootstrap_migration.scss b/app/assets/stylesheets/bootstrap_migration.scss index 8183664c352..5a79b51f34b 100644 --- a/app/assets/stylesheets/bootstrap_migration.scss +++ b/app/assets/stylesheets/bootstrap_migration.scss @@ -160,6 +160,11 @@ table { } } +.alert-warning, +.alert-warning .alert-link { + color: $white-light; +} + // Polyfill deprecated selectors .hidden { @@ -271,4 +276,4 @@ pre code { input[type=color].form-control { height: $input-height; -} +} \ No newline at end of file -- cgit v1.2.1 From 5512c214de2fa1d67a56e387ea73a12858e1d6ab Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Fri, 8 Jun 2018 10:51:25 +0000 Subject: Ensure --zone is passed to all gcloud commands for auto devops cluster specs --- qa/qa/service/kubernetes_cluster.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/qa/qa/service/kubernetes_cluster.rb b/qa/qa/service/kubernetes_cluster.rb index 604bc522983..71dcad7ed57 100644 --- a/qa/qa/service/kubernetes_cluster.rb +++ b/qa/qa/service/kubernetes_cluster.rb @@ -20,9 +20,11 @@ module QA gcloud container clusters create #{cluster_name} --enable-legacy-authorization - --zone us-central1-a + --zone #{gcloud_zone} && gcloud container clusters - get-credentials #{cluster_name} + get-credentials + --zone #{gcloud_zone} + #{cluster_name} CMD @api_url = `kubectl config view --minify -o jsonpath='{.clusters[].cluster.server}'` @@ -32,7 +34,12 @@ module QA end def remove! - shell("gcloud container clusters delete #{cluster_name} --quiet --async") + shell <<~CMD.tr("\n", ' ') + gcloud container clusters delete + --zone #{gcloud_zone} + #{cluster_name} + --quiet --async + CMD end private @@ -61,6 +68,10 @@ module QA ensure gcloud_account_key && gcloud_account_key.unlink end + + def gcloud_zone + ENV.fetch('GCLOUD_ZONE') + end end end end -- cgit v1.2.1 From d2c4b7471f3441ddd7da282f9826b80ae7a22379 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Fri, 8 Jun 2018 14:18:50 +0200 Subject: Explicitly require pathname in QA steps --- qa/qa/factory/repository/push.rb | 2 ++ qa/qa/specs/features/project/auto_devops_spec.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/qa/qa/factory/repository/push.rb b/qa/qa/factory/repository/push.rb index 28711c12701..b0ed6654952 100644 --- a/qa/qa/factory/repository/push.rb +++ b/qa/qa/factory/repository/push.rb @@ -1,3 +1,5 @@ +require 'pathname' + module QA module Factory module Repository diff --git a/qa/qa/specs/features/project/auto_devops_spec.rb b/qa/qa/specs/features/project/auto_devops_spec.rb index f3f59d33457..202a847d1a5 100644 --- a/qa/qa/specs/features/project/auto_devops_spec.rb +++ b/qa/qa/specs/features/project/auto_devops_spec.rb @@ -1,3 +1,5 @@ +require 'pathname' + module QA feature 'Auto Devops', :kubernetes do after do -- cgit v1.2.1 From a81c9bc84c777561e1ca7b195b8ca60013693880 Mon Sep 17 00:00:00 2001 From: Takuya Noguchi Date: Fri, 8 Jun 2018 23:27:49 +0900 Subject: Make avatars/icons hidden on mobile --- app/assets/stylesheets/framework/timeline.scss | 4 ++-- changelogs/unreleased/47604-avatars-and-system-icons-for-mobile.yml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/47604-avatars-and-system-icons-for-mobile.yml diff --git a/app/assets/stylesheets/framework/timeline.scss b/app/assets/stylesheets/framework/timeline.scss index 75c11590547..dfb145debe7 100644 --- a/app/assets/stylesheets/framework/timeline.scss +++ b/app/assets/stylesheets/framework/timeline.scss @@ -4,7 +4,7 @@ padding: 0; &::before { - @include notes-media('max', map-get($grid-breakpoints, xs)) { + @include notes-media('max', map-get($grid-breakpoints, sm)) { background: none; } } @@ -34,7 +34,7 @@ .timeline-entry-inner { position: relative; - @include notes-media('max', map-get($grid-breakpoints, xs)) { + @include notes-media('max', map-get($grid-breakpoints, sm)) { .timeline-icon { display: none; } diff --git a/changelogs/unreleased/47604-avatars-and-system-icons-for-mobile.yml b/changelogs/unreleased/47604-avatars-and-system-icons-for-mobile.yml new file mode 100644 index 00000000000..ff66385375f --- /dev/null +++ b/changelogs/unreleased/47604-avatars-and-system-icons-for-mobile.yml @@ -0,0 +1,5 @@ +--- +title: Make avatars/icons hidden on mobile +merge_request: 19585 +author: Takuya Noguchi +type: fixed -- cgit v1.2.1 From a7fa60083c11ea838d49d77a2b53b77756b67d82 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Fri, 8 Jun 2018 08:12:48 -0700 Subject: Fix alignment of sign in/sign up button --- app/assets/stylesheets/framework/common.scss | 8 -------- app/assets/stylesheets/framework/header.scss | 6 +++++- app/assets/stylesheets/pages/search.scss | 2 +- app/views/layouts/header/_default.html.haml | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/framework/common.scss b/app/assets/stylesheets/framework/common.scss index 996e5c1512d..e5197e27b82 100644 --- a/app/assets/stylesheets/framework/common.scss +++ b/app/assets/stylesheets/framework/common.scss @@ -305,14 +305,6 @@ img.emoji { margin-bottom: 10px; } -.btn-sign-in { - text-shadow: none; - - @include media-breakpoint-up(sm) { - margin-top: 8px; - } -} - .side-filters { fieldset { margin-bottom: 15px; diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index 6fbc624dee4..1d5bdaa8961 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -447,12 +447,16 @@ .btn-sign-in { background-color: $indigo-100; color: $indigo-900; - margin-top: 3px; font-weight: $gl-font-weight-bold; + line-height: 18px; &:hover { background-color: $white-light; } + + @include media-breakpoint-down(xs) { + margin-top: $gl-padding-4; + } } .navbar-nav { diff --git a/app/assets/stylesheets/pages/search.scss b/app/assets/stylesheets/pages/search.scss index 5f15795a8e3..765c926751a 100644 --- a/app/assets/stylesheets/pages/search.scss +++ b/app/assets/stylesheets/pages/search.scss @@ -29,7 +29,7 @@ input[type="checkbox"]:hover { } .search { - margin: 4px 8px 0; + margin: 0 8px; form { @extend .form-control; diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 1bca837a311..5cec443e969 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -61,7 +61,7 @@ - if header_link?(:sign_in) %li.nav-item %div - = link_to "Sign in / Register", new_session_path(:user, redirect_to_referer: 'yes'), class: 'nav-link btn btn-sign-in' + = link_to "Sign in / Register", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in' %button.navbar-toggler.d-block.d-sm-none{ type: 'button' } %span.sr-only Toggle navigation -- cgit v1.2.1 From 566caff73196e001381ea68fc11ed3a97f0b92b5 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Sat, 9 Jun 2018 01:35:29 +0800 Subject: Add render_if_exists to variable env scope --- app/views/ci/variables/_variable_row.html.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/ci/variables/_variable_row.html.haml b/app/views/ci/variables/_variable_row.html.haml index 571eb28f195..6ee55836dd2 100644 --- a/app/views/ci/variables/_variable_row.html.haml +++ b/app/views/ci/variables/_variable_row.html.haml @@ -43,5 +43,6 @@ %span.toggle-icon = sprite_icon('status_success_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-checked') = sprite_icon('status_failed_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-unchecked') + = render_if_exists 'ci/variables/environment_scope', form_field: form_field, variable: variable %button.js-row-remove-button.ci-variable-row-remove-button{ type: 'button', 'aria-label': s_('CiVariables|Remove variable row') } = icon('minus-circle') -- cgit v1.2.1 From 19020d3cb3655928529bda9294aa4e51a5149eef Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Fri, 8 Jun 2018 18:00:51 +0000 Subject: Remove unnecessary and broken example The example provided was broken because it mistakes a bug for a regression. It is not needed for clarity anyway. The milestone part is no longer relevant as well. --- PROCESS.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PROCESS.md b/PROCESS.md index 7438df8014b..958bc7b9edc 100644 --- a/PROCESS.md +++ b/PROCESS.md @@ -185,11 +185,7 @@ next patch release. If a merge request is to be picked into more than one release it will need one `Pick into X.Y` label per release where the merge request should be back-ported -to. - -For example, if the current patch release is `10.1.1` and a regression fix needs -to be backported down to the `9.5` release, you will need to assign it the -`10.1` milestone and the following labels: +to. For example: - `Pick into 10.1` - `Pick into 10.0` -- cgit v1.2.1 From f8693f2cb48be2d9171b03cfa4ddb5ded00e7632 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Fri, 8 Jun 2018 11:58:30 -0700 Subject: Override BS4 pagination variables --- app/assets/stylesheets/framework/pagination.scss | 8 ++++++++ app/assets/stylesheets/framework/variables.scss | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/app/assets/stylesheets/framework/pagination.scss b/app/assets/stylesheets/framework/pagination.scss index 50a1b1c446d..61d02511ff4 100644 --- a/app/assets/stylesheets/framework/pagination.scss +++ b/app/assets/stylesheets/framework/pagination.scss @@ -4,3 +4,11 @@ text-decoration: none; } } + +.page-item { + &.active { + .page-link { + z-index: 3; + } + } +} diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss index 497261f938f..63328b34edc 100644 --- a/app/assets/stylesheets/framework/variables.scss +++ b/app/assets/stylesheets/framework/variables.scss @@ -434,6 +434,22 @@ $gl-btn-horz-padding: 12px; $badge-bg: rgba(0, 0, 0, 0.07); $badge-color: $gl-text-color-secondary; +/* +* Pagination +*/ +$pagination-padding-y: 6px; +$pagination-padding-x: 16px; +$pagination-line-height: 20px; +$pagination-border-color: $border-color; +$pagination-active-bg: $blue-600; +$pagination-active-border-color: $blue-600; +$pagination-hover-bg: $blue-50; +$pagination-hover-border-color: $border-color; +$pagination-hover-color: $gl-text-color; +$pagination-disabled-color: #cdcdcd; +$pagination-disabled-bg: $gray-light; +$pagination-disabled-border-color: $border-color; + /* * Status icons */ -- cgit v1.2.1 From e67d9d4534deffd4a4498440388e75c34fb9e8c9 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 8 Jun 2018 11:54:48 -0500 Subject: Fix contribution section aligment --- app/views/shared/issuable/form/_contribution.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/shared/issuable/form/_contribution.html.haml b/app/views/shared/issuable/form/_contribution.html.haml index 519b5fae846..bc9a1edc39c 100644 --- a/app/views/shared/issuable/form/_contribution.html.haml +++ b/app/views/shared/issuable/form/_contribution.html.haml @@ -7,11 +7,11 @@ %hr -.form-group - .col-form-label +.form-group.row + %label.col-form-label.col-sm-2 = _('Contribution') .col-sm-10 - .form-check + .form-check.prepend-top-5 = form.check_box :allow_collaboration, disabled: !issuable.can_allow_collaboration?(current_user), class: 'form-check-input' = form.label :allow_collaboration, class: 'form-check-label' do = _('Allow commits from members who can merge to the target branch.') -- cgit v1.2.1 From 1610713cee0ae2e4a510365f3f655c32580316e9 Mon Sep 17 00:00:00 2001 From: tauriedavis Date: Fri, 8 Jun 2018 14:35:03 -0700 Subject: Fix styling of revert MR modal --- app/views/projects/commit/_change.html.haml | 7 ++++--- app/views/shared/_new_merge_request_checkbox.html.haml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/projects/commit/_change.html.haml b/app/views/projects/commit/_change.html.haml index 30605927fd1..49ce126576f 100644 --- a/app/views/projects/commit/_change.html.haml +++ b/app/views/projects/commit/_change.html.haml @@ -20,11 +20,12 @@ %span{ "aria-hidden": true } × .modal-body - if description - %p.append-bottom-20= description + %p= description = form_tag [type.underscore, @project.namespace.becomes(Namespace), @project, commit], method: :post, remote: false, class: "js-#{type}-form js-requires-input" do .form-group.row.branch - = label_tag 'start_branch', branch_label, class: 'col-form-label col-sm-2' - .col-sm-10 + .col-sm-12 + = label_tag 'start_branch', branch_label, class: 'label-light' + = hidden_field_tag :start_branch, @project.default_branch, id: 'start_branch' = dropdown_tag(@project.default_branch, options: { title: s_("BranchSwitcherTitle|Switch branch"), filter: true, placeholder: s_("BranchSwitcherPlaceholder|Search branches"), toggle_class: 'js-project-refs-dropdown dynamic', dropdown_class: 'dropdown-menu-selectable', data: { field_name: "start_branch", selected: @project.default_branch, start_branch: @project.default_branch, refs_url: project_branches_path(@project), submit_form_on_click: false } }) diff --git a/app/views/shared/_new_merge_request_checkbox.html.haml b/app/views/shared/_new_merge_request_checkbox.html.haml index 165109b6b70..24c0dfe247f 100644 --- a/app/views/shared/_new_merge_request_checkbox.html.haml +++ b/app/views/shared/_new_merge_request_checkbox.html.haml @@ -1,4 +1,4 @@ -.form-check +.form-check.prepend-top-8 - nonce = SecureRandom.hex = check_box_tag 'create_merge_request', 1, true, class: 'js-create-merge-request form-check-input', id: "create_merge_request-#{nonce}" = label_tag "create_merge_request-#{nonce}", class: 'form-check-label' do -- cgit v1.2.1 From 88808a1fd4f1b8ebfa90bf5a85cf618065140aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4mmerle?= Date: Mon, 11 Jun 2018 09:21:04 +0200 Subject: Replace ... with ellipsis in placeholders --- .../javascripts/issue_show/components/fields/description.vue | 2 +- app/assets/javascripts/notes/components/comment_form.vue | 2 +- app/assets/javascripts/notes/components/note_form.vue | 2 +- app/views/projects/releases/edit.html.haml | 2 +- app/views/projects/tags/new.html.haml | 2 +- app/views/projects/wikis/_form.html.haml | 2 +- app/views/shared/form_elements/_description.html.haml | 2 +- app/views/shared/notes/_edit_form.html.haml | 2 +- app/views/shared/notes/_form.html.haml | 2 +- locale/gitlab.pot | 8 ++++---- spec/javascripts/notes/components/comment_form_spec.js | 2 +- spec/javascripts/notes/components/note_app_spec.js | 4 ++-- spec/javascripts/notes/components/note_form_spec.js | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/assets/javascripts/issue_show/components/fields/description.vue b/app/assets/javascripts/issue_show/components/fields/description.vue index d9fa2764d65..33110d27050 100644 --- a/app/assets/javascripts/issue_show/components/fields/description.vue +++ b/app/assets/javascripts/issue_show/components/fields/description.vue @@ -58,7 +58,7 @@ v-model="formState.description" ref="textarea" slot="textarea" - placeholder="Write a comment or drag your files here..." + placeholder="Write a comment or drag your files here…" @keydown.meta.enter="updateIssuable" @keydown.ctrl.enter="updateIssuable"> diff --git a/app/assets/javascripts/notes/components/comment_form.vue b/app/assets/javascripts/notes/components/comment_form.vue index 72d7e22fba0..17943d7abfb 100644 --- a/app/assets/javascripts/notes/components/comment_form.vue +++ b/app/assets/javascripts/notes/components/comment_form.vue @@ -361,7 +361,7 @@ js-gfm-input js-autosize markdown-area js-vue-textarea" ref="textarea" slot="textarea" :disabled="isSubmitting" - placeholder="Write a comment or drag your files here..." + placeholder="Write a comment or drag your files here…" @keydown.up="editCurrentUserLastNote()" @keydown.meta.enter="handleSave()" @keydown.ctrl.enter="handleSave()"> diff --git a/app/assets/javascripts/notes/components/note_form.vue b/app/assets/javascripts/notes/components/note_form.vue index c59a2e7a406..93b66986958 100644 --- a/app/assets/javascripts/notes/components/note_form.vue +++ b/app/assets/javascripts/notes/components/note_form.vue @@ -173,7 +173,7 @@ js-autosize markdown-area js-vue-issue-note-form js-vue-textarea" v-model="updatedNoteBody" ref="textarea" slot="textarea" - placeholder="Write a comment or drag your files here..." + placeholder="Write a comment or drag your files here…" @keydown.meta.enter="handleUpdate()" @keydown.ctrl.enter="handleUpdate()" @keydown.up="editMyLastNote()" diff --git a/app/views/projects/releases/edit.html.haml b/app/views/projects/releases/edit.html.haml index b4787032966..d6f758608a0 100644 --- a/app/views/projects/releases/edit.html.haml +++ b/app/views/projects/releases/edit.html.haml @@ -13,7 +13,7 @@ = form_for(@release, method: :put, url: project_tag_release_path(@project, @tag.name), html: { class: 'common-note-form release-form js-quick-submit' }) do |f| = render layout: 'projects/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do - = render 'projects/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: "Write your release notes or drag files here..." + = render 'projects/zen', f: f, attr: :description, classes: 'note-textarea', placeholder: "Write your release notes or drag files here…" = render 'shared/notes/hints' .error-alert .prepend-top-default diff --git a/app/views/projects/tags/new.html.haml b/app/views/projects/tags/new.html.haml index b596748ca5f..da822ac5675 100644 --- a/app/views/projects/tags/new.html.haml +++ b/app/views/projects/tags/new.html.haml @@ -36,7 +36,7 @@ = label_tag :release_description, s_('TagsPage|Release notes'), class: 'col-form-label col-sm-2' .col-sm-10 = render layout: 'projects/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do - = render 'projects/zen', attr: :release_description, classes: 'note-textarea', placeholder: s_('TagsPage|Write your release notes or drag files here...'), current_text: @release_description + = render 'projects/zen', attr: :release_description, classes: 'note-textarea', placeholder: s_('TagsPage|Write your release notes or drag files here…'), current_text: @release_description = render 'shared/notes/hints' .form-text.text-muted = s_('TagsPage|Optionally, add release notes to the tag. They will be stored in the GitLab database and displayed on the tags page.') diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index bcceb69954a..26fe1de31fe 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -25,7 +25,7 @@ .col-sm-12= f.label :content, class: 'control-label-full-width' .col-sm-12 = render layout: 'projects/md_preview', locals: { url: project_wiki_preview_markdown_path(@project, @page.slug) } do - = render 'projects/zen', f: f, attr: :content, classes: 'note-textarea', placeholder: s_("WikiPage|Write your content or drag files here...") + = render 'projects/zen', f: f, attr: :content, classes: 'note-textarea', placeholder: s_("WikiPage|Write your content or drag files here…") = render 'shared/notes/hints' .clearfix diff --git a/app/views/shared/form_elements/_description.html.haml b/app/views/shared/form_elements/_description.html.haml index e5dfa7dbf71..25df2fe5cd6 100644 --- a/app/views/shared/form_elements/_description.html.haml +++ b/app/views/shared/form_elements/_description.html.haml @@ -16,7 +16,7 @@ = render layout: 'projects/md_preview', locals: { url: preview_url, referenced_users: true } do = render 'projects/zen', f: form, attr: :description, classes: 'note-textarea qa-issuable-form-description', - placeholder: "Write a comment or drag your files here...", + placeholder: "Write a comment or drag your files here…", supports_quick_actions: supports_quick_actions = render 'shared/notes/hints', supports_quick_actions: supports_quick_actions .clearfix diff --git a/app/views/shared/notes/_edit_form.html.haml b/app/views/shared/notes/_edit_form.html.haml index 8923e5602a4..71a5b94e958 100644 --- a/app/views/shared/notes/_edit_form.html.haml +++ b/app/views/shared/notes/_edit_form.html.haml @@ -3,7 +3,7 @@ = hidden_field_tag :target_id, '', class: 'js-form-target-id' = hidden_field_tag :target_type, '', class: 'js-form-target-type' = render layout: 'projects/md_preview', locals: { url: preview_markdown_path(project), referenced_users: true } do - = render 'projects/zen', attr: 'note[note]', classes: 'note-textarea js-note-text js-task-list-field', placeholder: "Write a comment or drag your files here..." + = render 'projects/zen', attr: 'note[note]', classes: 'note-textarea js-note-text js-task-list-field', placeholder: "Write a comment or drag your files here…" = render 'shared/notes/hints' .note-form-actions.clearfix diff --git a/app/views/shared/notes/_form.html.haml b/app/views/shared/notes/_form.html.haml index 71c0d740bc8..c360f1ffe2a 100644 --- a/app/views/shared/notes/_form.html.haml +++ b/app/views/shared/notes/_form.html.haml @@ -29,7 +29,7 @@ = render 'projects/zen', f: f, attr: :note, classes: 'note-textarea js-note-text', - placeholder: "Write a comment or drag your files here...", + placeholder: "Write a comment or drag your files here…", supports_quick_actions: supports_quick_actions, supports_autocomplete: supports_autocomplete = render 'shared/notes/hints', supports_quick_actions: supports_quick_actions diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 946669068cd..ba3d8f8a1e3 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: gitlab 1.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-08 18:19+0200\n" -"PO-Revision-Date: 2018-06-08 18:19+0200\n" +"POT-Creation-Date: 2018-06-11 09:18+0200\n" +"PO-Revision-Date: 2018-06-11 09:18+0200\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -4106,7 +4106,7 @@ msgstr "" msgid "TagsPage|Use git tag command to add a new one:" msgstr "" -msgid "TagsPage|Write your release notes or drag files here..." +msgid "TagsPage|Write your release notes or drag files here…" msgstr "" msgid "TagsPage|protected" @@ -4803,7 +4803,7 @@ msgstr "" msgid "WikiPage|Page slug" msgstr "" -msgid "WikiPage|Write your content or drag files here..." +msgid "WikiPage|Write your content or drag files here…" msgstr "" msgid "Wiki|Create Page" diff --git a/spec/javascripts/notes/components/comment_form_spec.js b/spec/javascripts/notes/components/comment_form_spec.js index 224debbeff6..a7d1e4331eb 100644 --- a/spec/javascripts/notes/components/comment_form_spec.js +++ b/spec/javascripts/notes/components/comment_form_spec.js @@ -84,7 +84,7 @@ describe('issue_comment_form component', () => { it('should render textarea with placeholder', () => { expect( vm.$el.querySelector('.js-main-target-form textarea').getAttribute('placeholder'), - ).toEqual('Write a comment or drag your files here...'); + ).toEqual('Write a comment or drag your files here…'); }); it('should make textarea disabled while requesting', (done) => { diff --git a/spec/javascripts/notes/components/note_app_spec.js b/spec/javascripts/notes/components/note_app_spec.js index 0e792eee5e9..d494c63ff11 100644 --- a/spec/javascripts/notes/components/note_app_spec.js +++ b/spec/javascripts/notes/components/note_app_spec.js @@ -106,7 +106,7 @@ describe('note_app', () => { expect(vm.$el.querySelector('.js-main-target-form').tagName).toEqual('FORM'); expect( vm.$el.querySelector('.js-main-target-form textarea').getAttribute('placeholder'), - ).toEqual('Write a comment or drag your files here...'); + ).toEqual('Write a comment or drag your files here…'); }); it('should render form comment button as disabled', () => { @@ -129,7 +129,7 @@ describe('note_app', () => { expect(vm.$el.querySelector('.js-main-target-form').tagName).toEqual('FORM'); expect( vm.$el.querySelector('.js-main-target-form textarea').getAttribute('placeholder'), - ).toEqual('Write a comment or drag your files here...'); + ).toEqual('Write a comment or drag your files here…'); }); }); diff --git a/spec/javascripts/notes/components/note_form_spec.js b/spec/javascripts/notes/components/note_form_spec.js index f841a408d09..413d4f69434 100644 --- a/spec/javascripts/notes/components/note_form_spec.js +++ b/spec/javascripts/notes/components/note_form_spec.js @@ -49,7 +49,7 @@ describe('issue_note_form component', () => { it('should render text area with placeholder', () => { expect( vm.$el.querySelector('textarea').getAttribute('placeholder'), - ).toEqual('Write a comment or drag your files here...'); + ).toEqual('Write a comment or drag your files here…'); }); it('should link to markdown docs', () => { -- cgit v1.2.1 From bd40a8d4a4adb4c138c8218dea12c674dec501bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4mmerle?= Date: Mon, 11 Jun 2018 10:38:07 +0200 Subject: Update theme-gray-600 and gl-text-color-tertiary --- app/assets/stylesheets/framework/variables.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss index 497261f938f..e669bd3ec91 100644 --- a/app/assets/stylesheets/framework/variables.scss +++ b/app/assets/stylesheets/framework/variables.scss @@ -99,7 +99,7 @@ $theme-gray-200: #dfdfdf; $theme-gray-300: #cccccc; $theme-gray-400: #bababa; $theme-gray-500: #a7a7a7; -$theme-gray-600: #949494; +$theme-gray-600: #919191; $theme-gray-700: #707070; $theme-gray-800: #4f4f4f; $theme-gray-900: #2e2e2e; @@ -191,7 +191,7 @@ $gl-font-weight-normal: 400; $gl-font-weight-bold: 600; $gl-text-color: #2e2e2e; $gl-text-color-secondary: #707070; -$gl-text-color-tertiary: #949494; +$gl-text-color-tertiary: #919191; $gl-text-color-quaternary: #d6d6d6; $gl-text-color-inverted: rgba(255, 255, 255, 1); $gl-text-color-secondary-inverted: rgba(255, 255, 255, 0.85); -- cgit v1.2.1 From 1eb5d0ce8ddc49c012194a0f57e21bb80e9a7547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4mmerle?= Date: Mon, 11 Jun 2018 10:44:43 +0200 Subject: Fix input placeholder text color --- app/assets/stylesheets/framework/forms.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/framework/forms.scss b/app/assets/stylesheets/framework/forms.scss index c76ea532912..03520f42997 100644 --- a/app/assets/stylesheets/framework/forms.scss +++ b/app/assets/stylesheets/framework/forms.scss @@ -170,7 +170,7 @@ label { } .form-control::-webkit-input-placeholder { - color: $gl-text-color-secondary; + color: $placeholder-text-color; } .input-group { -- cgit v1.2.1 From 1dca45ff9670d0bd7cc0b2f3cbe23a8b4a809453 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Mon, 11 Jun 2018 11:31:33 +0200 Subject: Move ENV variables to Runtime::Env for auto devops QA --- qa/qa/runtime/env.rb | 12 ++++++++++++ qa/qa/service/kubernetes_cluster.rb | 14 +++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index fe432edfa2a..81d00d45753 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -46,6 +46,18 @@ module QA def sandbox_name ENV['GITLAB_SANDBOX_NAME'] end + + def gcloud_account_key + ENV.fetch("GCLOUD_ACCOUNT_KEY") + end + + def gcloud_account_email + ENV.fetch("GCLOUD_ACCOUNT_EMAIL") + end + + def gcloud_zone + ENV.fetch('GCLOUD_ZONE') + end end end end diff --git a/qa/qa/service/kubernetes_cluster.rb b/qa/qa/service/kubernetes_cluster.rb index 71dcad7ed57..7627c8c7ad9 100644 --- a/qa/qa/service/kubernetes_cluster.rb +++ b/qa/qa/service/kubernetes_cluster.rb @@ -20,10 +20,10 @@ module QA gcloud container clusters create #{cluster_name} --enable-legacy-authorization - --zone #{gcloud_zone} + --zone #{Runtime::Env.gcloud_zone} && gcloud container clusters get-credentials - --zone #{gcloud_zone} + --zone #{Runtime::Env.gcloud_zone} #{cluster_name} CMD @@ -36,7 +36,7 @@ module QA def remove! shell <<~CMD.tr("\n", ' ') gcloud container clusters delete - --zone #{gcloud_zone} + --zone #{Runtime::Env.gcloud_zone} #{cluster_name} --quiet --async CMD @@ -61,17 +61,13 @@ module QA def attempt_login_with_env_vars puts "No gcloud account. Attempting to login from env vars GCLOUD_ACCOUNT_EMAIL and GCLOUD_ACCOUNT_KEY." gcloud_account_key = Tempfile.new('gcloud-account-key') - gcloud_account_key.write(ENV.fetch("GCLOUD_ACCOUNT_KEY")) + gcloud_account_key.write(Runtime::Env.gcloud_account_key) gcloud_account_key.close - gcloud_account_email = ENV.fetch("GCLOUD_ACCOUNT_EMAIL") + gcloud_account_email = Runtime::Env.gcloud_account_email shell("gcloud auth activate-service-account #{gcloud_account_email} --key-file #{gcloud_account_key.path}") ensure gcloud_account_key && gcloud_account_key.unlink end - - def gcloud_zone - ENV.fetch('GCLOUD_ZONE') - end end end end -- cgit v1.2.1 From 25992924a7aa7d09e99d316c1cc5902908b355c6 Mon Sep 17 00:00:00 2001 From: samdbeckham Date: Mon, 11 Jun 2018 11:52:36 +0100 Subject: Sets the colors and link colors in alerts/notices --- app/assets/stylesheets/bootstrap_migration.scss | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/bootstrap_migration.scss b/app/assets/stylesheets/bootstrap_migration.scss index 5a79b51f34b..2c785b3ad76 100644 --- a/app/assets/stylesheets/bootstrap_migration.scss +++ b/app/assets/stylesheets/bootstrap_migration.scss @@ -160,11 +160,6 @@ table { } } -.alert-warning, -.alert-warning .alert-link { - color: $white-light; -} - // Polyfill deprecated selectors .hidden { @@ -267,13 +262,20 @@ pre code { .alert-danger { background-color: $red-500; border-color: $red-500; +} + +.alert-warning, +.alert-danger, +.flash-notice { color: $white-light; - h4 { + h4, + a, + .alert-link { color: $white-light; } } input[type=color].form-control { height: $input-height; -} \ No newline at end of file +} -- cgit v1.2.1 From 8d6b4a9d9e2888e64cac41e5c016ac3835415076 Mon Sep 17 00:00:00 2001 From: samdbeckham Date: Mon, 11 Jun 2018 12:00:03 +0100 Subject: Removes the border-radius from the alerts --- app/assets/stylesheets/bootstrap_migration.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/bootstrap_migration.scss b/app/assets/stylesheets/bootstrap_migration.scss index 2c785b3ad76..27f3150d2ad 100644 --- a/app/assets/stylesheets/bootstrap_migration.scss +++ b/app/assets/stylesheets/bootstrap_migration.scss @@ -267,6 +267,7 @@ pre code { .alert-warning, .alert-danger, .flash-notice { + border-radius: 0; color: $white-light; h4, -- cgit v1.2.1 From 6defeb0a7d6928ad32d4d7a2fa35d0d71dbb9dea Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 9 Jun 2018 22:35:06 -0700 Subject: Expire Wiki content cache after importing a repository The cache state for Wikis that were imported via GitHub or Bitbucket does not appear to have been flushed after a successful import. Closes #47546 --- app/models/project.rb | 1 + changelogs/unreleased/sh-expire-content-cache-after-import.yml | 5 +++++ lib/gitlab/github_import/sequential_importer.rb | 2 -- lib/tasks/import.rake | 2 +- spec/lib/gitlab/github_import/sequential_importer_spec.rb | 1 - spec/models/project_spec.rb | 3 ++- 6 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 changelogs/unreleased/sh-expire-content-cache-after-import.yml diff --git a/app/models/project.rb b/app/models/project.rb index 60cd13b371f..bc91b0aa1b0 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1615,6 +1615,7 @@ class Project < ActiveRecord::Base def after_import repository.after_import + wiki.repository.after_import import_finish remove_import_jid update_project_counter_caches diff --git a/changelogs/unreleased/sh-expire-content-cache-after-import.yml b/changelogs/unreleased/sh-expire-content-cache-after-import.yml new file mode 100644 index 00000000000..8876a487b86 --- /dev/null +++ b/changelogs/unreleased/sh-expire-content-cache-after-import.yml @@ -0,0 +1,5 @@ +--- +title: Expire Wiki content cache after importing a repository +merge_request: +author: +type: fixed diff --git a/lib/gitlab/github_import/sequential_importer.rb b/lib/gitlab/github_import/sequential_importer.rb index 3cad919b4eb..6a181caf65d 100644 --- a/lib/gitlab/github_import/sequential_importer.rb +++ b/lib/gitlab/github_import/sequential_importer.rb @@ -42,8 +42,6 @@ module Gitlab klass.new(project, client, parallel: false).execute end - project.repository.after_import - true end end diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index aafbe52e5f8..0fd184d243f 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -50,7 +50,7 @@ class GithubImport end if import_success - @project.import_finish + @project.after_import puts "Import finished. Timings: #{timings}".color(:green) else puts "Import was not successful. Errors were as follows:" diff --git a/spec/lib/gitlab/github_import/sequential_importer_spec.rb b/spec/lib/gitlab/github_import/sequential_importer_spec.rb index 6089b0b751f..05d3243f806 100644 --- a/spec/lib/gitlab/github_import/sequential_importer_spec.rb +++ b/spec/lib/gitlab/github_import/sequential_importer_spec.rb @@ -30,7 +30,6 @@ describe Gitlab::GithubImport::SequentialImporter do expect(instance).to receive(:execute) end - expect(repository).to receive(:after_import) expect(importer.execute).to eq(true) end end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 1a6ad3edd78..d385d617731 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -3391,10 +3391,11 @@ describe Project do end describe '#after_import' do - let(:project) { build(:project) } + let(:project) { create(:project) } it 'runs the correct hooks' do expect(project.repository).to receive(:after_import) + expect(project.wiki.repository).to receive(:after_import) expect(project).to receive(:import_finish) expect(project).to receive(:update_project_counter_caches) expect(project).to receive(:remove_import_jid) -- cgit v1.2.1 From 698515313fe38fb3f85fdeec1efa15e2c8b54cfd Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Tue, 15 May 2018 12:25:51 +0200 Subject: Fixes rejected pushes from maintainers Before the push git would make a call to `/:namespace/:project/git-receive-pack`. This would perform an access check without a ref. So the `Project#branch_allows_maintainer_push?` would return false. This adjusts `Project#branch_allows_maintainer_push?` to return true when passing no branch name if there are merge requests open that would allow the user to push. The actual check then happens when a call to `/api/v4/internal/allowed` is made from a git hook. --- app/models/project.rb | 12 ++++++++---- .../unreleased/bvl-fix-maintainer-push-rejected.yml | 6 ++++++ spec/models/project_spec.rb | 5 +++++ spec/requests/git_http_spec.rb | 17 +++++++++++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 changelogs/unreleased/bvl-fix-maintainer-push-rejected.yml diff --git a/app/models/project.rb b/app/models/project.rb index 9ca733ecd98..57da42adc28 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -2139,10 +2139,14 @@ class Project < ActiveRecord::Base check_access = -> do next false if empty_repo? - merge_request = source_of_merge_requests.opened - .where(allow_collaboration: true) - .find_by(source_branch: branch_name) - merge_request&.can_be_merged_by?(user) + merge_requests = source_of_merge_requests.opened + .where(allow_collaboration: true) + + if branch_name + merge_requests.find_by(source_branch: branch_name)&.can_be_merged_by?(user) + else + merge_requests.any? { |merge_request| merge_request.can_be_merged_by?(user) } + end end if RequestStore.active? diff --git a/changelogs/unreleased/bvl-fix-maintainer-push-rejected.yml b/changelogs/unreleased/bvl-fix-maintainer-push-rejected.yml new file mode 100644 index 00000000000..54154ad2449 --- /dev/null +++ b/changelogs/unreleased/bvl-fix-maintainer-push-rejected.yml @@ -0,0 +1,6 @@ +--- +title: Fix bug where maintainer would not be allowed to push to forks with merge requests + that have `Allow maintainer edits` enabled. +merge_request: 18968 +author: +type: fixed diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index b9a9c4ebf42..58928465f95 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -3658,6 +3658,11 @@ describe Project do .to be_truthy end + it 'allows access when there are merge requests open but no branch name is given' do + expect(project.branch_allows_collaboration?(user, nil)) + .to be_truthy + end + it 'does not allow guest users access' do guest = create(:user) target_project.add_guest(guest) diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb index 2514dab1714..92fcfb65269 100644 --- a/spec/requests/git_http_spec.rb +++ b/spec/requests/git_http_spec.rb @@ -1,6 +1,7 @@ require "spec_helper" describe 'Git HTTP requests' do + include ProjectForksHelper include TermsHelper include GitHttpHelpers include WorkhorseHelpers @@ -305,6 +306,22 @@ describe 'Git HTTP requests' do expect(response.body).to eq(change_access_error(:push_code)) end end + + context 'when merge requests are open that allow maintainer access' do + let(:canonical_project) { create(:project, :public, :repository) } + let(:project) { fork_project(canonical_project, nil, repository: true) } + + before do + canonical_project.add_master(user) + create(:merge_request, + source_project: project, + target_project: canonical_project, + source_branch: 'fixes', + allow_collaboration: true) + end + + it_behaves_like 'pushes are allowed' + end end end -- cgit v1.2.1 From fe8261fdb201ece94f7e89b09d999a37311f4588 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Mon, 11 Jun 2018 12:44:08 -0300 Subject: Add Gitlab::SQL:CTE for easily building CTE statements --- lib/gitlab/sql/cte.rb | 50 +++++++++++++++++++++++++++++++++++++++++ spec/lib/gitlab/sql/cte_spec.rb | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 lib/gitlab/sql/cte.rb create mode 100644 spec/lib/gitlab/sql/cte_spec.rb diff --git a/lib/gitlab/sql/cte.rb b/lib/gitlab/sql/cte.rb new file mode 100644 index 00000000000..f357829ba3f --- /dev/null +++ b/lib/gitlab/sql/cte.rb @@ -0,0 +1,50 @@ +module Gitlab + module SQL + # Class for easily building CTE statements. + # + # Example: + # + # cte = CTE.new(:my_cte_name) + # ns = Arel::Table.new(:namespaces) + # + # cte << Namespace. + # where(ns[:parent_id].eq(some_namespace_id)) + # + # Namespace + # with(cte.to_arel). + # from(cte.alias_to(ns)) + class CTE + attr_reader :table, :query + + # name - The name of the CTE as a String or Symbol. + def initialize(name, query) + @table = Arel::Table.new(name) + @query = query + end + + # Returns the Arel relation for this CTE. + def to_arel + sql = Arel::Nodes::SqlLiteral.new("(#{query.to_sql})") + + Arel::Nodes::As.new(table, sql) + end + + # Returns an "AS" statement that aliases the CTE name as the given table + # name. This allows one to trick ActiveRecord into thinking it's selecting + # from an actual table, when in reality it's selecting from a CTE. + # + # alias_table - The Arel table to use as the alias. + def alias_to(alias_table) + Arel::Nodes::As.new(table, alias_table) + end + + # Applies the CTE to the given relation, returning a new one that will + # query from it. + def apply_to(relation) + relation.except(:where) + .with(to_arel) + .from(alias_to(relation.model.arel_table)) + end + end + end +end diff --git a/spec/lib/gitlab/sql/cte_spec.rb b/spec/lib/gitlab/sql/cte_spec.rb new file mode 100644 index 00000000000..d6763c7b2e1 --- /dev/null +++ b/spec/lib/gitlab/sql/cte_spec.rb @@ -0,0 +1,42 @@ +require 'spec_helper' + +describe Gitlab::SQL::CTE, :postgresql do + describe '#to_arel' do + it 'generates an Arel relation for the CTE body' do + relation = User.where(id: 1) + cte = described_class.new(:cte_name, relation) + sql = cte.to_arel.to_sql + name = ActiveRecord::Base.connection.quote_table_name(:cte_name) + + sql1 = ActiveRecord::Base.connection.unprepared_statement do + relation.except(:order).to_sql + end + + expect(sql).to eq("#{name} AS (#{sql1})") + end + end + + describe '#alias_to' do + it 'returns an alias for the CTE' do + cte = described_class.new(:cte_name, nil) + table = Arel::Table.new(:kittens) + + source_name = ActiveRecord::Base.connection.quote_table_name(:cte_name) + alias_name = ActiveRecord::Base.connection.quote_table_name(:kittens) + + expect(cte.alias_to(table).to_sql).to eq("#{source_name} AS #{alias_name}") + end + end + + describe '#apply_to' do + it 'applies a CTE to an ActiveRecord::Relation' do + user = create(:user) + cte = described_class.new(:cte_name, User.where(id: user.id)) + + relation = cte.apply_to(User.all) + + expect(relation.to_sql).to match(/WITH .+cte_name/) + expect(relation.to_a).to eq(User.where(id: user.id).to_a) + end + end +end -- cgit v1.2.1 From ed3a1be1e33388f3e3560d62fd658d0cc5f972ec Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Mon, 11 Jun 2018 12:45:47 -0300 Subject: Add CHANGELOG --- changelogs/unreleased/da-port-cte-to-ce.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/da-port-cte-to-ce.yml diff --git a/changelogs/unreleased/da-port-cte-to-ce.yml b/changelogs/unreleased/da-port-cte-to-ce.yml new file mode 100644 index 00000000000..6fa759fcf7d --- /dev/null +++ b/changelogs/unreleased/da-port-cte-to-ce.yml @@ -0,0 +1,5 @@ +--- +title: Add Gitlab::SQL:CTE for easily building CTE statements +merge_request: +author: +type: added -- cgit v1.2.1 From 401c70b7bf9c29d715dd4bfe5fed0df67b8beba5 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 11 Jun 2018 15:40:07 +0100 Subject: Fix width of project avatar in Web IDE Closes #47696 --- app/assets/stylesheets/pages/repo.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/pages/repo.scss b/app/assets/stylesheets/pages/repo.scss index 3c7edb0d4bb..6e7fc50c63d 100644 --- a/app/assets/stylesheets/pages/repo.scss +++ b/app/assets/stylesheets/pages/repo.scss @@ -1129,7 +1129,7 @@ .ide-context-header { .avatar { - flex: 0 0 40px; + flex: 0 0 38px; } .ide-merge-requests-dropdown.dropdown-menu { -- cgit v1.2.1 From 96ce4ed25c7633330f82439f1f9347f6eef8568a Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 11 Jun 2018 09:47:51 -0700 Subject: Work around limitations of expect_any_instance_of by stubbing Project.find --- spec/models/project_spec.rb | 6 +++++- spec/workers/repository_fork_worker_spec.rb | 11 ++++++++--- spec/workers/repository_import_worker_spec.rb | 15 ++++++++++----- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index d385d617731..adb6ea94ac7 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1726,7 +1726,11 @@ describe Project do .with(project.repository_storage, project.disk_path, project.import_url) .and_return(true) - expect_any_instance_of(Repository).to receive(:after_import) + # Works around https://github.com/rspec/rspec-mocks/issues/910 + expect(Project).to receive(:find).with(project.id).twice.and_return(project) + expect(project.repository).to receive(:after_import) + .and_call_original + expect(project.wiki.repository).to receive(:after_import) .and_call_original end diff --git a/spec/workers/repository_fork_worker_spec.rb b/spec/workers/repository_fork_worker_spec.rb index 4b3c1736ea0..ae4786389c7 100644 --- a/spec/workers/repository_fork_worker_spec.rb +++ b/spec/workers/repository_fork_worker_spec.rb @@ -55,10 +55,15 @@ describe RepositoryForkWorker do it 'flushes various caches' do expect_fork_repository.and_return(true) - expect_any_instance_of(Repository).to receive(:expire_emptiness_caches) + # Works around https://github.com/rspec/rspec-mocks/issues/910 + expect(Project).to receive(:find).with(fork_project.id).and_return(fork_project) + expect(fork_project.repository).to receive(:expire_emptiness_caches) .and_call_original - - expect_any_instance_of(Repository).to receive(:expire_exists_cache) + expect(fork_project.repository).to receive(:expire_exists_cache) + .and_call_original + expect(fork_project.wiki.repository).to receive(:expire_emptiness_caches) + .and_call_original + expect(fork_project.wiki.repository).to receive(:expire_exists_cache) .and_call_original perform! diff --git a/spec/workers/repository_import_worker_spec.rb b/spec/workers/repository_import_worker_spec.rb index 84d1b38ef19..f0884ad0aff 100644 --- a/spec/workers/repository_import_worker_spec.rb +++ b/spec/workers/repository_import_worker_spec.rb @@ -22,8 +22,11 @@ describe RepositoryImportWorker do expect_any_instance_of(Projects::ImportService).to receive(:execute) .and_return({ status: :ok }) - expect_any_instance_of(Repository).to receive(:expire_emptiness_caches) - expect_any_instance_of(Project).to receive(:import_finish) + # Works around https://github.com/rspec/rspec-mocks/issues/910 + expect(Project).to receive(:find).with(project.id).and_return(project) + expect(project.repository).to receive(:expire_emptiness_caches) + expect(project.wiki.repository).to receive(:expire_emptiness_caches) + expect(project).to receive(:import_finish) subject.perform(project.id) end @@ -34,9 +37,11 @@ describe RepositoryImportWorker do expect_any_instance_of(Projects::ImportService).to receive(:execute) .and_return({ status: :ok }) - expect_any_instance_of(Project).to receive(:after_import).and_call_original - expect_any_instance_of(Repository).to receive(:expire_emptiness_caches) - expect_any_instance_of(Project).to receive(:import_finish) + # Works around https://github.com/rspec/rspec-mocks/issues/910 + expect(Project).to receive(:find).with(project.id).and_return(project) + expect(project.repository).to receive(:expire_emptiness_caches) + expect(project.wiki.repository).to receive(:expire_emptiness_caches) + expect(project).to receive(:import_finish) subject.perform(project.id) end -- cgit v1.2.1 From e91e6e890d1aba076451cd9ac81a981fa6adb401 Mon Sep 17 00:00:00 2001 From: Jose Date: Mon, 11 Jun 2018 11:48:26 -0500 Subject: fix styling of the gitlab import page --- app/views/import/gitlab_projects/new.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/import/gitlab_projects/new.html.haml b/app/views/import/gitlab_projects/new.html.haml index 2d059e78490..f311ac98ac6 100644 --- a/app/views/import/gitlab_projects/new.html.haml +++ b/app/views/import/gitlab_projects/new.html.haml @@ -37,6 +37,6 @@ .form-group = file_field_tag :file, class: '' .row - .form-actions + .form-actions.col-sm-12 = submit_tag 'Import project', class: 'btn btn-create' = link_to 'Cancel', new_project_path, class: 'btn btn-cancel' -- cgit v1.2.1 From f527e2656fe22f0daa02f44c5949c70ffa3d5ce1 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 12 Jun 2018 01:00:49 +0800 Subject: We already moved to png and this is no longer used --- app/assets/images/favicon-blue.ico | Bin 5430 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 app/assets/images/favicon-blue.ico diff --git a/app/assets/images/favicon-blue.ico b/app/assets/images/favicon-blue.ico deleted file mode 100644 index 156fcf07588..00000000000 Binary files a/app/assets/images/favicon-blue.ico and /dev/null differ -- cgit v1.2.1 From 1756eea5316c9d1d4b6b8a9bb45d1d2425943f5c Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 11 Jun 2018 10:05:00 -0700 Subject: Fix Rubocop failure in spec/models/project_spec.rb --- spec/models/project_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index adb6ea94ac7..24c99a7929a 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1727,7 +1727,7 @@ describe Project do .and_return(true) # Works around https://github.com/rspec/rspec-mocks/issues/910 - expect(Project).to receive(:find).with(project.id).twice.and_return(project) + expect(described_class).to receive(:find).with(project.id).twice.and_return(project) expect(project.repository).to receive(:after_import) .and_call_original expect(project.wiki.repository).to receive(:after_import) -- cgit v1.2.1 From 45254cd2ff46016eea1f048fb484acb7ddea3743 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 12 Jun 2018 01:16:53 +0800 Subject: Add NOT_FOUND: 404 from EE --- app/assets/javascripts/lib/utils/http_status.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/lib/utils/http_status.js b/app/assets/javascripts/lib/utils/http_status.js index bb151929431..229d53b18b0 100644 --- a/app/assets/javascripts/lib/utils/http_status.js +++ b/app/assets/javascripts/lib/utils/http_status.js @@ -8,4 +8,5 @@ export default { OK: 200, MULTIPLE_CHOICES: 300, BAD_REQUEST: 400, + NOT_FOUND: 404, }; -- cgit v1.2.1 From c854fe21032dd419dafcc00eec94e468823bd139 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 12 Jun 2018 01:27:06 +0800 Subject: Unify from EE for app/uploaders/object_storage.rb --- app/uploaders/object_storage.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/uploaders/object_storage.rb b/app/uploaders/object_storage.rb index 5aa1bc7227c..23b3dcf84c0 100644 --- a/app/uploaders/object_storage.rb +++ b/app/uploaders/object_storage.rb @@ -22,10 +22,10 @@ module ObjectStorage module RecordsUploads extend ActiveSupport::Concern - def prepended(base) + prepended do |base| raise "#{base} must include ObjectStorage::Concern to use extensions." unless base < Concern - base.include(RecordsUploads::Concern) + base.include(::RecordsUploads::Concern) end def retrieve_from_store!(identifier) -- cgit v1.2.1 From 28871d73ace30f5f21455cd77e38cc743968fd30 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 11 Jun 2018 08:51:56 -0700 Subject: GitHub Rake importer: Fail with a clearer explanation if GitLab username is wrong --- lib/tasks/import.rake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index aafbe52e5f8..1f185dae6fc 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -9,7 +9,10 @@ class GithubImport def initialize(token, gitlab_username, project_path, extras) @options = { token: token } @project_path = project_path - @current_user = User.find_by_username(gitlab_username) + @current_user = User.find_by(username: gitlab_username) + + raise "GitLab user #{gitlab_username} not found. Please specify a valid username." unless @current_user + @github_repo = extras.empty? ? nil : extras.first end -- cgit v1.2.1 From 2580e19812188415f6fee81cc789a0e814efaaad Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 5 Jun 2018 10:22:39 -0500 Subject: fix padding in commit info --- app/assets/stylesheets/bootstrap_migration.scss | 4 ++++ app/views/projects/commit/branches.html.haml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/bootstrap_migration.scss b/app/assets/stylesheets/bootstrap_migration.scss index 8183664c352..b73c42ceeea 100644 --- a/app/assets/stylesheets/bootstrap_migration.scss +++ b/app/assets/stylesheets/bootstrap_migration.scss @@ -213,6 +213,10 @@ table { border-bottom: 1px solid $well-inner-border; } } + + .badge.badge-gray { + background-color: $well-expand-item; + } } .card { diff --git a/app/views/projects/commit/branches.html.haml b/app/views/projects/commit/branches.html.haml index a91e31afc2b..0b8e5105bc0 100644 --- a/app/views/projects/commit/branches.html.haml +++ b/app/views/projects/commit/branches.html.haml @@ -6,7 +6,7 @@ - if @branches.any? || @tags.any? || @tags_limit_exceeded %span - = link_to "#", class: "js-details-expand label label-gray ref-name" do + = link_to "#", class: "js-details-expand badge badge-gray ref-name" do = sprite_icon('ellipsis_h', size: 12, css_class: 'vertical-align-middle') %span.js-details-content.hide = commit_branches_links(@project, @branches) -- cgit v1.2.1 From 072f9224afded08cb1c93fa0e6c077928f60cca0 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 11 Jun 2018 12:06:25 -0700 Subject: Relax expectation in spec/models/project_spec.rb Multiple Sidekiq workers can run in the spec, causing `Project.find` to be run in different places. Instead of setting a fixed number of calls, just use `allow`. --- spec/models/project_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index a7a6d0bb09c..926365e409a 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1734,7 +1734,7 @@ describe Project do .and_return(true) # Works around https://github.com/rspec/rspec-mocks/issues/910 - expect(described_class).to receive(:find).with(project.id).twice.and_return(project) + allow(described_class).to receive(:find).with(project.id).and_return(project) expect(project.repository).to receive(:after_import) .and_call_original expect(project.wiki.repository).to receive(:after_import) -- cgit v1.2.1 From c9248efc6b9d26a3e265191cdf85a0bef58d06f9 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Mon, 11 Jun 2018 14:30:47 -0500 Subject: Remove .row and .col-sm-12 --- app/views/projects/commit/_change.html.haml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/views/projects/commit/_change.html.haml b/app/views/projects/commit/_change.html.haml index 49ce126576f..3d97e93c9e9 100644 --- a/app/views/projects/commit/_change.html.haml +++ b/app/views/projects/commit/_change.html.haml @@ -22,17 +22,16 @@ - if description %p= description = form_tag [type.underscore, @project.namespace.becomes(Namespace), @project, commit], method: :post, remote: false, class: "js-#{type}-form js-requires-input" do - .form-group.row.branch - .col-sm-12 - = label_tag 'start_branch', branch_label, class: 'label-light' + .form-group.branch + = label_tag 'start_branch', branch_label, class: 'label-light' - = hidden_field_tag :start_branch, @project.default_branch, id: 'start_branch' - = dropdown_tag(@project.default_branch, options: { title: s_("BranchSwitcherTitle|Switch branch"), filter: true, placeholder: s_("BranchSwitcherPlaceholder|Search branches"), toggle_class: 'js-project-refs-dropdown dynamic', dropdown_class: 'dropdown-menu-selectable', data: { field_name: "start_branch", selected: @project.default_branch, start_branch: @project.default_branch, refs_url: project_branches_path(@project), submit_form_on_click: false } }) + = hidden_field_tag :start_branch, @project.default_branch, id: 'start_branch' + = dropdown_tag(@project.default_branch, options: { title: s_("BranchSwitcherTitle|Switch branch"), filter: true, placeholder: s_("BranchSwitcherPlaceholder|Search branches"), toggle_class: 'js-project-refs-dropdown dynamic', dropdown_class: 'dropdown-menu-selectable', data: { field_name: "start_branch", selected: @project.default_branch, start_branch: @project.default_branch, refs_url: project_branches_path(@project), submit_form_on_click: false } }) - - if can?(current_user, :push_code, @project) - = render 'shared/new_merge_request_checkbox' - - else - = hidden_field_tag 'create_merge_request', 1, id: nil + - if can?(current_user, :push_code, @project) + = render 'shared/new_merge_request_checkbox' + - else + = hidden_field_tag 'create_merge_request', 1, id: nil .form-actions = submit_tag label, class: 'btn btn-create' = link_to _("Cancel"), '#', class: "btn btn-cancel", "data-dismiss" => "modal" -- cgit v1.2.1 From 14159dc72b3a46463d17fbf4f8f4784e92e2cded Mon Sep 17 00:00:00 2001 From: Jose Date: Mon, 11 Jun 2018 12:41:48 -0500 Subject: Fix collapse sidebar button color --- app/assets/stylesheets/bootstrap_migration.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/assets/stylesheets/bootstrap_migration.scss b/app/assets/stylesheets/bootstrap_migration.scss index e3c63ae5e1a..db52179ca19 100644 --- a/app/assets/stylesheets/bootstrap_migration.scss +++ b/app/assets/stylesheets/bootstrap_migration.scss @@ -268,3 +268,11 @@ pre code { input[type=color].form-control { height: $input-height; } + +.toggle-sidebar-button { + .collapse-text, + .icon-angle-double-left, + .icon-angle-double-right { + color: $gl-text-color-secondary; + } +} -- cgit v1.2.1 From 6f0c3e1e51a200e9fc57f8430968e4b680800412 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Mon, 11 Jun 2018 15:21:42 -0500 Subject: Resolve "Milestone and labels dropdowns are misplaced with collapsed sidebar" --- app/views/shared/issuable/_sidebar.html.haml | 6 +++--- app/views/shared/issuable/_sidebar_assignees.html.haml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 9e50e888b35..0ca35ea1298 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -43,7 +43,7 @@ .selectbox.hide-collapsed = f.hidden_field 'milestone_id', value: issuable.milestone_id, id: nil - = dropdown_tag('Milestone', options: { title: _('Assign milestone'), toggle_class: 'js-milestone-select js-extra-options', filter: true, dropdown_class: 'dropdown-menu-selectable', placeholder: _('Search milestones'), data: { show_no: true, field_name: "#{issuable.to_ability_name}[milestone_id]", project_id: @project.id, issuable_id: issuable.id, milestones: project_milestones_path(@project, :json), ability_name: issuable.to_ability_name, issue_update: issuable_json_path(issuable), use_id: true, default_no: true, selected: (issuable.milestone.name if issuable.milestone), null_default: true }}) + = dropdown_tag('Milestone', options: { title: _('Assign milestone'), toggle_class: 'js-milestone-select js-extra-options', filter: true, dropdown_class: 'dropdown-menu-selectable', placeholder: _('Search milestones'), data: { show_no: true, field_name: "#{issuable.to_ability_name}[milestone_id]", project_id: @project.id, issuable_id: issuable.id, milestones: project_milestones_path(@project, :json), ability_name: issuable.to_ability_name, issue_update: issuable_json_path(issuable), use_id: true, default_no: true, selected: (issuable.milestone.name if issuable.milestone), null_default: true, display: 'static' }}) - if issuable.has_attribute?(:time_estimate) #issuable-time-tracker.block // Fallback while content is loading @@ -77,7 +77,7 @@ .selectbox.hide-collapsed = f.hidden_field :due_date, value: issuable.due_date.try(:strftime, 'yy-mm-dd') .dropdown - %button.dropdown-menu-toggle.js-due-date-select{ type: 'button', data: { toggle: 'dropdown', field_name: "#{issuable.to_ability_name}[due_date]", ability_name: issuable.to_ability_name, issue_update: issuable_json_path(issuable) } } + %button.dropdown-menu-toggle.js-due-date-select{ type: 'button', data: { toggle: 'dropdown', field_name: "#{issuable.to_ability_name}[due_date]", ability_name: issuable.to_ability_name, issue_update: issuable_json_path(issuable), display: 'static' } } %span.dropdown-toggle-text = _('Due date') = icon('chevron-down', 'aria-hidden': 'true') @@ -109,7 +109,7 @@ - selected_labels.each do |label| = hidden_field_tag "#{issuable.to_ability_name}[label_names][]", label.id, id: nil .dropdown - %button.dropdown-menu-toggle.js-label-select.js-multiselect.js-label-sidebar-dropdown{ type: "button", data: {toggle: "dropdown", default_label: "Labels", field_name: "#{issuable.to_ability_name}[label_names][]", ability_name: issuable.to_ability_name, show_no: "true", show_any: "true", namespace_path: @project.try(:namespace).try(:full_path), project_path: @project.try(:path), issue_update: issuable_json_path(issuable), labels: (labels_filter_path(false) if @project) } } + %button.dropdown-menu-toggle.js-label-select.js-multiselect.js-label-sidebar-dropdown{ type: "button", data: {toggle: "dropdown", default_label: "Labels", field_name: "#{issuable.to_ability_name}[label_names][]", ability_name: issuable.to_ability_name, show_no: "true", show_any: "true", namespace_path: @project.try(:namespace).try(:full_path), project_path: @project.try(:path), issue_update: issuable_json_path(issuable), labels: (labels_filter_path(false) if @project), display: 'static' } } %span.dropdown-toggle-text{ class: ("is-default" if selected_labels.empty?) } = multi_label_name(selected_labels, "Labels") = icon('chevron-down', 'aria-hidden': 'true') diff --git a/app/views/shared/issuable/_sidebar_assignees.html.haml b/app/views/shared/issuable/_sidebar_assignees.html.haml index e1cde527ad7..ed3ef6155db 100644 --- a/app/views/shared/issuable/_sidebar_assignees.html.haml +++ b/app/views/shared/issuable/_sidebar_assignees.html.haml @@ -37,7 +37,7 @@ - issuable.assignees.each do |assignee| = hidden_field_tag "#{issuable.to_ability_name}[assignee_ids][]", assignee.id, id: nil, data: { avatar_url: assignee.avatar_url, name: assignee.name, username: assignee.username } - - options = { toggle_class: 'js-user-search js-author-search', title: _('Assign to'), filter: true, dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author', placeholder: _('Search users'), data: { first_user: current_user&.username, current_user: true, project_id: @project&.id, author_id: issuable.author_id, field_name: "#{issuable.to_ability_name}[assignee_ids][]", issue_update: issuable_json_path(issuable), ability_name: issuable.to_ability_name, null_user: true } } + - options = { toggle_class: 'js-user-search js-author-search', title: _('Assign to'), filter: true, dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author', placeholder: _('Search users'), data: { first_user: current_user&.username, current_user: true, project_id: @project&.id, author_id: issuable.author_id, field_name: "#{issuable.to_ability_name}[assignee_ids][]", issue_update: issuable_json_path(issuable), ability_name: issuable.to_ability_name, null_user: true, display: 'static' } } - title = _('Select assignee') - if issuable.is_a?(Issue) -- cgit v1.2.1 From d5a81831d35a3218c66385f76b6af5d6604d65f1 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Mon, 11 Jun 2018 13:24:57 -0700 Subject: Hide overflow on hr --- app/assets/stylesheets/bootstrap_migration.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/bootstrap_migration.scss b/app/assets/stylesheets/bootstrap_migration.scss index 9f6716a6735..dccfa0266b3 100644 --- a/app/assets/stylesheets/bootstrap_migration.scss +++ b/app/assets/stylesheets/bootstrap_migration.scss @@ -89,6 +89,10 @@ a { color: $gl-link-color; } +hr { + overflow: hidden; +} + .form-group.row .col-form-label { // Bootstrap 4 aligns labels to the left // for horizontal forms -- cgit v1.2.1 From ba36df2ff6997ff4a05c6f3ce9ab8f3adcb46e2d Mon Sep 17 00:00:00 2001 From: James Ramsay Date: Mon, 11 Jun 2018 16:32:00 -0400 Subject: Update import screenshot without LFS warning Support for LFS object import was added by gitlab-org/gitlab-ce!18871 and should be reflected in the documentation. --- .../import/img/import_projects_from_repo_url.png | Bin 150259 -> 142329 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/doc/user/project/import/img/import_projects_from_repo_url.png b/doc/user/project/import/img/import_projects_from_repo_url.png index ec867da1087..c453c7e558a 100644 Binary files a/doc/user/project/import/img/import_projects_from_repo_url.png and b/doc/user/project/import/img/import_projects_from_repo_url.png differ -- cgit v1.2.1 From c08718c321b99173bde812edb9b2358c963e0de9 Mon Sep 17 00:00:00 2001 From: Dennis Tang Date: Tue, 12 Jun 2018 03:28:29 +0000 Subject: Fix typo in doc/development/README.md --- doc/development/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/development/README.md b/doc/development/README.md index 92d9829192e..5d6fed5bc72 100644 --- a/doc/development/README.md +++ b/doc/development/README.md @@ -32,7 +32,7 @@ description: 'Learn how to contribute to GitLab.' - [GitLab utilities](utilities.md) - [API styleguide](api_styleguide.md) Use this styleguide if you are contributing to the API. -- [GrapQL API styleguide](api_graphql_styleguide.md) Use this +- [GraphQL API styleguide](api_graphql_styleguide.md) Use this styleguide if you are contribution to the [GraphQL API](../api/graphql/index.md) - [Sidekiq guidelines](sidekiq_style_guide.md) for working with Sidekiq workers - [Working with Gitaly](gitaly.md) -- cgit v1.2.1 From 7fdf2ba497099f1917dc452e13e481768e23acb7 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Tue, 12 Jun 2018 15:01:24 +1100 Subject: [Rails5] Update Gitlab.rails5.lock --- Gemfile.rails5.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Gemfile.rails5.lock b/Gemfile.rails5.lock index efb4dfd263a..952e27df29d 100644 --- a/Gemfile.rails5.lock +++ b/Gemfile.rails5.lock @@ -315,7 +315,7 @@ GEM diff-lcs (~> 1.1) mime-types (>= 1.16) posix-spawn (~> 0.3) - gitlab-markup (1.6.3) + gitlab-markup (1.6.4) gitlab-styles (2.3.2) rubocop (~> 0.51) rubocop-gitlab-security (~> 0.1.0) @@ -751,36 +751,36 @@ GEM chunky_png rqrcode-rails3 (0.1.7) rqrcode (>= 0.4.2) - rspec (3.6.0) - rspec-core (~> 3.6.0) - rspec-expectations (~> 3.6.0) - rspec-mocks (~> 3.6.0) - rspec-core (3.6.0) - rspec-support (~> 3.6.0) - rspec-expectations (3.6.0) + rspec (3.7.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-core (3.7.1) + rspec-support (~> 3.7.0) + rspec-expectations (3.7.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-mocks (3.6.0) + rspec-support (~> 3.7.0) + rspec-mocks (3.7.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) + rspec-support (~> 3.7.0) rspec-parameterized (0.4.0) binding_of_caller parser proc_to_ast rspec (>= 2.13, < 4) unparser - rspec-rails (3.6.0) + rspec-rails (3.7.2) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec-core (~> 3.6.0) - rspec-expectations (~> 3.6.0) - rspec-mocks (~> 3.6.0) - rspec-support (~> 3.6.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-support (~> 3.7.0) rspec-retry (0.4.5) rspec-core rspec-set (0.1.3) - rspec-support (3.6.0) + rspec-support (3.7.1) rspec_profiling (0.0.5) activerecord pg @@ -1054,7 +1054,7 @@ DEPENDENCIES gitlab-flowdock-git-hook (~> 1.0.1) gitlab-gollum-lib (~> 4.2) gitlab-gollum-rugged_adapter (~> 0.4.4) - gitlab-markup (~> 1.6.2) + gitlab-markup (~> 1.6.4) gitlab-styles (~> 2.3) gitlab_omniauth-ldap (~> 2.0.4) gon (~> 6.2) @@ -1152,7 +1152,7 @@ DEPENDENCIES rouge (~> 3.1) rqrcode-rails3 (~> 0.1.7) rspec-parameterized - rspec-rails (~> 3.6.0) + rspec-rails (~> 3.7.0) rspec-retry (~> 0.4.5) rspec-set (~> 0.1.3) rspec_profiling (~> 0.0.5) -- cgit v1.2.1 From 8070632b741c8aadd38b3d6743b997761763305d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 12 Jun 2018 10:39:16 +0300 Subject: Use nip.io instead of xip.io Signed-off-by: Dmitriy Zaporozhets --- doc/administration/integration/koding.md | 18 +++++++++--------- doc/install/kubernetes/gitlab_omnibus.md | 2 +- doc/install/openshift_and_gitlab/index.md | 8 ++++---- doc/topics/autodevops/index.md | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/administration/integration/koding.md b/doc/administration/integration/koding.md index 67f9f01efb8..6c1ec3028cc 100644 --- a/doc/administration/integration/koding.md +++ b/doc/administration/integration/koding.md @@ -100,14 +100,14 @@ As it's pointed out before, you will need public access to this machine that you've installed Koding and GitLab on. Better to use a domain but a static IP is also fine. -For IP based installation you can use [xip.io](https://xip.io) service which is +For IP based installation you can use [nip.io](https://nip.io) service which is free and provides DNS resolution to IP based requests like following; - - 127.0.0.1.xip.io -> resolves to 127.0.0.1 - - foo.bar.baz.127.0.0.1.xip.io -> resolves to 127.0.0.1 + - 127.0.0.1.nip.io -> resolves to 127.0.0.1 + - foo.bar.baz.127.0.0.1.nip.io -> resolves to 127.0.0.1 - and so on... -As Koding needs subdomains for team names; `foo.127.0.0.1.xip.io` requests for +As Koding needs subdomains for team names; `foo.127.0.0.1.nip.io` requests for a running koding instance on `127.0.0.1` server will be handled as `foo` team requests. @@ -127,8 +127,8 @@ your Koding installation. Team called `gitlab` has integration on Koding out of the box, so if you didn't change anything your team on Koding should be `gitlab`. -So, if your Koding is running on `http://1.2.3.4.xip.io:8090` your URL needs -to be `http://gitlab.1.2.3.4.xip.io:8090`. You need to provide the same host +So, if your Koding is running on `http://1.2.3.4.nip.io:8090` your URL needs +to be `http://gitlab.1.2.3.4.nip.io:8090`. You need to provide the same host with your Koding installation here. @@ -192,7 +192,7 @@ cd koding docker-compose run \ --service-ports backend \ /opt/koding/scripts/bootstrap-container build \ - --host=**YOUR_IP**.xip.io \ + --host=**YOUR_IP**.nip.io \ --gitlabHost=**GITLAB_IP** \ --gitlabPort=**GITLAB_PORT** \ --gitlabToken=**SECRET_TOKEN** \ @@ -224,7 +224,7 @@ cd koding docker-compose run \ --service-ports backend \ /opt/koding/scripts/bootstrap-container build \ - --host=**YOUR_IP**.xip.io \ + --host=**YOUR_IP**.nip.io \ ``` #### Enable Single Sign On @@ -233,7 +233,7 @@ Once you restarted your Koding and logged in with your username and password you need to activate oauth authentication for your user. To do that - Navigate to Dashboard on Koding from; - `http://gitlab.**YOUR_IP**.xip.io:8090/Home/my-account` + `http://gitlab.**YOUR_IP**.nip.io:8090/Home/my-account` - Scroll down to Integrations section - Click on toggle to turn On integration in GitLab integration section diff --git a/doc/install/kubernetes/gitlab_omnibus.md b/doc/install/kubernetes/gitlab_omnibus.md index e1d1969651e..852a58a9afc 100644 --- a/doc/install/kubernetes/gitlab_omnibus.md +++ b/doc/install/kubernetes/gitlab_omnibus.md @@ -120,7 +120,7 @@ gitlabConfigStorageSize: 1Gi Ingress routing and SSL are automatically configured within this Chart. An NGINX ingress is provisioned and configured, and will route traffic to any service. SSL certificates are automatically created and configured by [kube-lego](https://github.com/kubernetes/charts/tree/master/stable/kube-lego). > **Note:** -Let's Encrypt limits a single TLD to five certificate requests within a single week. This means that common DNS wildcard services like [xip.io](http://xip.io) and [nip.io](http://nip.io) are unlikely to work. +Let's Encrypt limits a single TLD to five certificate requests within a single week. This means that common DNS wildcard services like [nip.io](http://nip.io) and [nip.io](http://nip.io) are unlikely to work. ## Installing GitLab using the Helm Chart > **Note:** diff --git a/doc/install/openshift_and_gitlab/index.md b/doc/install/openshift_and_gitlab/index.md index 1ced1fb513d..60e1e2b5f8a 100644 --- a/doc/install/openshift_and_gitlab/index.md +++ b/doc/install/openshift_and_gitlab/index.md @@ -307,10 +307,10 @@ hostname** and use greater values for the volume sizes. If you don't provide a password for PostgreSQL, it will be created automatically. >**Note:** -The `gitlab.apps.10.2.2.2.xip.io` hostname that is used by default will +The `gitlab.apps.10.2.2.2.nip.io` hostname that is used by default will resolve to the host with IP `10.2.2.2` which is the IP our VM uses. It is a trick to have distinct FQDNs pointing to services that are on our local network. -Read more on how this works in . +Read more on how this works in . Now that we configured this, let's see how to manage and scale GitLab. @@ -347,7 +347,7 @@ Navigate back to the **Overview** and hopefully all pods will be up and running. ![GitLab running](img/gitlab-running.png) Congratulations! You can now navigate to your new shinny GitLab instance by -visiting where you will be asked to +visiting where you will be asked to change the root user password. Login using `root` as username and providing the password you just set, and start using GitLab! @@ -521,4 +521,4 @@ PaaS and managing your applications with the ease of containers. [autoscaling]: https://docs.openshift.org/latest/dev_guide/pod_autoscaling.html "Documentation - Autoscale" [basic-cli]: https://docs.openshift.org/latest/cli_reference/basic_cli_operations.html "Documentation - Basic CLI operations" [openshift-docs]: https://docs.openshift.org "OpenShift documentation" -[scc]: https://docs.openshift.org/latest/admin_guide/manage_scc.html "Documentation - Managing Security Context Constraints" \ No newline at end of file +[scc]: https://docs.openshift.org/latest/admin_guide/manage_scc.html "Documentation - Managing Security Context Constraints" diff --git a/doc/topics/autodevops/index.md b/doc/topics/autodevops/index.md index fe6a88b1df7..103836e59d0 100644 --- a/doc/topics/autodevops/index.md +++ b/doc/topics/autodevops/index.md @@ -135,9 +135,9 @@ and `1.2.3.4` is the IP address of your load balancer; generally NGINX ([see requirements](#requirements)). How to set up the DNS record is beyond the scope of this document; you should check with your DNS provider. -Alternatively you can use free public services like [xip.io](http://xip.io) or +Alternatively you can use free public services like [nip.io](http://nip.io) or [nip.io](http://nip.io) which provide automatic wildcard DNS without any -configuration. Just set the Auto DevOps base domain to `1.2.3.4.xip.io` or +configuration. Just set the Auto DevOps base domain to `1.2.3.4.nip.io` or `1.2.3.4.nip.io`. Once set up, all requests will hit the load balancer, which in turn will route -- cgit v1.2.1 From bc7787b977d020a90d718d492699279f91fcf2fd Mon Sep 17 00:00:00 2001 From: Edwin Torres Date: Tue, 12 Jun 2018 07:51:11 +0000 Subject: fixed/enhanced command-line documentation --- doc/gitlab-basics/command-line-commands.md | 58 +++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/doc/gitlab-basics/command-line-commands.md b/doc/gitlab-basics/command-line-commands.md index c9766040234..4666511d747 100644 --- a/doc/gitlab-basics/command-line-commands.md +++ b/doc/gitlab-basics/command-line-commands.md @@ -7,17 +7,19 @@ In Git, when you copy a project you say you "clone" it. To work on a git project When you are on your Dashboard, click on the project that you'd like to clone. To work in the project, you can copy a link to the Git repository through a SSH or a HTTPS protocol. SSH is easier to use after it's been -[setup](create-your-ssh-keys.md). While you are at the **Project** tab, select -HTTPS or SSH from the dropdown menu and copy the link using the 'Copy to clipboard' +[set up](create-your-ssh-keys.md). While you are at the **Project** tab, select +HTTPS or SSH from the dropdown menu and copy the link using the _Copy URL to clipboard_ button (you'll have to paste it on your shell in the next step). ![Copy the HTTPS or SSH](img/project_clone_url.png) ## On the command line +This section has examples of some basic shell commands that you might find useful. For more information, search the web for _bash commands_. + ### Clone your project -Go to your computer's shell and type the following command: +Go to your computer's shell and type the following command with your SSH or HTTPS URL: ``` git clone PASTE HTTPS OR SSH HERE @@ -25,33 +27,45 @@ git clone PASTE HTTPS OR SSH HERE A clone of the project will be created in your computer. ->**Note:** If you clone your project via an URL that contains special characters, make sure that they are URL-encoded. +>**Note:** If you clone your project via a URL that contains special characters, make sure that characters are URL-encoded. -### Go into a project, directory or file to work in it +### Go into a project directory to work in it ``` -cd NAME-OF-PROJECT-OR-FILE +cd NAME-OF-PROJECT ``` -### Go back one directory or file +### Go back one directory ``` -cd ../ +cd .. ``` -### View what’s in the directory that you are in +### List what’s in the current directory ``` ls ``` -### Create a directory +### List what’s in the current directory that starts with `a` + +``` +ls a* +``` + +### List what’s in the current directory that ends with `.md` + +``` +ls *.md +``` + +### Create a new directory ``` mkdir NAME-OF-YOUR-DIRECTORY ``` -### Create a README.md or file in directory +### Create a README.md file in the current directory ``` touch README.md @@ -62,6 +76,12 @@ nano README.md #### Press: enter ``` +### Show the contents of the README.md file + +``` +cat README.md +``` + ### Remove a file ``` @@ -74,12 +94,18 @@ rm NAME-OF-FILE rm -r NAME-OF-DIRECTORY ``` -### View history in the command line +### View command history ``` history ``` +### Execute command 123 from history + +``` +!123 +``` + ### Carry out commands for which the account you are using lacks authority You will be asked for an administrator’s password. @@ -88,8 +114,14 @@ You will be asked for an administrator’s password. sudo ``` -### Tell where you are +### Show which directory I am in ``` pwd ``` + +### Clear the shell window + +``` +clear +``` -- cgit v1.2.1 From 86f6649d0b4b6239c9e52a1727f14c5025ca4980 Mon Sep 17 00:00:00 2001 From: Dennis Tang Date: Tue, 12 Jun 2018 08:23:26 +0000 Subject: Resolve "Update docs as GKE cluster creation label has changed from "project ID" to "project"" --- doc/user/project/clusters/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/user/project/clusters/index.md b/doc/user/project/clusters/index.md index 1e909e9f5f7..48bb2e543c1 100644 --- a/doc/user/project/clusters/index.md +++ b/doc/user/project/clusters/index.md @@ -41,20 +41,20 @@ new Kubernetes cluster that will be hosted on GKE to your project: 1. Navigate to your project's **Operations > Kubernetes** page. 1. Click on **Add Kubernetes cluster**. -1. Click on **Create with GKE**. +1. Click on **Create with Google Kubernetes Engine**. 1. Connect your Google account if you haven't done already by clicking the **Sign in with Google** button. 1. Fill in the requested values: - - **Cluster name** (required) - The name you wish to give the cluster. - - **GCP project ID** (required) - The ID of the project you created in your GCP + - **Kubernetes cluster name** - The name you wish to give the cluster. + - **Environment scope** - The [associated environment](#setting-the-environment-scope) to this cluster. + - **Google Cloud Platform project** - The project you created in your GCP console that will host the Kubernetes cluster. This must **not** be confused - with the project name. Learn more about [Google Cloud Platform projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects). + with the project ID. Learn more about [Google Cloud Platform projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects). - **Zone** - The [zone](https://cloud.google.com/compute/docs/regions-zones/) under which the cluster will be created. - **Number of nodes** - The number of nodes you wish the cluster to have. - **Machine type** - The [machine type](https://cloud.google.com/compute/docs/machine-types) of the Virtual Machine instance that the cluster will be based on. - - **Environment scope** - The [associated environment](#setting-the-environment-scope) to this cluster. 1. Finally, click the **Create Kubernetes cluster** button. After a few moments, your cluster should be created. If something goes wrong, -- cgit v1.2.1 From 6633fbef4e6c7adaca9b1f1633640f09c3bc90d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Sun, 20 May 2018 14:18:50 +0200 Subject: Add CI_{PIPELINE,JOB}_URL --- app/models/ci/build.rb | 1 + app/models/ci/pipeline.rb | 5 ++++- changelogs/unreleased/expose-ci-url.yml | 5 +++++ doc/ci/variables/README.md | 2 ++ spec/models/ci/build_spec.rb | 3 +++ spec/models/ci/pipeline_spec.rb | 2 +- 6 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/expose-ci-url.yml diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 2d675726939..41446946a5e 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -611,6 +611,7 @@ module Ci variables .concat(pipeline.persisted_variables) .append(key: 'CI_JOB_ID', value: id.to_s) + .append(key: 'CI_JOB_URL', value: Gitlab::Routing.url_helpers.project_job_url(project, self)) .append(key: 'CI_JOB_TOKEN', value: token, public: false) .append(key: 'CI_BUILD_ID', value: id.to_s) .append(key: 'CI_BUILD_TOKEN', value: token, public: false) diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index eecd86349e4..689e0ac0ef5 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -548,7 +548,10 @@ module Ci def persisted_variables Gitlab::Ci::Variables::Collection.new.tap do |variables| - variables.append(key: 'CI_PIPELINE_ID', value: id.to_s) if persisted? + break variables unless persisted? + + variables.append(key: 'CI_PIPELINE_ID', value: id.to_s) + variables.append(key: 'CI_PIPELINE_URL', value: Gitlab::Routing.url_helpers.project_pipeline_url(project, self)) end end diff --git a/changelogs/unreleased/expose-ci-url.yml b/changelogs/unreleased/expose-ci-url.yml new file mode 100644 index 00000000000..b6ad7d18e0d --- /dev/null +++ b/changelogs/unreleased/expose-ci-url.yml @@ -0,0 +1,5 @@ +--- +title: Add CI_PIPELINE_URL and CI_JOB_URL +merge_request: 19618 +author: +type: added diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 1b24bcdbf6f..a3da6515a19 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -64,6 +64,7 @@ future GitLab releases.** | **CI_JOB_NAME** | 9.0 | 0.5 | The name of the job as defined in `.gitlab-ci.yml` | | **CI_JOB_STAGE** | 9.0 | 0.5 | The name of the stage as defined in `.gitlab-ci.yml` | | **CI_JOB_TOKEN** | 9.0 | 1.2 | Token used for authenticating with the GitLab Container Registry | +| **CI_JOB_URL** | 11.0 | 0.5 | Job details URL | | **CI_REPOSITORY_URL** | 9.0 | all | The URL to clone the Git repository | | **CI_RUNNER_DESCRIPTION** | 8.10 | 0.5 | The description of the runner as saved in GitLab | | **CI_RUNNER_ID** | 8.10 | 0.5 | The unique id of runner being used | @@ -81,6 +82,7 @@ future GitLab releases.** | **CI_PROJECT_NAMESPACE** | 8.10 | 0.5 | The project namespace (username or groupname) that is currently being built | | **CI_PROJECT_PATH** | 8.10 | 0.5 | The namespace with project name | | **CI_PROJECT_PATH_SLUG** | 9.3 | all | `$CI_PROJECT_PATH` lowercased and with everything except `0-9` and `a-z` replaced with `-`. Use in URLs and domain names. | +| **CI_PIPELINE_URL** | 11.0 | 0.5 | Pipeline details URL | | **CI_PROJECT_URL** | 8.10 | 0.5 | The HTTP address to access project | | **CI_PROJECT_VISIBILITY** | 10.3 | all | The project visibility (internal, private, public) | | **CI_REGISTRY** | 8.10 | 0.5 | If the Container Registry is enabled it returns the address of GitLab's Container Registry | diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 0a0d7d3fea9..51b9b518117 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1548,7 +1548,9 @@ describe Ci::Build do let(:predefined_variables) do [ { key: 'CI_PIPELINE_ID', value: pipeline.id.to_s, public: true }, + { key: 'CI_PIPELINE_URL', value: project.web_url + "/pipelines/#{pipeline.id}", public: true }, { key: 'CI_JOB_ID', value: build.id.to_s, public: true }, + { key: 'CI_JOB_URL', value: project.web_url + "/-/jobs/#{build.id}", public: true }, { key: 'CI_JOB_TOKEN', value: build.token, public: false }, { key: 'CI_BUILD_ID', value: build.id.to_s, public: true }, { key: 'CI_BUILD_TOKEN', value: build.token, public: false }, @@ -2171,6 +2173,7 @@ describe Ci::Build do it 'does not return prohibited variables' do keys = %w[CI_JOB_ID + CI_JOB_URL CI_JOB_TOKEN CI_BUILD_ID CI_BUILD_TOKEN diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 2bae98dcbb8..a41657b53b7 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -194,7 +194,7 @@ describe Ci::Pipeline, :mailer do it 'does contains persisted variables' do keys = subject.map { |variable| variable[:key] } - expect(keys).to eq %w[CI_PIPELINE_ID] + expect(keys).to eq %w[CI_PIPELINE_ID CI_PIPELINE_URL] end end end -- cgit v1.2.1 From 8749641838241ca17b30a72a9890cc8e1fc071f2 Mon Sep 17 00:00:00 2001 From: "Jacob Vosmaer (GitLab)" Date: Tue, 12 Jun 2018 09:24:05 +0000 Subject: Move Gitaly branch/tag/ref RPC's to opt-out --- changelogs/unreleased/gitaly-opt-out-branch-tag.yml | 5 +++++ lib/gitlab/git/repository.rb | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 changelogs/unreleased/gitaly-opt-out-branch-tag.yml diff --git a/changelogs/unreleased/gitaly-opt-out-branch-tag.yml b/changelogs/unreleased/gitaly-opt-out-branch-tag.yml new file mode 100644 index 00000000000..750fc863eed --- /dev/null +++ b/changelogs/unreleased/gitaly-opt-out-branch-tag.yml @@ -0,0 +1,5 @@ +--- +title: Move Gitaly branch/tag/ref RPC's to opt-out +merge_request: 19644 +author: +type: other diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 63e1102f686..e883964a090 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -120,7 +120,7 @@ module Gitlab # Default branch in the repository def root_ref - @root_ref ||= gitaly_migrate(:root_ref) do |is_enabled| + @root_ref ||= gitaly_migrate(:root_ref, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| if is_enabled gitaly_ref_client.default_branch_name else @@ -152,7 +152,7 @@ module Gitlab # Returns an Array of branch names # sorted by name ASC def branch_names - gitaly_migrate(:branch_names) do |is_enabled| + gitaly_migrate(:branch_names, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| if is_enabled gitaly_ref_client.branch_names else @@ -163,7 +163,7 @@ module Gitlab # Returns an Array of Branches def branches - gitaly_migrate(:branches) do |is_enabled| + gitaly_migrate(:branches, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| if is_enabled gitaly_ref_client.branches else @@ -200,7 +200,7 @@ module Gitlab end def local_branches(sort_by: nil) - gitaly_migrate(:local_branches) do |is_enabled| + gitaly_migrate(:local_branches, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| if is_enabled gitaly_ref_client.local_branches(sort_by: sort_by) else @@ -270,7 +270,7 @@ module Gitlab # Returns an Array of tag names def tag_names - gitaly_migrate(:tag_names) do |is_enabled| + gitaly_migrate(:tag_names, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| if is_enabled gitaly_ref_client.tag_names else @@ -283,7 +283,7 @@ module Gitlab # # Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/390 def tags - gitaly_migrate(:tags) do |is_enabled| + gitaly_migrate(:tags, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| if is_enabled tags_from_gitaly else @@ -310,7 +310,7 @@ module Gitlab # # name - The name of the tag as a String. def tag_exists?(name) - gitaly_migrate(:ref_exists_tags) do |is_enabled| + gitaly_migrate(:ref_exists_tags, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| if is_enabled gitaly_ref_exists?("refs/tags/#{name}") else @@ -323,7 +323,7 @@ module Gitlab # # name - The name of the branch as a String. def branch_exists?(name) - gitaly_migrate(:ref_exists_branches) do |is_enabled| + gitaly_migrate(:ref_exists_branches, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| if is_enabled gitaly_ref_exists?("refs/heads/#{name}") else -- cgit v1.2.1 From 88810dda007f4b575eefbb3391b0fa2503f1d337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4mmerle?= Date: Tue, 12 Jun 2018 09:50:15 +0000 Subject: Add navigation theme documentation --- .../img/profil-preferences-navigation-theme.png | Bin 0 -> 16403 bytes .../img/profile-preferences-syntax-themes.png | Bin 0 -> 44844 bytes doc/user/profile/img/profile_settings_dropdown.png | Bin 4184 -> 6972 bytes doc/user/profile/preferences.md | 42 ++++++++++++++++++--- 4 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 doc/user/profile/img/profil-preferences-navigation-theme.png create mode 100644 doc/user/profile/img/profile-preferences-syntax-themes.png diff --git a/doc/user/profile/img/profil-preferences-navigation-theme.png b/doc/user/profile/img/profil-preferences-navigation-theme.png new file mode 100644 index 00000000000..7adaec33b60 Binary files /dev/null and b/doc/user/profile/img/profil-preferences-navigation-theme.png differ diff --git a/doc/user/profile/img/profile-preferences-syntax-themes.png b/doc/user/profile/img/profile-preferences-syntax-themes.png new file mode 100644 index 00000000000..719df9410fc Binary files /dev/null and b/doc/user/profile/img/profile-preferences-syntax-themes.png differ diff --git a/doc/user/profile/img/profile_settings_dropdown.png b/doc/user/profile/img/profile_settings_dropdown.png index a2c620642e2..99b06a1bf58 100644 Binary files a/doc/user/profile/img/profile_settings_dropdown.png and b/doc/user/profile/img/profile_settings_dropdown.png differ diff --git a/doc/user/profile/preferences.md b/doc/user/profile/preferences.md index 930e506802a..e028861a419 100644 --- a/doc/user/profile/preferences.md +++ b/doc/user/profile/preferences.md @@ -7,6 +7,34 @@ To navigate to your profile's preferences, click your avatar icon in the top right corner and select **Settings**. From there on, choose the **Preferences** tab. +![Profile preferences settings](img/profile_settings_dropdown.png) + +## Navigation theme + +>**Note:** +Navigation themes have been re-introduced with [GitLab 10.0](https://about.gitlab.com/2017/09/22/gitlab-10-0-released/). + +The GitLab navigation theme setting allows you to personalize your GitLab experience. +You can choose from several color themes that add unique colors to the top navigation +and left side navigation. +Using individual color themes might help you differentiate between your different +GitLab instances. + +The default palette is Indigo. You can choose between 10 different themes: + +- Indigo +- Light Indigo +- Blue +- Light Blue +- Green +- Light Green +- Red +- Light Red +- Dark +- Light + +![Profile preferences syntax highlighting themes](img/profile-preferences-syntax-themes.png) + ## Syntax highlighting theme >**Note:** @@ -16,7 +44,7 @@ list of supported languages visit the rouge website. Changing this setting allows you to customize the color theme when viewing any syntax highlighted code on GitLab. -The default one is **White**, and you can choose among 5 different colors: +The default syntax theme is White, and you can choose among 5 different colors: - White - Dark @@ -24,6 +52,8 @@ The default one is **White**, and you can choose among 5 different colors: - Solarized dark - Monokai +![Profile preferences navigation themes](img/profil-preferences-navigation-theme.png) + ## Behavior The following settings allow you to customize the behavior of GitLab's layout @@ -52,16 +82,16 @@ You have 8 options here that you can use for your default dashboard view: - Assigned Issues - Assigned Merge Requests -### Project home page content +### Project overview content -The project home page content setting allows you to choose what content you want to +The project overview content setting allows you to choose what content you want to see on a project’s home page. You can choose between 3 options: -- Show the files and the readme (default) -- Show the readme -- Show the project’s activity +- Files and Readme (default) +- Readme +- Activity [rouge]: http://rouge.jneen.net/ "Rouge website" [todos]: ../../workflow/todos.md -- cgit v1.2.1 From e23fb005cfc6d0d1c0423bed3fa2dcdf291ae196 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Tue, 12 Jun 2018 11:23:58 +0000 Subject: Add CI job to check Gemfile.rails5.lock --- .gitlab-ci.yml | 7 +++++++ .../blackst0ne-add-gemfile-rails5-lock-check.yml | 5 +++++ scripts/rails5-gemfile-lock-check | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 changelogs/unreleased/blackst0ne-add-gemfile-rails5-lock-check.yml create mode 100755 scripts/rails5-gemfile-lock-check diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba0c5074839..9a0102c65fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -415,6 +415,7 @@ setup-test-env: script: - bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init' - scripts/gitaly-test-build # Do not use 'bundle exec' here + - BUNDLE_GEMFILE=Gemfile.rails5 bundle install $BUNDLE_INSTALL_FLAGS artifacts: expire_in: 7d paths: @@ -590,6 +591,12 @@ downtime_check: - /(^docs[\/-].*|.*-docs$)/ - /(^qa[\/-].*|.*-qa$)/ +rails5_gemfile_lock_check: + <<: *dedicated-no-docs-no-db-pull-cache-job + <<: *except-docs-and-qa + script: + - scripts/rails5-gemfile-lock-check + ee_compat_check: <<: *rake-exec except: diff --git a/changelogs/unreleased/blackst0ne-add-gemfile-rails5-lock-check.yml b/changelogs/unreleased/blackst0ne-add-gemfile-rails5-lock-check.yml new file mode 100644 index 00000000000..69d49f3e3e0 --- /dev/null +++ b/changelogs/unreleased/blackst0ne-add-gemfile-rails5-lock-check.yml @@ -0,0 +1,5 @@ +--- +title: Add CI job to check Gemfile.rails5.lock +merge_request: 19605 +author: "@blackst0ne" +type: other diff --git a/scripts/rails5-gemfile-lock-check b/scripts/rails5-gemfile-lock-check new file mode 100755 index 00000000000..da6f1b7145e --- /dev/null +++ b/scripts/rails5-gemfile-lock-check @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +echo -e "=> Checking if Gemfile.rails5.lock is up-to-date...\\n" + +cp Gemfile.rails5.lock Gemfile.rails5.lock.orig +BUNDLE_GEMFILE=Gemfile.rails5 bundle install "$BUNDLE_INSTALL_FLAGS" +diff -u Gemfile.rails5.lock.orig Gemfile.rails5.lock >/dev/null 2>&1 + +if [ $? == 1 ] +then + diff -u Gemfile.rails5.lock.orig Gemfile.rails5.lock + + echo -e "\\n✖ ERROR: Gemfile.rails5.lock is not up-to-date! + Please run 'BUNDLE_GEMFILE=Gemfile.rails5 bundle install'\\n" >&2 + exit 1 +fi + +echo "✔ Gemfile.rails5.lock is up-to-date" +exit 0 -- cgit v1.2.1 From 1292b99b742fd83438b011d3082662d354b3330e Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Tue, 12 Jun 2018 11:30:13 +0000 Subject: Resolve "[Rails5] `ActionView::MissingTemplate` in spec/features/projects/wiki/user_views_wiki_page_spec.rb" --- config/routes/wiki.rb | 2 +- spec/routing/project_routing_spec.rb | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/config/routes/wiki.rb b/config/routes/wiki.rb index c2da84ff6f2..cd3828b743c 100644 --- a/config/routes/wiki.rb +++ b/config/routes/wiki.rb @@ -6,7 +6,7 @@ scope(controller: :wikis) do post '/', to: 'wikis#create' end - scope(path: 'wikis/*id', as: :wiki, format: false) do + scope(path: 'wikis/*id', as: :wiki, format: false, defaults: { format: :html }) do get :edit get :history post :preview_markdown diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index e1b4e618092..56d93095a85 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -36,33 +36,36 @@ describe 'project routing' do shared_examples 'RESTful project resources' do let(:actions) { [:index, :create, :new, :edit, :show, :update, :destroy] } let(:controller_path) { controller } + let(:id) { { id: '1' } } + let(:format) { {} } # response format, e.g. { format: :html } + let(:params) { { namespace_id: 'gitlab', project_id: 'gitlabhq' } } it 'to #index' do - expect(get("/gitlab/gitlabhq/#{controller_path}")).to route_to("projects/#{controller}#index", namespace_id: 'gitlab', project_id: 'gitlabhq') if actions.include?(:index) + expect(get("/gitlab/gitlabhq/#{controller_path}")).to route_to("projects/#{controller}#index", params) if actions.include?(:index) end it 'to #create' do - expect(post("/gitlab/gitlabhq/#{controller_path}")).to route_to("projects/#{controller}#create", namespace_id: 'gitlab', project_id: 'gitlabhq') if actions.include?(:create) + expect(post("/gitlab/gitlabhq/#{controller_path}")).to route_to("projects/#{controller}#create", params) if actions.include?(:create) end it 'to #new' do - expect(get("/gitlab/gitlabhq/#{controller_path}/new")).to route_to("projects/#{controller}#new", namespace_id: 'gitlab', project_id: 'gitlabhq') if actions.include?(:new) + expect(get("/gitlab/gitlabhq/#{controller_path}/new")).to route_to("projects/#{controller}#new", params) if actions.include?(:new) end it 'to #edit' do - expect(get("/gitlab/gitlabhq/#{controller_path}/1/edit")).to route_to("projects/#{controller}#edit", namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') if actions.include?(:edit) + expect(get("/gitlab/gitlabhq/#{controller_path}/1/edit")).to route_to("projects/#{controller}#edit", params.merge(**id, **format)) if actions.include?(:edit) end it 'to #show' do - expect(get("/gitlab/gitlabhq/#{controller_path}/1")).to route_to("projects/#{controller}#show", namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') if actions.include?(:show) + expect(get("/gitlab/gitlabhq/#{controller_path}/1")).to route_to("projects/#{controller}#show", params.merge(**id, **format)) if actions.include?(:show) end it 'to #update' do - expect(put("/gitlab/gitlabhq/#{controller_path}/1")).to route_to("projects/#{controller}#update", namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') if actions.include?(:update) + expect(put("/gitlab/gitlabhq/#{controller_path}/1")).to route_to("projects/#{controller}#update", params.merge(id)) if actions.include?(:update) end it 'to #destroy' do - expect(delete("/gitlab/gitlabhq/#{controller_path}/1")).to route_to("projects/#{controller}#destroy", namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') if actions.include?(:destroy) + expect(delete("/gitlab/gitlabhq/#{controller_path}/1")).to route_to("projects/#{controller}#destroy", params.merge(**id, **format)) if actions.include?(:destroy) end end @@ -150,12 +153,13 @@ describe 'project routing' do end it 'to #history' do - expect(get('/gitlab/gitlabhq/wikis/1/history')).to route_to('projects/wikis#history', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') + expect(get('/gitlab/gitlabhq/wikis/1/history')).to route_to('projects/wikis#history', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: :html) end it_behaves_like 'RESTful project resources' do let(:actions) { [:create, :edit, :show, :destroy] } let(:controller) { 'wikis' } + let(:format) { { format: :html } } end end -- cgit v1.2.1 From eb9210df77bfa173792685b1d9c703c3bbf531a9 Mon Sep 17 00:00:00 2001 From: Dennis Tang Date: Tue, 12 Jun 2018 12:29:52 +0000 Subject: i18n: document how to use links without splitting sentences --- doc/development/i18n/externalization.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/doc/development/i18n/externalization.md b/doc/development/i18n/externalization.md index 0edcb23c7c5..4ba9958e2c6 100644 --- a/doc/development/i18n/externalization.md +++ b/doc/development/i18n/externalization.md @@ -233,7 +233,7 @@ This makes use of [`Intl.DateTimeFormat`]. Please never split a sentence as that would assume the sentence grammar and structure is the same in all languages. -For instance, the following +For instance, the following: ```js {{ s__("mrWidget|Set by") }} @@ -247,6 +247,27 @@ should be externalized as follows: {{ sprintf(s__("mrWidget|Set by %{author} to be merged automatically when the pipeline succeeds"), { author: author.name }) }} ``` +#### Avoid splitting sentences when adding links + +This also applies when using links in between translated sentences, otherwise these texts are not translatable in certain languages. + +Instead of: + +```haml +- zones_link = link_to(s_('ClusterIntegration|zones'), 'https://cloud.google.com/compute/docs/regions-zones/regions-zones', target: '_blank', rel: 'noopener noreferrer') += s_('ClusterIntegration|Learn more about %{zones_link}').html_safe % { zones_link: zones_link } +``` + +Set the link starting and ending HTML fragments as variables like so: + +```haml +- zones_link_url = 'https://cloud.google.com/compute/docs/regions-zones/regions-zones' +- zones_link_start = ''.html_safe % { url: zones_link_url } += s_('ClusterIntegration|Learn more about %{zones_link_start}zones%{zones_link_end}').html_safe % { zones_link_start: zones_link_start, zones_link_end: ''.html_safe } +``` + +The reasoning behind this is that in some languages words change depending on context. For example in Japanese は is added to the subject of a sentence and を to the object. This is impossible to translate correctly if we extract individual words from the sentence. + When in doubt, try to follow the best practices described in this [Mozilla Developer documentation][mdn]. -- cgit v1.2.1 From ab93f7cc7912e0f07cf5ac4de95afdabffad5138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20L=C3=B3pez?= Date: Tue, 12 Jun 2018 12:31:10 +0000 Subject: Bumping gitlab-gollum-lib and gitlab-gollum-rugged_adapter --- Gemfile.lock | 4 ++-- .../fj-bumping-gollum-lib-and-gollum-rugged-adapter.yml | 5 +++++ spec/lib/gitlab/git/wiki_spec.rb | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/fj-bumping-gollum-lib-and-gollum-rugged-adapter.yml diff --git a/Gemfile.lock b/Gemfile.lock index 4fc5af40ce6..883e580b86b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -296,7 +296,7 @@ GEM flowdock (~> 0.7) gitlab-grit (>= 2.4.1) multi_json - gitlab-gollum-lib (4.2.7.2) + gitlab-gollum-lib (4.2.7.4) gemojione (~> 3.2) github-markup (~> 1.6) gollum-grit_adapter (~> 1.0) @@ -304,7 +304,7 @@ GEM rouge (~> 3.1) sanitize (~> 2.1) stringex (~> 2.6) - gitlab-gollum-rugged_adapter (0.4.4) + gitlab-gollum-rugged_adapter (0.4.4.1) mime-types (>= 1.15) rugged (~> 0.25) gitlab-grit (2.8.2) diff --git a/changelogs/unreleased/fj-bumping-gollum-lib-and-gollum-rugged-adapter.yml b/changelogs/unreleased/fj-bumping-gollum-lib-and-gollum-rugged-adapter.yml new file mode 100644 index 00000000000..3b4d429707f --- /dev/null +++ b/changelogs/unreleased/fj-bumping-gollum-lib-and-gollum-rugged-adapter.yml @@ -0,0 +1,5 @@ +--- +title: Fixed bug that allowed to remove other wiki pages if the title had wildcard characters +merge_request: +author: +type: fixed diff --git a/spec/lib/gitlab/git/wiki_spec.rb b/spec/lib/gitlab/git/wiki_spec.rb index 722d697c28e..35b06b14620 100644 --- a/spec/lib/gitlab/git/wiki_spec.rb +++ b/spec/lib/gitlab/git/wiki_spec.rb @@ -25,6 +25,22 @@ describe Gitlab::Git::Wiki do end end + describe '#delete_page', :skip_gitaly_mock do + after do + destroy_page('page1') + end + + it 'only removes the page with the same path' do + create_page('page1', 'content') + create_page('*', 'content') + + subject.delete_page('*', commit_details('whatever')) + + expect(subject.pages.count).to eq 1 + expect(subject.pages.first.title).to eq 'page1' + end + end + def create_page(name, content) subject.write_page(name, :markdown, content, commit_details(name)) end -- cgit v1.2.1