diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc5669b51f2..a7a091da6ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -474,7 +474,6 @@ db:rollback-mysql: variables: SIZE: "1" SETUP_DB: "false" - RAILS_ENV: "development" script: - git clone https://gitlab.com/gitlab-org/gitlab-test.git /home/git/repositories/gitlab-org/gitlab-test.git diff --git a/.rubocop.yml b/.rubocop.yml index d25b4ac39c9..23bb0fa8be8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -251,6 +251,10 @@ Layout/Tab: Layout/TrailingBlankLines: Enabled: true +# Avoid trailing whitespace. +Layout/TrailingWhitespace: + Enabled: true + # Style ####################################################################### # Check the naming of accessor methods for get_/set_. @@ -1174,29 +1178,33 @@ RSpec/VerifiedDoubles: GitlabSecurity/DeepMunge: Enabled: true Exclude: - - 'spec/**/*' - 'lib/**/*.rake' + - 'spec/**/*' GitlabSecurity/PublicSend: Enabled: true Exclude: - - 'spec/**/*' + - 'config/**/*' + - 'db/**/*' + - 'features/**/*' - 'lib/**/*.rake' + - 'qa/**/*' + - 'spec/**/*' GitlabSecurity/RedirectToParamsUpdate: Enabled: true Exclude: - - 'spec/**/*' - 'lib/**/*.rake' + - 'spec/**/*' GitlabSecurity/SqlInjection: Enabled: true Exclude: - - 'spec/**/*' - 'lib/**/*.rake' + - 'spec/**/*' GitlabSecurity/SystemCommandInjection: Enabled: true Exclude: - - 'spec/**/*' - 'lib/**/*.rake' + - 'spec/**/*' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cf14285ec2a..4b4f14efea4 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -57,11 +57,6 @@ Layout/SpaceInsideParens: Layout/SpaceInsidePercentLiteralDelimiters: Enabled: false -# Offense count: 89 -# Cop supports --auto-correct. -Layout/TrailingWhitespace: - Enabled: false - # Offense count: 272 RSpec/EmptyLineAfterFinalLet: Enabled: false diff --git a/Gemfile b/Gemfile index 19d0aabfd4f..daabbf13462 100644 --- a/Gemfile +++ b/Gemfile @@ -232,7 +232,7 @@ gem 'ace-rails-ap', '~> 4.1.0' gem 'mousetrap-rails', '~> 1.4.6' # Detect and convert string character encoding -gem 'charlock_holmes', '~> 0.7.3' +gem 'charlock_holmes', '~> 0.7.5' # Faster JSON gem 'oj', '~> 2.17.4' diff --git a/Gemfile.lock b/Gemfile.lock index fac867aa36f..39fd4ad1e2b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -117,7 +117,7 @@ GEM activesupport (>= 4.0.0) mime-types (>= 1.16) cause (0.1) - charlock_holmes (0.7.3) + charlock_holmes (0.7.5) childprocess (0.7.0) ffi (~> 1.0, >= 1.0.11) chronic (0.10.2) @@ -983,7 +983,7 @@ DEPENDENCIES capybara (~> 2.15) capybara-screenshot (~> 1.0.0) carrierwave (~> 1.1) - charlock_holmes (~> 0.7.3) + charlock_holmes (~> 0.7.5) chronic (~> 0.10.2) chronic_duration (~> 0.10.6) concurrent-ruby (~> 1.0.5) diff --git a/PROCESS.md b/PROCESS.md index e5b17784d20..538e4389e00 100644 --- a/PROCESS.md +++ b/PROCESS.md @@ -141,18 +141,22 @@ the stable branch are: * Fixes for security issues * New or updated translations (as long as they do not touch application code) -Any merge requests cherry-picked into the stable branch for a previous release -will also be picked into the latest stable branch. These fixes will be shipped -in the next RC for that release if it is before the 22nd. If the fixes are are -completed on or after the 22nd, they will be shipped in a patch for that -release. - During the feature freeze all merge requests that are meant to go into the upcoming release should have the correct milestone assigned _and_ have the label ~"Pick into Stable" set, so that release managers can find and pick them. Merge requests without a milestone and this label will not be merged into any stable branches. +Fixes marked like this will be shipped in the next RC for that release. Once +the final RC has been prepared ready for release on the 22nd, further fixes +marked ~"Pick into Stable" will go into a patch for that release. + +If a merge request is to be picked into more than one release it will also need +the ~"Pick into Backports" label set to remind the release manager to change +the milestone after cherry-picking. As before, it should still have the +~"Pick into Stable" label and the milestone of the highest release it will be +picked into. + ### Asking for an exception If you think a merge request should go into an RC or patch even though it does not meet these requirements, diff --git a/app/assets/javascripts/commits.js b/app/assets/javascripts/commits.js index 2b0bf49cf92..047544b1762 100644 --- a/app/assets/javascripts/commits.js +++ b/app/assets/javascripts/commits.js @@ -17,7 +17,7 @@ window.CommitsList = (function() { } }); - Pager.init(limit, false, false, this.processCommits); + Pager.init(parseInt(limit, 10), false, false, this.processCommits); this.content = $("#commits-list"); this.searchField = $("#commits-search"); diff --git a/app/assets/javascripts/diff_notes/diff_notes_bundle.js b/app/assets/javascripts/diff_notes/diff_notes_bundle.js index a2d33b0936e..5decfc1dc01 100644 --- a/app/assets/javascripts/diff_notes/diff_notes_bundle.js +++ b/app/assets/javascripts/diff_notes/diff_notes_bundle.js @@ -42,6 +42,10 @@ $(() => { $components.each(function () { const $this = $(this); const noteId = $this.attr(':note-id'); + const discussionId = $this.attr(':discussion-id'); + + if ($this.is('comment-and-resolve-btn') && !discussionId) return; + const tmp = Vue.extend({ template: $this.get(0).outerHTML }); diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index de47485c9f2..a0ed5c23ffe 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -644,7 +644,7 @@ import initChangesDropdown from './init_changes_dropdown'; return Dispatcher; })(); - $(function() { + $(window).on('load', function() { new Dispatcher(); }); }).call(window); diff --git a/app/assets/javascripts/fly_out_nav.js b/app/assets/javascripts/fly_out_nav.js index cbc3ad23990..32cb42c8b10 100644 --- a/app/assets/javascripts/fly_out_nav.js +++ b/app/assets/javascripts/fly_out_nav.js @@ -15,6 +15,10 @@ export const setOpenMenu = (menu = null) => { currentOpenMenu = menu; }; export const slope = (a, b) => (b.y - a.y) / (b.x - a.x); +let headerHeight = 50; + +export const getHeaderHeight = () => headerHeight; + export const canShowActiveSubItems = (el) => { const isHiddenByMedia = bp.getBreakpointSize() === 'sm' || bp.getBreakpointSize() === 'md'; @@ -74,7 +78,7 @@ export const moveSubItemsToPosition = (el, subItems) => { const isAbove = top < boundingRect.top; subItems.classList.add('fly-out-list'); - subItems.style.transform = `translate3d(0, ${Math.floor(top)}px, 0)`; // eslint-disable-line no-param-reassign + subItems.style.transform = `translate3d(0, ${Math.floor(top) - headerHeight}px, 0)`; // eslint-disable-line no-param-reassign const subItemsRect = subItems.getBoundingClientRect(); @@ -153,6 +157,8 @@ export default () => { }, getHideSubItemsInterval()); }); + headerHeight = document.querySelector('.nav-sidebar').offsetTop; + items.forEach((el) => { const subItems = el.querySelector('.sidebar-sub-level-items'); diff --git a/app/assets/javascripts/lib/utils/sticky.js b/app/assets/javascripts/lib/utils/sticky.js index 43a808b6ab3..ff2b66046b4 100644 --- a/app/assets/javascripts/lib/utils/sticky.js +++ b/app/assets/javascripts/lib/utils/sticky.js @@ -1,7 +1,7 @@ export const isSticky = (el, scrollY, stickyTop) => { const top = el.offsetTop - scrollY; - if (top === stickyTop) { + if (top <= stickyTop) { el.classList.add('is-stuck'); } else { el.classList.remove('is-stuck'); diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 37f531c78f4..6d7c7e3c930 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -132,8 +132,9 @@ import './project_select'; import './project_show'; import './project_variables'; import './projects_list'; -import './render_gfm'; +import './syntax_highlight'; import './render_math'; +import './render_gfm'; import './right_sidebar'; import './search'; import './search_autocomplete'; @@ -141,7 +142,6 @@ import './smart_interval'; import './star'; import './subscription'; import './subscription_select'; -import './syntax_highlight'; import './dispatcher'; diff --git a/app/assets/javascripts/new_sidebar.js b/app/assets/javascripts/new_sidebar.js index b10b074f5ac..2d1ed9e4076 100644 --- a/app/assets/javascripts/new_sidebar.js +++ b/app/assets/javascripts/new_sidebar.js @@ -43,10 +43,12 @@ export default class NewNavSidebar { } toggleCollapsedSidebar(collapsed) { - this.$sidebar.toggleClass('sidebar-icons-only', collapsed); + const breakpoint = bp.getBreakpointSize(); + if (this.$sidebar.length) { + this.$sidebar.toggleClass('sidebar-icons-only', collapsed); this.$page.toggleClass('page-with-new-sidebar', !collapsed); - this.$page.toggleClass('page-with-icon-sidebar', collapsed); + this.$page.toggleClass('page-with-icon-sidebar', breakpoint === 'sm' ? true : collapsed); } NewNavSidebar.setCollapsedCookie(collapsed); } diff --git a/app/assets/javascripts/render_gfm.js b/app/assets/javascripts/render_gfm.js index 2c3a9cacd38..bcdc0fd67b8 100644 --- a/app/assets/javascripts/render_gfm.js +++ b/app/assets/javascripts/render_gfm.js @@ -11,7 +11,5 @@ return this; }; - $(document).on('ready load', function() { - return $('body').renderGFM(); - }); + $(() => $('body').renderGFM()); }).call(window); diff --git a/app/assets/javascripts/repo/components/repo.vue b/app/assets/javascripts/repo/components/repo.vue index 3d5e01c8ec0..d6c864cb976 100644 --- a/app/assets/javascripts/repo/components/repo.vue +++ b/app/assets/javascripts/repo/components/repo.vue @@ -43,15 +43,18 @@ export default {