diff options
35 files changed, 175 insertions, 81 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5524c9a7fcb..ddf4e31204a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,9 +45,9 @@ spinach:other: - ruby - mysql -jasmine:ci: +teaspoon: script: - - RAILS_ENV=test SIMPLECOV=true bundle exec rake jasmine:ci + - RAILS_ENV=test bundle exec teaspoon tags: - ruby - mysql @@ -1 +1,2 @@ --color +--format Fuubar diff --git a/CHANGELOG b/CHANGELOG index aaf818245cd..4ee5a950d99 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ v 7.13.0 (unreleased) - Fix error when deleting a user who has projects (Stan Hu) - Fix downloading of patches on public merge requests when user logged out (Stan Hu) - The password for the default administrator (root) account has been changed from "5iveL!fe" to "password". + - Fix Error 500 when relative submodule resolves to a namespace that has a different name from its path (Stan Hu) - Update maintenance documentation to explain no need to recompile asssets for omnibus installations (Stan Hu) - Support commenting on diffs in side-by-side mode (Stan Hu) - Fix JavaScript error when clicking on the comment button on a diff line that has a comment already (Stan Hu) @@ -224,6 +224,7 @@ end group :development, :test do gem 'awesome_print' gem 'byebug' + gem 'fuubar', '~> 2.0.0' gem 'pry-rails' gem 'coveralls', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 8d09fe9bf88..ad780647a1c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -242,6 +242,9 @@ GEM dotenv (>= 0.7) thor (>= 0.13.6) formatador (0.2.5) + fuubar (2.0.0) + rspec (~> 3.0) + ruby-progressbar (~> 1.4) gemnasium-gitlab-service (0.2.6) rugged (~> 0.21) gemojione (2.0.0) @@ -530,6 +533,10 @@ GEM rqrcode (0.4.2) rqrcode-rails3 (0.1.7) rqrcode (>= 0.4.2) + rspec (3.3.0) + rspec-core (~> 3.3.0) + rspec-expectations (~> 3.3.0) + rspec-mocks (~> 3.3.0) rspec-core (3.3.1) rspec-support (~> 3.3.0) rspec-expectations (3.3.0) @@ -763,6 +770,7 @@ DEPENDENCIES fog (~> 1.25.0) font-awesome-rails (~> 4.2) foreman + fuubar (~> 2.0.0) gemnasium-gitlab-service (~> 0.2) github-markup gitlab-flowdock-git-hook (~> 0.4.2) @@ -861,4 +869,4 @@ DEPENDENCIES wikicloth (= 0.8.1) BUNDLED WITH - 1.10.3 + 1.10.4 diff --git a/app/assets/javascripts/behaviors/requires_input.js.coffee b/app/assets/javascripts/behaviors/requires_input.js.coffee new file mode 100644 index 00000000000..8318fe435b3 --- /dev/null +++ b/app/assets/javascripts/behaviors/requires_input.js.coffee @@ -0,0 +1,39 @@ +# Requires Input behavior +# +# When called on a form with input fields with the `required` attribute, the +# form's submit button will be disabled until all required fields have values. +# +#= require extensions/jquery +# +# ### Example Markup +# +# <form class="js-requires-input"> +# <input type="text" required="required"> +# <input type="submit" value="Submit"> +# </form> +# +$.fn.requiresInput = -> + $form = $(this) + $button = $('button[type=submit], input[type=submit]', $form) + + required = '[required=required]' + fieldSelector = "input#{required}, select#{required}, textarea#{required}" + + requireInput = -> + # Collect the input values of *all* required fields + values = _.map $(fieldSelector, $form), (field) -> field.value + + # Disable the button if any required fields are empty + if values.length && _.any(values, _.isEmpty) + $button.disable() + else + $button.enable() + + # Set initial button state + requireInput() + + $form.on 'change input', fieldSelector, requireInput + +# Triggered on standard document `ready` and on Turbolinks `page:load` events +$(document).on 'ready page:load', -> + $('form.js-requires-input').requiresInput() diff --git a/app/assets/javascripts/blob/edit_blob.js.coffee b/app/assets/javascripts/blob/edit_blob.js.coffee index 2e91a06daa8..050888f9c15 100644 --- a/app/assets/javascripts/blob/edit_blob.js.coffee +++ b/app/assets/javascripts/blob/edit_blob.js.coffee @@ -11,7 +11,6 @@ class @EditBlob if ace_mode editor.getSession().setMode "ace/mode/" + ace_mode - disableButtonIfEmptyField "#commit_message", ".js-commit-button" $(".js-commit-button").click -> $("#file-content").val editor.getValue() $(".file-editor form").submit() diff --git a/app/assets/javascripts/blob/new_blob.js.coffee b/app/assets/javascripts/blob/new_blob.js.coffee index ab8f98715e8..1f36a53f191 100644 --- a/app/assets/javascripts/blob/new_blob.js.coffee +++ b/app/assets/javascripts/blob/new_blob.js.coffee @@ -11,7 +11,6 @@ class @NewBlob if ace_mode editor.getSession().setMode "ace/mode/" + ace_mode - disableButtonIfEmptyField "#commit_message", ".js-commit-button" $(".js-commit-button").click -> $("#file-content").val editor.getValue() $(".file-editor form").submit() diff --git a/app/assets/javascripts/labels.js.coffee b/app/assets/javascripts/labels.js.coffee index 1bc8840f9ac..d05bacd7494 100644 --- a/app/assets/javascripts/labels.js.coffee +++ b/app/assets/javascripts/labels.js.coffee @@ -1,7 +1,6 @@ class @Labels constructor: -> form = $('.label-form') - @setupLabelForm(form) @cleanBinding() @addBinding() @updateColorPreview() @@ -14,10 +13,6 @@ class @Labels $(document).off 'click', '.suggest-colors a' $(document).off 'input', 'input#label_color' - # Initializes the form to disable the save button if no color or title is entered - setupLabelForm: (form) -> - disableButtonIfAnyEmptyField form, '.form-control', form.find('.js-save-button') - # Updates the the preview color with the hex-color input updateColorPreview: => previewColor = $('input#label_color').val() diff --git a/app/assets/javascripts/project_new.js.coffee b/app/assets/javascripts/project_new.js.coffee index 836269c44f9..fecdb9fc2e7 100644 --- a/app/assets/javascripts/project_new.js.coffee +++ b/app/assets/javascripts/project_new.js.coffee @@ -3,9 +3,3 @@ class @ProjectNew $('.project-edit-container').on 'ajax:before', => $('.project-edit-container').hide() $('.save-project-loader').show() - - @initEvents() - - - initEvents: -> - disableButtonIfEmptyField '#project_name', '.project-submit' diff --git a/app/helpers/submodule_helper.rb b/app/helpers/submodule_helper.rb index 6def7793dc3..b3f50ceebe4 100644 --- a/app/helpers/submodule_helper.rb +++ b/app/helpers/submodule_helper.rb @@ -63,7 +63,7 @@ module SubmoduleHelper namespace = components.pop.gsub(/^\.\.$/, '') if namespace.empty? - namespace = @project.namespace.name + namespace = @project.namespace.path end [ diff --git a/app/views/admin/identities/_form.html.haml b/app/views/admin/identities/_form.html.haml index b405aa6e8e3..0525552ebf8 100644 --- a/app/views/admin/identities/_form.html.haml +++ b/app/views/admin/identities/_form.html.haml @@ -12,7 +12,7 @@ .form-group = f.label :extern_uid, "Identifier", class: 'control-label' .col-sm-10 - = f.text_field :extern_uid, required: true, class: 'form-control', required: true + = f.text_field :extern_uid, class: 'form-control', required: true .form-actions = f.submit 'Save changes', class: "btn btn-save" diff --git a/app/views/projects/blob/_remove.html.haml b/app/views/projects/blob/_remove.html.haml index b8d8451880a..cae5ff01099 100644 --- a/app/views/projects/blob/_remove.html.haml +++ b/app/views/projects/blob/_remove.html.haml @@ -9,13 +9,10 @@ %strong= @ref .modal-body - = form_tag namespace_project_blob_path(@project.namespace, @project, @id), method: :delete, class: 'form-horizontal' do + = form_tag namespace_project_blob_path(@project.namespace, @project, @id), method: :delete, class: 'form-horizontal js-requires-input' do = render 'shared/commit_message_container', params: params, placeholder: 'Removed this file because...' .form-group .col-sm-offset-2.col-sm-10 = button_tag 'Remove file', class: 'btn btn-remove btn-remove-file' = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal" - -:javascript - disableButtonIfEmptyField('#commit_message', '.btn-remove-file') diff --git a/app/views/projects/blob/edit.html.haml b/app/views/projects/blob/edit.html.haml index e78181f8801..a12cd660fc1 100644 --- a/app/views/projects/blob/edit.html.haml +++ b/app/views/projects/blob/edit.html.haml @@ -11,10 +11,9 @@ %i.fa.fa-eye = editing_preview_title(@blob.name) - = form_tag(namespace_project_update_blob_path(@project.namespace, @project, @id), method: :put, class: "form-horizontal") do + = form_tag(namespace_project_update_blob_path(@project.namespace, @project, @id), method: :put, class: 'form-horizontal js-requires-input') do = render 'projects/blob/editor', ref: @ref, path: @path, blob_data: @blob.data - = render 'shared/commit_message_container', params: params, - placeholder: "Update #{@blob.name}" + = render 'shared/commit_message_container', params: params, placeholder: "Update #{@blob.name}" .form-group.branch = label_tag 'branch', class: 'control-label' do @@ -25,8 +24,7 @@ = hidden_field_tag 'last_commit', @last_commit = hidden_field_tag 'content', '', id: "file-content" = hidden_field_tag 'from_merge_request_id', params[:from_merge_request_id] - = render 'projects/commit_button', ref: @ref, - cancel_path: @after_edit_path + = render 'projects/commit_button', ref: @ref, cancel_path: @after_edit_path :javascript blob = new EditBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", "#{@blob.language.try(:ace_mode)}") diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml index f7ddf74b4fc..7c2a4fece94 100644 --- a/app/views/projects/blob/new.html.haml +++ b/app/views/projects/blob/new.html.haml @@ -1,7 +1,7 @@ - page_title "New File", @ref %h3.page-title New file .file-editor - = form_tag(namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post, class: 'form-horizontal form-new-file') do + = form_tag(namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post, class: 'form-horizontal form-new-file js-requires-input') do = render 'projects/blob/editor', ref: @ref = render 'shared/commit_message_container', params: params, placeholder: 'Add new file' diff --git a/app/views/projects/branches/new.html.haml b/app/views/projects/branches/new.html.haml index cac5dc91afd..29e82b93883 100644 --- a/app/views/projects/branches/new.html.haml +++ b/app/views/projects/branches/new.html.haml @@ -6,7 +6,7 @@ %h3.page-title %i.fa.fa-code-fork New branch -= form_tag namespace_project_branches_path, method: :post, id: "new-branch-form", class: "form-horizontal" do += form_tag namespace_project_branches_path, method: :post, id: "new-branch-form", class: "form-horizontal js-requires-input" do .form-group = label_tag :branch_name, 'Name for new branch', class: 'control-label' .col-sm-10 @@ -20,7 +20,6 @@ = link_to 'Cancel', namespace_project_branches_path(@project.namespace, @project), class: 'btn btn-cancel' :javascript - disableButtonIfAnyEmptyField($("#new-branch-form"), ".form-control", ".btn-create"); var availableTags = #{@project.repository.ref_names.to_json}; $("#ref").autocomplete({ diff --git a/app/views/projects/compare/_form.html.haml b/app/views/projects/compare/_form.html.haml index a0e904cfd8b..3019893d12c 100644 --- a/app/views/projects/compare/_form.html.haml +++ b/app/views/projects/compare/_form.html.haml @@ -1,16 +1,16 @@ -= form_tag namespace_project_compare_index_path(@project.namespace, @project), method: :post, class: 'form-inline' do += form_tag namespace_project_compare_index_path(@project.namespace, @project), method: :post, class: 'form-inline js-requires-input' do .clearfix.append-bottom-20 - if params[:to] && params[:from] = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'} .form-group .input-group.inline-input-group %span.input-group-addon from - = text_field_tag :from, params[:from], class: "form-control" + = text_field_tag :from, params[:from], class: "form-control", required: true = "..." .form-group .input-group.inline-input-group %span.input-group-addon to - = text_field_tag :to, params[:to], class: "form-control" + = text_field_tag :to, params[:to], class: "form-control", required: true = button_tag "Compare", class: "btn btn-create commits-compare-btn" - if create_mr_button? @@ -26,5 +26,3 @@ source: availableTags, minLength: 1 }); - - disableButtonIfEmptyField('#to', '.commits-compare-btn'); diff --git a/app/views/projects/labels/_form.html.haml b/app/views/projects/labels/_form.html.haml index d791ed3410c..534c545329b 100644 --- a/app/views/projects/labels/_form.html.haml +++ b/app/views/projects/labels/_form.html.haml @@ -1,4 +1,4 @@ -= form_for [@project.namespace.becomes(Namespace), @project, @label], html: { class: 'form-horizontal label-form' } do |f| += form_for [@project.namespace.becomes(Namespace), @project, @label], html: { class: 'form-horizontal label-form js-requires-input' } do |f| -if @label.errors.any? .row .col-sm-offset-2.col-sm-10 diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index 8f225a432e4..9cf389dbe38 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -1,9 +1,8 @@ -= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: 'merge-request-form form-horizontal gfm-form' } do |f| += form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: 'merge-request-form form-horizontal gfm-form js-requires-input' } do |f| .merge-request-form-info = render 'shared/issuable/form', f: f, issuable: @merge_request :javascript - disableButtonIfEmptyField("#merge_request_title", ".btn-save"); $('.assign-to-me-link').on('click', function(e){ $('#merge_request_assignee_id').val("#{current_user.id}").trigger("change"); e.preventDefault(); diff --git a/app/views/projects/merge_requests/_new_compare.html.haml b/app/views/projects/merge_requests/_new_compare.html.haml index e611b23bca6..ff9c0cdb283 100644 --- a/app/views/projects/merge_requests/_new_compare.html.haml +++ b/app/views/projects/merge_requests/_new_compare.html.haml @@ -1,6 +1,6 @@ %p.lead Compare branches for new Merge Request -= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], url: new_namespace_project_merge_request_path(@project.namespace, @project), method: :get, html: { class: "merge-request-form form-inline" } do |f| += form_for [@project.namespace.becomes(Namespace), @project, @merge_request], url: new_namespace_project_merge_request_path(@project.namespace, @project), method: :get, html: { class: "merge-request-form form-inline js-requires-input" } do |f| .hide.alert.alert-danger.mr-compare-errors .merge-request-branches.row .col-md-6 @@ -8,9 +8,9 @@ .panel-heading %strong Source branch .panel-body - = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project select2 span3', disabled: @merge_request.persisted? }) + = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project select2 span3', disabled: @merge_request.persisted?, required: true }) - = f.select(:source_branch, @merge_request.source_branches, { include_blank: "Select branch" }, {class: 'source_branch select2 span2'}) + = f.select(:source_branch, @merge_request.source_branches, { include_blank: "Select branch" }, {class: 'source_branch select2 span2', required: true}) .panel-footer .mr_source_commit @@ -20,9 +20,9 @@ %strong Target branch .panel-body - projects = @project.forked_from_project.nil? ? [@project] : [@project, @project.forked_from_project] - = f.select(:target_project_id, options_from_collection_for_select(projects, 'id', 'path_with_namespace', f.object.target_project_id), {}, { class: 'target_project select2 span3', disabled: @merge_request.persisted? }) + = f.select(:target_project_id, options_from_collection_for_select(projects, 'id', 'path_with_namespace', f.object.target_project_id), {}, { class: 'target_project select2 span3', disabled: @merge_request.persisted?, required: true }) - = f.select(:target_branch, @merge_request.target_branches, { include_blank: "Select branch" }, {class: 'target_branch select2 span2'}) + = f.select(:target_branch, @merge_request.target_branches, { include_blank: "Select branch" }, {class: 'target_branch select2 span2', required: true}) .panel-footer .mr_target_commit diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index 2f147f9095d..633a54f3620 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -9,7 +9,7 @@ %span.pull-right = link_to 'Change branches', mr_change_branches_path(@merge_request) %hr -= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: 'merge-request-form form-horizontal gfm-form' } do |f| += form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: 'merge-request-form form-horizontal gfm-form js-requires-input' } do |f| .merge-request-form-info = render 'shared/issuable/form', f: f, issuable: @merge_request = f.hidden_field :source_project_id diff --git a/app/views/projects/merge_requests/widget/open/_accept.html.haml b/app/views/projects/merge_requests/widget/open/_accept.html.haml index 41aa66dd76b..f5bacaf280a 100644 --- a/app/views/projects/merge_requests/widget/open/_accept.html.haml +++ b/app/views/projects/merge_requests/widget/open/_accept.html.haml @@ -1,4 +1,4 @@ -= form_for [:automerge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form' } do |f| += form_for [:automerge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form js-requires-input' } do |f| = hidden_field_tag :authenticity_token, form_authenticity_token .accept-merge-holder.clearfix.js-toggle-container .accept-action @@ -25,8 +25,6 @@ = link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal" :coffeescript - disableButtonIfEmptyField '#commit_message', '.accept_merge_request' - $('.accept-mr-form').on 'ajax:before', -> btn = $('.accept_merge_request') btn.disable() diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml index 5650607f31f..b93462e5bdf 100644 --- a/app/views/projects/milestones/_form.html.haml +++ b/app/views/projects/milestones/_form.html.haml @@ -5,7 +5,7 @@ %hr -= form_for [@project.namespace.becomes(Namespace), @project, @milestone], html: {class: 'form-horizontal milestone-form gfm-form'} do |f| += form_for [@project.namespace.becomes(Namespace), @project, @milestone], html: {class: 'form-horizontal milestone-form gfm-form js-requires-input'} do |f| -if @milestone.errors.any? .alert.alert-danger %ul @@ -16,7 +16,7 @@ .form-group = f.label :title, "Title", class: "control-label" .col-sm-10 - = f.text_field :title, maxlength: 255, class: "form-control" + = f.text_field :title, maxlength: 255, class: "form-control", required: true %p.hint Required .form-group.milestone-description = f.label :description, "Description", class: "control-label" @@ -45,7 +45,6 @@ :javascript - disableButtonIfEmptyField("#milestone_title", ".btn-save"); $( ".datepicker" ).datepicker({ dateFormat: "yy-mm-dd", onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) } diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml index c67a7d256a8..a88cf167511 100644 --- a/app/views/projects/network/show.html.haml +++ b/app/views/projects/network/show.html.haml @@ -4,8 +4,8 @@ .controls = form_tag namespace_project_network_path(@project.namespace, @project, @id), method: :get, class: 'form-inline network-form' do |f| = text_field_tag :extended_sha1, @options[:extended_sha1], placeholder: "Input an extended SHA1 syntax", class: 'search-input form-control input-mx-250 search-sha' - = button_tag class: 'btn btn-success btn-search-sha' do - %i.fa.fa-search + = button_tag class: 'btn btn-success' do + = icon('search') .inline.prepend-left-20 .checkbox.light = label_tag :filter_ref do @@ -16,8 +16,6 @@ = spinner nil, true :javascript - disableButtonIfEmptyField('#extended_sha1', '.btn-search-sha') - network_graph = new Network({ url: '#{namespace_project_network_path(@project.namespace, @project, @ref, @options.merge(format: :json))}', commit_url: '#{namespace_project_commit_path(@project.namespace, @project, 'ae45ca32').gsub("ae45ca32", "%s")}', diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index e56d8615132..5114e63c05f 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -5,13 +5,13 @@ = render 'projects/errors' .project-edit-content - = form_for @project, html: { class: 'new_project form-horizontal' } do |f| + = form_for @project, html: { class: 'new_project form-horizontal js-requires-input' } do |f| .form-group.project-name-holder = f.label :path, class: 'control-label' do %strong Project path .col-sm-10 .input-group - = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 1, autofocus: true + = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 1, autofocus: true, required: true .input-group-addon \.git diff --git a/doc/integration/README.md b/doc/integration/README.md index 286bd34a0bd..6d856951d4e 100644 --- a/doc/integration/README.md +++ b/doc/integration/README.md @@ -7,6 +7,7 @@ See the documentation below for details on how to configure these services. - [External issue tracker](external-issue-tracker.md) Redmine, JIRA, etc. - [LDAP](ldap.md) Set up sign in via LDAP - [OmniAuth](omniauth.md) Sign in via Twitter, GitHub, GitLab, and Google via OAuth. +- [SAML](saml.md) Configure GitLab as a SAML 2.0 Service Provider - [Slack](slack.md) Integrate with the Slack chat service - [OAuth2 provider](oauth_provider.md) OAuth2 application creation - [Gmail](gitlab_buttons_in_gmail.md) Adds GitLab actions to messages diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md index ae2d465e0c1..39a13b14fba 100644 --- a/doc/raketasks/backup_restore.md +++ b/doc/raketasks/backup_restore.md @@ -19,7 +19,7 @@ sudo gitlab-rake gitlab:backup:create sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production ``` -Also you can choose what should be backed up by adding environment variable SKIP. Available options: db, +Also you can choose what should be backed up by adding environment variable SKIP. Available options: db, uploads (attachments), repositories. Use a comma to specify several options at the same time. ``` @@ -300,6 +300,25 @@ Example: LVM snapshots + rsync If you are running GitLab on a virtualized server you can possibly also create VM snapshots of the entire GitLab server. It is not uncommon however for a VM snapshot to require you to power down the server, so this approach is probably of limited practical use. -### Note -This documentation is for GitLab CE. -We backup GitLab.com and make sure your data is secure, but you can't use these methods to export / backup your data yourself from GitLab.com.
\ No newline at end of file +## Troubleshooting + +### Restoring database backup using omnibus packages outputs warnings +If you are using backup restore procedures you might encounter the following warnings: + +``` +psql:/var/opt/gitlab/backups/db/database.sql:22: ERROR: must be owner of extension plpgsql +psql:/var/opt/gitlab/backups/db/database.sql:2931: WARNING: no privileges could be revoked for "public" (two occurences) +psql:/var/opt/gitlab/backups/db/database.sql:2933: WARNING: no privileges were granted for "public" (two occurences) + +``` + +Be advised that, backup is successfully restored in spite of these warnings. + +The rake task runs this as the `gitlab` user which does not have the superuser access to the database. When restore is initiated it will also run as `gitlab` user but it will also try to alter the objects it does not have access to. +Those objects have no influence on the database backup/restore but they give this annoying warning. + +For more information see similar questions on postgresql issue tracker[here](http://www.postgresql.org/message-id/201110220712.30886.adrian.klaver@gmail.com) and [here](http://www.postgresql.org/message-id/2039.1177339749@sss.pgh.pa.us) as well as [stack overflow](http://stackoverflow.com/questions/4368789/error-must-be-owner-of-language-plpgsql). + +## Note +This documentation is for GitLab CE. +We backup GitLab.com and make sure your data is secure, but you can't use these methods to export / backup your data yourself from GitLab.com. diff --git a/features/project/forked_merge_requests.feature b/features/project/forked_merge_requests.feature index ad1160e3343..10bd6fec803 100644 --- a/features/project/forked_merge_requests.feature +++ b/features/project/forked_merge_requests.feature @@ -26,7 +26,6 @@ Feature: Project Forked Merge Requests #And I save the merge request #Then I should see the edited merge request - @javascript Scenario: I cannot submit an invalid merge request Given I visit project "Forked Shop" merge requests page And I click link "New Merge Request" diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index 91d5c3688e2..9ace6436b15 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -19,12 +19,11 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I should see that I am subscribed' do - expect(find(".subscribe-button span").text).to eq "Unsubscribe" + expect(find('.subscribe-button span')).to have_content 'Unsubscribe' end step 'I should see that I am unsubscribed' do - sleep 0.2 - expect(find(".subscribe-button span").text).to eq "Subscribe" + expect(find('.subscribe-button span')).to have_content 'Subscribe' end step 'I click link "Closed"' do diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 7cfde37de55..a1a26abd8ca 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -58,11 +58,11 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should see that I am subscribed' do - expect(find(".subscribe-button span").text).to eq "Unsubscribe" + expect(find('.subscribe-button span')).to have_content 'Unsubscribe' end step 'I should see that I am unsubscribed' do - expect(find(".subscribe-button span")).to have_content("Subscribe") + expect(find('.subscribe-button span')).to have_content 'Subscribe' end step 'I click button "Unsubscribe"' do diff --git a/lib/tasks/jasmine.rake b/lib/tasks/jasmine.rake deleted file mode 100644 index ac307a9e929..00000000000 --- a/lib/tasks/jasmine.rake +++ /dev/null @@ -1,12 +0,0 @@ -# Since we no longer explicitly require the 'jasmine' gem, we lost the -# `jasmine:ci` task used by GitLab CI jobs. -# -# This provides a simple alias to run the `spec:javascript` task from the -# 'jasmine-rails' gem. -task jasmine: ['jasmine:ci'] - -namespace :jasmine do - task :ci do - Rake::Task['teaspoon'].invoke - end -end diff --git a/spec/helpers/submodule_helper_spec.rb b/spec/helpers/submodule_helper_spec.rb index a7abf9d3839..10121759132 100644 --- a/spec/helpers/submodule_helper_spec.rb +++ b/spec/helpers/submodule_helper_spec.rb @@ -115,7 +115,7 @@ describe SubmoduleHelper do end context 'submodules with relative links' do - let(:group) { create(:group) } + let(:group) { create(:group, name: "Master Project", path: "master-project") } let(:project) { create(:project, group: group) } let(:commit_id) { sample_commit[:id] } diff --git a/spec/javascripts/behaviors/requires_input_spec.js.coffee b/spec/javascripts/behaviors/requires_input_spec.js.coffee new file mode 100644 index 00000000000..61a17632173 --- /dev/null +++ b/spec/javascripts/behaviors/requires_input_spec.js.coffee @@ -0,0 +1,49 @@ +#= require behaviors/requires_input + +describe 'requiresInput', -> + fixture.preload('behaviors/requires_input.html') + + beforeEach -> + fixture.load('behaviors/requires_input.html') + + it 'disables submit when any field is required', -> + $('.js-requires-input').requiresInput() + + expect($('.submit')).toBeDisabled() + + it 'enables submit when no field is required', -> + $('*[required=required]').removeAttr('required') + + $('.js-requires-input').requiresInput() + + expect($('.submit')).not.toBeDisabled() + + it 'enables submit when all required fields are pre-filled', -> + $('*[required=required]').remove() + + $('.js-requires-input').requiresInput() + + expect($('.submit')).not.toBeDisabled() + + it 'enables submit when all required fields receive input', -> + $('.js-requires-input').requiresInput() + + $('#required1').val('input1').change() + expect($('.submit')).toBeDisabled() + + $('#optional1').val('input1').change() + expect($('.submit')).toBeDisabled() + + $('#required2').val('input2').change() + $('#required3').val('input3').change() + $('#required4').val('input4').change() + $('#required5').val('1').change() + + expect($('.submit')).not.toBeDisabled() + + it 'is called on page:load event', -> + spy = spyOn($.fn, 'requiresInput') + + $(document).trigger('page:load') + + expect(spy).toHaveBeenCalled() diff --git a/spec/javascripts/fixtures/behaviors/requires_input.html.haml b/spec/javascripts/fixtures/behaviors/requires_input.html.haml new file mode 100644 index 00000000000..c3f905e912e --- /dev/null +++ b/spec/javascripts/fixtures/behaviors/requires_input.html.haml @@ -0,0 +1,18 @@ +%form.js-requires-input + %input{type: 'text', id: 'required1', required: 'required'} + %input{type: 'text', id: 'required2', required: 'required'} + %input{type: 'text', id: 'required3', required: 'required', value: 'Pre-filled'} + %input{type: 'text', id: 'optional1'} + + %textarea{id: 'required4', required: 'required'} + %textarea{id: 'optional2'} + + %select{id: 'required5', required: 'required'} + %option Zero + %option{value: '1'} One + %select{id: 'optional3', required: 'required'} + %option Zero + %option{value: '1'} One + + %button.submit{type: 'submit', value: 'Submit'} + %input.submit{type: 'submit', value: 'Submit'} diff --git a/spec/javascripts/merge_request_spec.js.coffee b/spec/javascripts/merge_request_spec.js.coffee index a4735af0343..22ebc7039d1 100644 --- a/spec/javascripts/merge_request_spec.js.coffee +++ b/spec/javascripts/merge_request_spec.js.coffee @@ -1,7 +1,5 @@ #= require merge_request -window.disableButtonIfEmptyField = -> null - describe 'MergeRequest', -> describe 'task lists', -> fixture.preload('merge_requests_show.html') |