1. 13 Jun, 2016 1 commit
    • Sean McGivern's avatar
      Fix description and GFM pipelines conflicting · 03d2bf14
      Sean McGivern authored
      Consider this command:
      
          bundle exec rails r "include GitlabMarkdownHelper
          puts markdown('<span>this is a span</span>', pipeline: :description)
          puts markdown('<span>this is a span</span>')"
      
      And the same in the opposite order:
      
          bundle exec rails r "include GitlabMarkdownHelper
          puts markdown('<span>this is a span</span>')
          puts markdown('<span>this is a span</span>', pipeline: :description)"
      
      Before this change, they would both output:
      
          <p><span>this is a span</span></p>
          <p>this is a span</p>
      
      That's because `span` is added to the list of whitelisted elements in
      the `SanitizationFilter`, but this method tries not to make the same
      changes multiple times. Unfortunately,
      `HTML::Pipeline::SanitizationFilter::LIMITED`, which is used by the
      `DescriptionPipeline`, uses the same Ruby objects for all of its hash
      values _except_ `:elements`.
      
      That means that whichever of `DescriptionPipeline` and `GfmPipeline` is
      called first would have `span` in its whitelisted elements, and the
      second wouldn't.
      
      Fix this by creating an entirely separate hash, before either pipeline
      is invoked.
      03d2bf14
  2. 10 Jun, 2016 5 commits
    • Rémy Coutable's avatar
      Merge branch 'cs-issue-pr-templates' into 'master' · cfc99bbd
      Rémy Coutable authored
      Add Issue/PR Templates to deter issues/contributions on the GitHub mirror of the project
      
      ## What does this MR do?
      Adds GitHub-specific `ISSUE_TEMPLATE.md` and `PULL_REQUEST_TEMPLATE.md` files in a `.github` directory. To prevent new issues/PRs, I figured it'd be good to direct users/contributors to open issues/contribute code in the "correct" project.
      
      ## Are there points in the code the reviewer needs to double check?
      Wording/phrasing, mostly.
      
      ## Why was this MR needed?
      The GitHub issue tracker is being closed, and PRs on GitHub haven't been accepted for a while now. This was discussed briefly during the GitLab Strategy Session at the Austin Summit.
      
      cc: @dzaporozhets @rymai  @MrChrisW @dblessing @virtuacreative @amara  
      
      See merge request !4324
      cfc99bbd
    • Douwe Maan's avatar
      Merge branch 'enable-rubocop-for-migrations' into 'master' · 0dcd050b
      Douwe Maan authored
      Enable RuboCop for migrations
      
      ## What does this MR do?
      
      Enable RuboCop for all files inside `db/migrate`, then add magic comments to all existing files, so that this only affects new migrations.
      
      ## Are there points in the code the reviewer needs to double check?
      
      This entire change is a config change and a bunch of comments.
      
      ## Why was this MR needed?
      
      ```
      Yorick Peterse [11:55 AM]  
      I don't think we have any use case for nested def, might as well blacklist it
      
      Sean McGivern [11:57 AM]  
      http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/NestedMethodDefinition
      
      Sean McGivern [11:57 AM]  
      hmm, it's already enabled
      
      Sean McGivern [11:57 AM]  
      ... because we exclude `db/` from rubocop 🙂
      
      Douwe Maan [11:57 AM]  
      @smcgivern: heh
      
      Sean McGivern [11:59 AM]  
      I guess that's because we don't want to change the old migrations? I wonder if it's worth enabling it and adding magic comments to all the previous ones to ignore rubocop
      
      Douwe Maan [11:59 AM]  
      @smcgivern: agreed
      ```
      
      ## What are the relevant issue numbers?
      
      None.
      
      ## Screenshots (if relevant)
      
      None, but if I remove the magic comment from the migration `20160416182152_convert_award_note_to_emoji_award.rb` I get:
      ```
      $ be rubocop
      Inspecting 1959 files
      ..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................W....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
      
      Offenses:
      
      db/migrate/20160416182152_convert_award_note_to_emoji_award.rb:3:5: W: Lint/NestedMethodDefinition: Method definitions must not be nested. Use lambda instead.
          def up ...
          ^^^^^^
      
      1959 files inspected, 1 offense detected
      ```
      
      ## Does this MR meet the acceptance criteria?
      
      - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
      - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
      - [ ] API support added
      - [ ] Tests
        - [ ] Added for this feature/bug
        - [ ] All builds are passing
      - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
      - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
      - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
      
      See merge request !4559
      0dcd050b
    • Douwe Maan's avatar
      Merge branch 'gh-rate-limit' into 'master' · a9a9f19b
      Douwe Maan authored
      Wrap all rate limiting logic inside GitHub API client
      
      ## What does this MR do?
      
      Move the actual rate limiting logic to GitHub API to clean the code inside the GitHub importer, and avoid code duplication.
      
      ## Are there points in the code the reviewer needs to double check?
      
      No there aren't.
      
      ## Why was this MR needed?
      
      Avoid code duplication to handle API rate limit in every call to the GitHub API.
      
      ## What are the relevant issue numbers?
      
      There are none.
      
      ## Screenshots (if relevant)
      
      Not relevant.
      
      See merge request !4552
      a9a9f19b
    • Douwe Maan's avatar
      Merge branch '18447-investigate-smtp-error' into 'master' · e0f3e44b
      Douwe Maan authored
      Fix failing `EmailOnPush` spec.
      
      Closes #18447 
      
      - This should fix CI on master
      
      /cc @smcgivern @ayufan @stanhu @pacoguzman 
      
      See merge request !4582
      e0f3e44b
    • Timothy Andrew's avatar
      Fix failing `EmailOnPush` spec. · 99d5a91d
      Timothy Andrew authored
      99d5a91d
  3. 09 Jun, 2016 34 commits