diff --git a/CHANGELOG b/CHANGELOG index eab4ff4e6ad..fc721d3d155 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,7 +19,6 @@ v 7.10.0 (unreleased) - Disable reference creation for comments surrounded by code/preformatted blocks (Stan Hu) - Reduce Rack Attack false positives causing 403 errors during HTTP authentication (Stan Hu) - enable line wrapping per default and remove the checkbox to toggle it (Hannes Rosenögger) - - extend the commit calendar to show the actual commits made on a date (Hannes Rosenögger) - Fix a link in the patch update guide - Add a service to support external wikis (Hannes Rosenögger) - Omit the "email patches" link and fix plain diff view for merge commits @@ -73,6 +72,8 @@ v 7.10.0 (unreleased) - Fix git over ssh errors 'fatal: protocol error: bad line length character' - Automatically setup GitLab CI project for forks if origin project has GitLab CI enabled - Bust group page project list cache when namespace name or path changes. + - Explicitly set image alt-attribute to prevent graphical glitches if gravatars could not be loaded + - Fix stuck Merge Request merging events from old installations (Ben Bodenmiller) v 7.9.3 - Contains no changes @@ -80,9 +81,11 @@ v 7.9.3 - Allow admin to create public deploy keys that are accessible to any project. - Warn when gitlab-shell version doesn't match requirement. - Skip email confirmation when set by admin or via LDAP. - - Only allow users to reference groups, projects, issues, MRs, commits they have access to. +v 7.9.3 + - Contains no changes + v 7.9.2 - Contains no changes diff --git a/app/helpers/emails_helper.rb b/app/helpers/emails_helper.rb index 6c253213c3b..0df3ecc90b7 100644 --- a/app/helpers/emails_helper.rb +++ b/app/helpers/emails_helper.rb @@ -1,6 +1,3 @@ -require 'html/pipeline' -require 'html/pipeline/gitlab' - module EmailsHelper # Google Actions @@ -38,26 +35,4 @@ module EmailsHelper lexer = Rugments::Lexers::Diff.new raw formatter.format(lexer.lex(diffcontent)) end - - def replace_image_links_with_base64(text, project) - # Used pipelines in GitLab: - # GitlabEmailImageFilter - replaces images that have been uploaded as attachments with inline images in emails. - # - # see https://gitlab.com/gitlab-org/html-pipeline-gitlab for more filters - filters = [ - HTML::Pipeline::Gitlab::GitlabEmailImageFilter - ] - - context = { - base_url: File.join(Gitlab.config.gitlab.url, project.path_with_namespace, 'uploads'), - upload_path: File.join(Rails.root, 'public', 'uploads', project.path_with_namespace), - } - - pipeline = HTML::Pipeline::Gitlab.new(filters).pipeline - - result = pipeline.call(text, context) - text = result[:output].to_html(save_with: 0) - - text.html_safe - end end diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 35cb920d8bc..92026356b62 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -361,6 +361,6 @@ class MergeRequest < ActiveRecord::Base end def locked_long_ago? - locked_at && locked_at < (Time.now - 1.day) + locked_at.nil? || locked_at < (Time.now - 1.day) end end diff --git a/app/views/groups/group_members/_group_member.html.haml b/app/views/groups/group_members/_group_member.html.haml index 30e5faf822e..2462c952090 100644 --- a/app/views/groups/group_members/_group_member.html.haml +++ b/app/views/groups/group_members/_group_member.html.haml @@ -4,7 +4,7 @@ %li{class: "#{dom_class(member)} js-toggle-container", id: dom_id(member)} %span{class: ("list-item-name" if show_controls)} - = image_tag avatar_icon(user.email, 16), class: "avatar s16" + = image_tag avatar_icon(user.email, 16), class: "avatar s16", alt: '' %strong= user.name %span.cgray= user.username - if user == current_user diff --git a/app/views/groups/milestones/_issue.html.haml b/app/views/groups/milestones/_issue.html.haml index 27d0c62df8c..09f9b4b8969 100644 --- a/app/views/groups/milestones/_issue.html.haml +++ b/app/views/groups/milestones/_issue.html.haml @@ -7,4 +7,4 @@ = link_to_gfm issue.title, [project.namespace.becomes(Namespace), project, issue], title: issue.title .pull-right.assignee-icon - if issue.assignee - = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16" + = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16", alt: '' diff --git a/app/views/groups/milestones/_merge_request.html.haml b/app/views/groups/milestones/_merge_request.html.haml index b2d2097dfab..d0d1426762b 100644 --- a/app/views/groups/milestones/_merge_request.html.haml +++ b/app/views/groups/milestones/_merge_request.html.haml @@ -7,4 +7,4 @@ = link_to_gfm merge_request.title, [project.namespace.becomes(Namespace), project, merge_request], title: merge_request.title .pull-right.assignee-icon - if merge_request.assignee - = image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16" + = image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16", alt: '' diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml index e4f630c6a18..511c0694b8a 100644 --- a/app/views/layouts/nav/_dashboard.html.haml +++ b/app/views/layouts/nav/_dashboard.html.haml @@ -31,8 +31,3 @@ %span Merge Requests %span.count= current_user.assigned_merge_requests.opened.count - = nav_link(controller: :help) do - = link_to help_path, title: 'Help' do - %i.fa.fa-question-circle - %span - Help diff --git a/app/views/notify/_note_message.html.haml b/app/views/notify/_note_message.html.haml index e796353cec4..3fd4b04ac84 100644 --- a/app/views/notify/_note_message.html.haml +++ b/app/views/notify/_note_message.html.haml @@ -1,2 +1,2 @@ %div - = replace_image_links_with_base64(markdown(@note.note, reference_only_path: false), @note.project) + = markdown(@note.note, reference_only_path: false) diff --git a/app/views/notify/new_issue_email.html.haml b/app/views/notify/new_issue_email.html.haml index d4d413b5b44..53a068be52e 100644 --- a/app/views/notify/new_issue_email.html.haml +++ b/app/views/notify/new_issue_email.html.haml @@ -1,5 +1,5 @@ -if @issue.description - = replace_image_links_with_base64(markdown(@issue.description, reference_only_path: false), @issue.project) + = markdown(@issue.description, reference_only_path: false) - if @issue.assignee_id.present? %p diff --git a/app/views/notify/new_merge_request_email.html.haml b/app/views/notify/new_merge_request_email.html.haml index 60e33227e01..5b7dd117c16 100644 --- a/app/views/notify/new_merge_request_email.html.haml +++ b/app/views/notify/new_merge_request_email.html.haml @@ -6,4 +6,4 @@ Assignee: #{@merge_request.author_name} → #{@merge_request.assignee_name} -if @merge_request.description - = replace_image_links_with_base64(markdown(@merge_request.description, reference_only_path: false), @merge_request.project) + = markdown(@merge_request.description, reference_only_path: false) diff --git a/app/views/projects/milestones/_issue.html.haml b/app/views/projects/milestones/_issue.html.haml index 26c83841a22..9f164d44f26 100644 --- a/app/views/projects/milestones/_issue.html.haml +++ b/app/views/projects/milestones/_issue.html.haml @@ -5,5 +5,5 @@ = link_to_gfm issue.title, [@project.namespace.becomes(Namespace), @project, issue], title: issue.title .pull-right.assignee-icon - if issue.assignee - = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16" + = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16", alt: '' diff --git a/app/views/projects/milestones/_merge_request.html.haml b/app/views/projects/milestones/_merge_request.html.haml index 42fbd0cd2ca..0d7a118569a 100644 --- a/app/views/projects/milestones/_merge_request.html.haml +++ b/app/views/projects/milestones/_merge_request.html.haml @@ -5,4 +5,4 @@ = link_to_gfm merge_request.title, [@project.namespace.becomes(Namespace), @project, merge_request], title: merge_request.title .pull-right.assignee-icon - if merge_request.assignee - = image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16" + = image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16", alt: '' diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml index 71bdf5c8f2a..0728f8fa42b 100644 --- a/app/views/projects/notes/_note.html.haml +++ b/app/views/projects/notes/_note.html.haml @@ -5,7 +5,7 @@ %span.fa.fa-circle - else = link_to user_path(note.author) do - = image_tag avatar_icon(note.author_email), class: "avatar s40" + = image_tag avatar_icon(note.author_email), class: "avatar s40", alt: '' .timeline-content .note-header .note-actions @@ -23,7 +23,7 @@ Remove - if note.system = link_to user_path(note.author) do - = image_tag avatar_icon(note.author_email), class: "avatar s16" + = image_tag avatar_icon(note.author_email), class: "avatar s16", alt: '' = link_to_member(@project, note.author, avatar: false) %span.author-username = '@' + note.author.username diff --git a/app/views/projects/project_members/_project_member.html.haml b/app/views/projects/project_members/_project_member.html.haml index a07d0762334..4f053977215 100644 --- a/app/views/projects/project_members/_project_member.html.haml +++ b/app/views/projects/project_members/_project_member.html.haml @@ -3,7 +3,7 @@ %li{class: "#{dom_class(member)} js-toggle-container project_member_row access-#{member.human_access.downcase}", id: dom_id(member)} %span.list-item-name - = image_tag avatar_icon(user.email, 16), class: "avatar s16" + = image_tag avatar_icon(user.email, 16), class: "avatar s16", alt: '' %strong= user.name %span.cgray= user.username - if user == current_user diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index 55a990c94ed..5204fb9a907 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -17,7 +17,7 @@ %span.light by = link_to user_snippets_path(@snippet.author) do - = image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16" + = image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16", alt: '' = @snippet.author_name .back-link diff --git a/docker/Dockerfile b/docker/Dockerfile index f0a8b9f53df..bb25bb677ca 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update -q \ # If the Omnibus package version below is outdated please contribute a merge request to update it. # If you run GitLab Enterprise Edition point it to a location where you have downloaded it. RUN TMP_FILE=$(mktemp); \ - wget -q -O $TMP_FILE https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.9.1-omnibus.1-1_amd64.deb \ + wget -q -O $TMP_FILE https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.9.2-omnibus-1_amd64.deb \ && dpkg -i $TMP_FILE \ && rm -f $TMP_FILE diff --git a/features/dashboard/active_tab.feature b/features/dashboard/active_tab.feature index 08b87808f33..c17dfd07063 100644 --- a/features/dashboard/active_tab.feature +++ b/features/dashboard/active_tab.feature @@ -17,8 +17,3 @@ Feature: Dashboard Active Tab Given I visit dashboard merge requests page Then the active main tab should be Merge Requests And no other main tabs should be active - - Scenario: On Dashboard Help - Given I visit dashboard help page - Then the active main tab should be Help - And no other main tabs should be active diff --git a/features/steps/dashboard/active_tab.rb b/features/steps/dashboard/active_tab.rb index 0e2c04fb299..19ff77b9fe6 100644 --- a/features/steps/dashboard/active_tab.rb +++ b/features/steps/dashboard/active_tab.rb @@ -3,7 +3,4 @@ class Spinach::Features::DashboardActiveTab < Spinach::FeatureSteps include SharedPaths include SharedActiveTab - step 'the active main tab should be Help' do - ensure_active_main_tab('Help') - end end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index e3cf1b92cda..8ce17b94142 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -83,10 +83,6 @@ module SharedPaths visit search_path end - step 'I visit dashboard help page' do - visit help_path - end - step 'I visit dashboard groups page' do visit dashboard_groups_path end diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 7c4235ab379..6bea0321cb9 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -191,13 +191,6 @@ describe Notify do context 'for issues' do let(:issue) { create(:issue, author: current_user, assignee: assignee, project: project) } let(:issue_with_description) { create(:issue, author: current_user, assignee: assignee, project: project, description: Faker::Lorem.sentence) } - let(:issue_with_image) do - create(:issue, - author: current_user, - assignee: assignee, - project: project, - description: "![test](#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/uploads/12345/test.jpg)") - end describe 'that are new' do subject { Notify.new_issue_email(issue.assignee_id, issue.id) } @@ -222,22 +215,6 @@ describe Notify do end end - describe 'that contain images' do - let(:png) { File.read("#{Rails.root}/spec/fixtures/dk.png") } - let(:png_encoded) { Base64::encode64(png) } - - before :each do - file_path = File.join(Rails.root, 'public', 'uploads', issue_with_image.project.path_with_namespace, '12345/test.jpg') - allow(File).to receive(:file?).with(file_path).and_return(true) - allow(File).to receive(:read).with(file_path).and_return(png) - end - - subject { Notify.new_issue_email(issue_with_image.assignee_id, issue_with_image.id) } - it 'replaces attached images with inline images' do - is_expected.to have_body_text URI.encode(png_encoded) - end - end - describe 'that have been reassigned' do subject { Notify.reassigned_issue_email(recipient.id, issue.id, previous_assignee.id, current_user) } @@ -302,14 +279,6 @@ describe Notify do let(:merge_author) { create(:user) } let(:merge_request) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project) } let(:merge_request_with_description) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project, description: Faker::Lorem.sentence) } - let(:merge_request_with_image) do - create(:merge_request, - author: current_user, - assignee: assignee, - source_project: project, - target_project: project, - description: "![test](#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/uploads/12345/test.jpg)") - end describe 'that are new' do subject { Notify.new_merge_request_email(merge_request.assignee_id, merge_request.id) } @@ -346,22 +315,6 @@ describe Notify do end end - describe 'that are new and contain contain images in the description' do - let(:png) {File.read("#{Rails.root}/spec/fixtures/dk.png")} - let(:png_encoded) { Base64::encode64(png) } - - before :each do - file_path = File.join(Rails.root, 'public', 'uploads', merge_request_with_image.project.path_with_namespace, '/12345/test.jpg') - allow(File).to receive(:file?).with(file_path).and_return(true) - allow(File).to receive(:read).with(file_path).and_return(png) - end - - subject { Notify.new_merge_request_email(merge_request_with_image.assignee_id, merge_request_with_image.id) } - it 'replaces attached images with inline images' do - is_expected.to have_body_text URI.encode(png_encoded) - end - end - describe 'that are reassigned' do subject { Notify.reassigned_merge_request_email(recipient.id, merge_request.id, previous_assignee.id, current_user.id) } @@ -470,12 +423,9 @@ describe Notify do describe 'project access changed' do let(:project) { create(:project) } let(:user) { create(:user) } - let(:project_member) do - create(:project_member, - project: project, - user: user) - end - + let(:project_member) { create(:project_member, + project: project, + user: user) } subject { Notify.project_access_granted_email(project_member.id) } it_behaves_like 'an email sent from GitLab' @@ -515,32 +465,6 @@ describe Notify do end end - describe 'on a commit that contains an image' do - let(:commit) { project.repository.commit } - let(:note_with_image) do - create(:note, - project: project, - author: note_author, - note: "![test](#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/uploads/12345/test.jpg)") - end - - let(:png) {File.read("#{Rails.root}/spec/fixtures/dk.png")} - let(:png_encoded) { Base64::encode64(png) } - - before :each do - file_path = File.join(Rails.root, 'public', 'uploads', note_with_image.project.path_with_namespace, '12345/test.jpg') - allow(File).to receive(:file?).with(file_path).and_return(true) - allow(File).to receive(:read).with(file_path).and_return(png) - allow(Note).to receive(:find).with(note_with_image.id).and_return(note_with_image) - allow(note_with_image).to receive(:noteable).and_return(commit) - end - - subject { Notify.note_commit_email(recipient.id, note_with_image.id) } - it 'replaces attached images with inline images' do - is_expected.to have_body_text URI.encode(png_encoded) - end - end - describe 'on a commit' do let(:commit) { project.repository.commit }