1. 17 Jun, 2016 16 commits
    • Douwe Maan's avatar
      Merge branch '2979-personal-access-tokens' into 'master' · a2ce5188
      Douwe Maan authored
      Allow creating Personal Access Tokens through the website
      
      Related to #2979 
      
      - Allow a user to create personal access tokens, and use them to authenticate
      - Refactor `API::Helpers` into `API::Helpers::Core` and `API::Helpers::Authentication`
      
      # Tasks
      
      - [ ]  #2979 (!3749)  - Personal Access Tokens
          - [x]  Basic Implementation
              - [x]  Add UI to add "Personal Access Tokens"
              - [x]  Reload `lib/api` on every request
              - [x]  Respect these tokens for API requests
              - [x]  Just a param or a header too?
              - [x]  Allow revoking tokens
              - [x]  Expire tokens
              - [x]  Left bar should have a "PAT" icon
              - [x]  Scopes?
              - [x]  Copy to Clipboard
              - [x]  Show active/inactive tokens separately
                  - [x]  No need to check for expired/revoked in the appropriate places
              - [x]  Why does regular ApplicationController check for private token?
              - [x]  Support non-API requests
              - [x]  Revert (or work on) `lib/api` eager loading
          - [x]  Create MR
          - [x]  Refactoring
          - [x]  Fix tests
          - [x]  Write more tests
          - [x]  Add screenshots to MR
          - [x]  Add description of query performance to MR
          - [x]  Limit the number of queries in the `personal_access_tokens` page
          - [x]  Wait for CI to pass
          - [x]  Fix merge issues in schema.rb
          - [x]  Assign MR to endboss
          - [x]  Wait for feedback
          - [x]  Fix feedback
              - [x]  Wait for CI to pass
          - [x]  Assign to @rspeicher
          - [x]  Fix @rspeicher's comments
          - [x]  Wait for CI to pass
          - [x]  Assign back to @rspeicher
          - [x]  Write documentation and ping @axil
          - [x]  Wait for Axil to respond
          - [x]  Assign to endboss
          - [x]  Address Douwe's feedback
              - [x]  Use the `private_token` or `authentication_token` param instead of `personal_access_token`
              - [x]  Ditto for the header
          - [x]  Assign to endboss
          - [x]  Make sure CI is green
          - [x]  Address Douwe's feedback
              - [x]  Don't go through the `authenticate_user_from_private_token!` method, if a private token is supplied (or combine them)
              - [x]  In `authenticate_user_from_personal_access_token!` don't hit DB if `token_string` is `nil`
              - [x]  Use `current_user.personal_access_tokens.build` in the controller
              - [x]  Remove the "We aren't using `personal_access_token` as the root param" comment
              - [x]  `No need for = "...", we can just have the Inactive ... #{...} on the next line` in the view
              - [x]  Render dates in a (more) human format
              - [x]  CSS issue with table
              - [x]  Don't show the tokens in the UI indefinitely
              - [x]  How to implement scopes? Add-on to current impl? Doorkeeper?
          - [x]  Wait for @DouweM's comments about scopes
          - [x]  Address @DouweM's second review 
              - [x]  Try not using `native['innerHTML']`
              - [x]  use contexts for all "when ..."
              - [x]  Ensure consistency (styling) with other pages for "You don't have any tokens" message
              - [x]  "Actions" table column doesn't need a label
              - [x]  %td can be moved outside of the if/else statement
              - [x]  The header title should be "Profile Settings"
              - [x]  Can this be a `before_create`, so we don't need to use `generate`?
              - [x]  If it couldn't be revoked, will we show an error?
              - [x]  If it couldn't be saved, will we show an error?
          - [x]  Merge master
          - [x]  Update CHANGELOG entry
          - [x]  Add tests for form errors?
          - [x]  Post screenshots
          - [x]  Tag @jschatz1 for review
          - [x]  Wait for [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/0dff6fd/builds) to pass
          - [x]  Respond to @jschatz1's comments
              - [x]  Hardcoded colors should be variables
              - [x]  Should not be allowed to chose a date in the past
              - [x]  Use the same table as in the Applications tab
              - [x]  button should say "Create Personal Access Token"
              - [x]  Float the revoke to the right on the `a`
              - [x]  Change revocation message. "Are you sure you want to revoke this certificate? This action cannot be undone."
              - [x]  Date stays selected and looks selected even though date is set as "never".
              - [x]  ~~hover on the calendar button shifts~~ (not caused by this MR - happens on `milestones#new` as well)
              - [x]  Don't use the panel for the created token
                  - [x]  Use a normal flash for "Your new personal access token has been created"
                  - [x]  Show the input (with the token) below it full width.
                  - [x]  Put the "Make sure you save it - you won't be able to access it again." message near the input
              - [x]  Have the input highlight all on single click
          - [x]  Update screenshots
          - [x]  Merge master in + conflicts
          - [x]  Assign to @jschatz1 again
          - [x]  Respond to @jschatz1's comments
              - [x]  No button for clipboard, only link
              - [x]  text-danger
              - [x]  highlight fade on that area where the token was created
          - [x]  Make sure [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/d754d99179f1ffe846fcc1d8e858163b39efc5dc/builds) is green
          - [x]  Assign to @jschatz1
          - [x]  Wait for [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/faa0e3f7580bc38d4d12916b4589c64d6c2678a7/builds) to pass
          - [x]  Respond to @DouweM's feedback
              - [x]  move the redirect_to out of the if/else
              - [x]  certificate -> token
              - [x]  datepicker back to text field
              - [x]  combine the get_user_from_private_token and get_user_from_personal_access_token methods in ApplicationController
              - [x]  combine the get_user_from_private_token and get_user_from_personal_access_token methods in `lib/api/helpers`
              - [x]  don't need the new constants
          - [x]  Wait for [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/9d7cda3ddce52baad9618466a5d00319b333be57/builds) to pass
          - [ ]  Wait for merge
      
      # Screenshots
      ![Screen_Shot_2016-06-16_at_8.30.33_AM](/uploads/30a168964b7c5e0eb322705747829fb6/Screen_Shot_2016-06-16_at_8.30.33_AM.png)
      ![Screen_Shot_2016-06-16_at_8.30.44_AM](/uploads/7a8202885df6120071bbe81b215aaead/Screen_Shot_2016-06-16_at_8.30.44_AM.png)
      ![Screen_Shot_2016-06-16_at_8.31.02_AM](/uploads/6905c0848864e390138b771389c7a1b2/Screen_Shot_2016-06-16_at_8.31.02_AM.png)
      ![Screen_Shot_2016-06-16_at_8.31.29_AM](/uploads/0bc92369fb2f9bc335773f6abec421c3/Screen_Shot_2016-06-16_at_8.31.29_AM.png)
      
      See merge request !3749
      a2ce5188
    • Jacob Schatz's avatar
      Merge branch 'new-merge-request-commit-box-fix' into 'master' · 1051f0c5
      Jacob Schatz authored
      Fixed styling of commit box in new MR
      
      ## What does this MR do?
      
      Fixes an issue that caused the new merge request commit box to go all funny styled.
      
      ## What are the relevant issue numbers?
      
      #18781 
      
      ## Screenshots (if relevant)
      
      ![Screen_Shot_2016-06-17_at_14.08.44](/uploads/b1e34b0c6bf67adc1be8748306e20b06/Screen_Shot_2016-06-17_at_14.08.44.png)
      
      See merge request !4747
      1051f0c5
    • Phil Hughes's avatar
      Fixed styling of commit box in new MR · 673ae917
      Phil Hughes authored
      Closes #18781
      673ae917
    • Yorick Peterse's avatar
      Merge branch '18709-use-specific-git-cached-counters' into 'master' · faee4763
      Yorick Peterse authored
      Use Git cached counters on project show page
      
      See merge request !4711
      faee4763
    • Robert Speicher's avatar
      Merge branch 'rs-devise-emails' into 'master' · f011b86b
      Robert Speicher authored
      Customize all Devise mails
      
      Continuing from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3354
      
      See merge request !4297
      f011b86b
    • Robert Speicher's avatar
      e71c6414
    • Robert Speicher's avatar
      Update CHANGELOG for !4659 · 03ba240f
      Robert Speicher authored
      [ci skip]
      03ba240f
    • Robert Speicher's avatar
      Merge branch 'remove_jiraissue' into 'master' · 79c28e10
      Robert Speicher authored
      Remove JiraIssue model and replace references with ExternalIssue
      
      This MR Removes unused JiraIssue class and replaces references with ExternalIssue
      
      Closes #18203 
      
      See merge request !4659
      79c28e10
    • Robert Speicher's avatar
      Merge branch 'add_autocomplete_for_labels' into 'master' · c34d7409
      Robert Speicher authored
      Add GFM autocomplete for labels
      
      Closes #14637 
      
      See merge request !4013
      c34d7409
    • Robert Speicher's avatar
      Merge branch 'fix-project-find-with-namespace-order' into 'master' · 6300936b
      Robert Speicher authored
      Fixed ordering in Project.find_with_namespace
      
      This MR fixes the ordering of `Project.find_with_namespace` to ensure that it returns rows that match literally first.
      
      Closes #18603
      
      See merge request !4682
      6300936b
    • Robert Speicher's avatar
      Merge branch 'bump-gitlab-git-10.2.0' into 'master' · 88c7b7ae
      Robert Speicher authored
      Use gitlab-git 10.2.0
      
      Closes #18741
      
      See merge request !4722
      88c7b7ae
    • Robert Speicher's avatar
      f63bc822
    • Robert Speicher's avatar
      7b66dcf6
    • Robert Speicher's avatar
      933cd347
    • Robert Speicher's avatar
    • Robert Speicher's avatar
      dd1f56b5
  2. 16 Jun, 2016 24 commits
    • Stan Hu's avatar
      Use gitlab-git 10.2.0 · 91253a3a
      Stan Hu authored
      91253a3a
    • Douwe Maan's avatar
      Merge branch 'banzai-issue-filter-queries' into 'master' · 84632f0a
      Douwe Maan authored
      Reduce SQL query counts in IssueReferenceFilter
      
      ## What does this MR do?
      
      This MR adds a preparation phase for reference filters that allows them to prepare/create data structures used while iterating over HTML nodes. In this particular case the preparation phase is used for issue references to greatly cut down the amount of queries executed to get projects/issues for Markdown references.
      
      ## Are there points in the code the reviewer needs to double check?
      
      No.
      
      ## Why was this MR needed?
      
      Rendering Markdown containing issue references would run at most two queries for every issue reference: one to get the project and one to get the issue from said project. When rendering Markdown with lots of issue references this would result in _a lot_ of queries being executed.
      
      ## What are the relevant issue numbers?
      
      #18042
      
      See merge request !4410
      84632f0a
    • Jacob Schatz's avatar
      Merge branch 'tree-file-title' into 'master' · 0de44624
      Jacob Schatz authored
      Added title attribute to entries in tree view
      
      ## What does this MR do?
      
      Adds a title attribute to entries in the tree view. Moe useful when files have long names.
      
      ## What are the relevant issue numbers?
      
      Closes #18353 
      
      
      See merge request !4709
      0de44624
    • Jacob Schatz's avatar
      Merge branch 'merge-request-default-source-branch-text' into 'master' · e0f46ef1
      Jacob Schatz authored
      Added source branch text to dropdown toggle
      
      ## What does this MR do?
      
      Previously, the dropdown toggle would default to "Select source branch", this changes that so that it defaults to the branch name and if that doesn't exist, it defaults to "Select source branch"
      
      ## Screenshots (if relevant)
      
      ![Screen_Shot_2016-06-07_at_12.20.10](/uploads/40d31e21297a99300050cf9f23bd7371/Screen_Shot_2016-06-07_at_12.20.10.png)
      
      See merge request !4504
      e0f46ef1
    • Jacob Schatz's avatar
      Merge branch 'media-query-bug' into 'master' · 38d0b5b5
      Jacob Schatz authored
      Fix project header alignment media query bug
      
      ## What does this MR do?
      Fixes media query bug on project header
      
      ## Screenshots (if relevant)
      ![Screen_Shot_2016-06-15_at_3.22.20_PM](/uploads/3d84f8ffb88c316f317048e15ffea4f3/Screen_Shot_2016-06-15_at_3.22.20_PM.png)
      
      See merge request !4689
      38d0b5b5
    • Jacob Schatz's avatar
      Merge branch 'dz-fix-mr-widget-padding' into 'master' · af1574e0
      Jacob Schatz authored
      Add bottom padding for merge request command line text
      
      Because without bottom padding text is too close to the UI tabs - hard to navigate
      
      
      
      See merge request !4681
      af1574e0
    • Jacob Schatz's avatar
      Merge branch '13525-sane-defaults-for-merge-request-js-class-constructor' into 'master' · 7b18e8c7
      Jacob Schatz authored
      Avoid a TypeError when initializing MergeRequest JS class with no arg
      
      ## What does this MR do?
      
      Avoid a TypeError when initializing MergeRequest JS class with no arg.
      
      ## Are there points in the code the reviewer needs to double check?
      
      No.
      
      ## Why was this MR needed?
      
      Without this sane default you would get the following error when you
      tried to instantiate a new MergeRequest object with no argument (i.e.
      `new MergeRequest();`):
          
          TypeError: undefined is not an object (evaluating 'this.opts.action')
      
      ## What are the relevant issue numbers?
      
      Fixes #13525.
      
      ## Does this MR meet the acceptance criteria?
      
      - [x] No CHANGELOG since it's a trivial internal change
      - [x] Tests
        - [x] Added for this feature/bug
        - [ ] All builds are passing
      - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
      - [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
      - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
      
      See merge request !4667
      7b18e8c7
    • Jacob Schatz's avatar
      Merge branch 'mr-download-dropdown-alignment' into 'master' · 280c95fc
      Jacob Schatz authored
      Fixed alignment of download dropdown
      
      ## What does this MR do?
      
      Correctly aligns the download dropdown on merge requests
      
      ## Screenshots (if relevant)
      
      ![Screen_Shot_2016-06-14_at_14.47.06](/uploads/9381f25110e5573e56aa5c3f46786df5/Screen_Shot_2016-06-14_at_14.47.06.png)
      
      See merge request !4646
      280c95fc
    • Jacob Schatz's avatar
      Merge branch 'push-event-banner-container' into 'master' · e11aae1a
      Jacob Schatz authored
      Fixed last push event banner not being in container
      
      ## What does this MR do?
      
      Adds the last push event content into a container with the correct class.
      
      ## What are the relevant issue numbers?
      
      Closes #18567 
      
      ## Screenshots (if relevant)
      
      ![Screen_Shot_2016-06-14_at_13.17.41](/uploads/4afa3d2c73e59c5ffbd53869e49baa92/Screen_Shot_2016-06-14_at_13.17.41.png)
      
      See merge request !4644
      e11aae1a
    • Jacob Schatz's avatar
      Merge branch 'diff-scroll-point' into 'master' · 3e6f4a51
      Jacob Schatz authored
      Fixed issue when opening a highlighted line diff
      
      ## What does this MR do?
      
      With the new project nav being fixed, the diff page is scrolling the highlighted under the nav meaning you cant see what is highlighted. This corrects that by added the height of the new project nav into the offset.
      
      See merge request !4597
      3e6f4a51
    • Jacob Schatz's avatar
      Merge branch 'template_dropdown' into 'master' · a44a5fd4
      Jacob Schatz authored
      Implements TemplateDropdown class to create custom template dropdowns
      
      ## What does this MR do?
      Refactorize template dropdowns. This MR creates a base TemplateSelector class so it can be reused for multiple types of templates.
      
      ## 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
        - [x] All builds are passing
      - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
      - [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
      - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
      
      See merge request !4697
      a44a5fd4
    • Jacob Schatz's avatar
      Merge branch 'build-scroll-controls-on-complete' into 'master' · 666b5651
      Jacob Schatz authored
      Shows build scroll buttons after build is complete
      
      ## What does this MR do?
      
      Shows the build scroll buttons whenever there is a build trace. Previously they were only shown when the build was active.
      
      ## What are the relevant issue numbers?
      
      Closes #18515 
      
      ## Screenshots (if relevant)
      
      ![Screen_Shot_2016-06-13_at_11.42.42](/uploads/6e0577f46a0cc7b4f2f13b17c85d97da/Screen_Shot_2016-06-13_at_11.42.42.png)
      
      See merge request !4621
      666b5651
    • Paco Guzman's avatar
      Use Git cached counters on project show page · 5d33af5e
      Paco Guzman authored
      Besides when building the repository cache we cache 
      those git counters too
      5d33af5e
    • Douwe Maan's avatar
      Merge branch '18474-missing-images-on-confirmation-email' into 'master' · db66312c
      Douwe Maan authored
      Fix images in emails
      
      Closes #18474. The confirmation email is actually the only one that uses the `image_tag` helper at the moment, but this will work for all of them:
      ```shell
      $ ag image_tag -G mailer
      app/views/layouts/devise_mailer.html.haml
      13:              = image_tag('mailers/gitlab_header_logo.png', id: 'logo', alt: 'GitLab Wordmark')
      24:                  = image_tag('mailers/gitlab_tanuki_2x.png', alt: 'GitLab Logo')
      ```
      
      See merge request !4705
      db66312c
    • Jacob Schatz's avatar
      Merge branch '18521-tanuki-logo' into 'master' · d9812bae
      Jacob Schatz authored
      Lighten each logo path color instead of white
      
      ## What does this MR do?
      Changes highlight/loading colors of tanuki from white to a lighter version of each path color
      
      ## Why was this MR needed?
      Since the logo is no longer on the dark sidebar, the highlight color was getting lost against the light gray background
      
      ## What are the relevant issue numbers?
      Closes #18521 
      
      ## Screenshots (if relevant)
      ![logo](/uploads/3743925862fa8e17d2fec426f7e4c853/logo.gif)
      
      cc @jschatz1 @lbennett @dzaporozhets 
      
      See merge request !4690
      d9812bae
    • Yorick Peterse's avatar
      Merge branch '18582-banzai-filter-external-link-filter' into 'master' · 0ea170b4
      Yorick Peterse authored
      Banzai::Filter::ExternalLinkFilter use XPath
      
      See merge request !4702
      0ea170b4
    • Annabel Dunstone's avatar
      Fix indentation scss-lint errors · cfbf88f0
      Annabel Dunstone authored
      cfbf88f0
    • Phil Hughes's avatar
      Added title attribute to enties in tree view · 537e8f21
      Phil Hughes authored
      Closes #18353
      537e8f21
    • Stan Hu's avatar
      3fdf104b
    • Paco Guzman's avatar
      Banzai::Filter::ExternalLinkFilter use XPath · ae6a54f7
      Paco Guzman authored
      ae6a54f7
    • Yorick Peterse's avatar
      Reduce queries in IssueReferenceFilter · 19a290e7
      Yorick Peterse authored
      This reduces the number of queries executed in IssueReferenceFilter by
      retrieving the various projects/issues that may be referenced in batches
      _before_ iterating over all the HTML nodes.
      
      A chunk of the logic resides in AbstractReferenceFilter so it can be
      re-used by other filters in the future.
      19a290e7
    • Rémy Coutable's avatar
      Merge branch 'fix/status-of-pipeline-without-builds' into 'master' · 46bba4e7
      Rémy Coutable authored
      Improve pipeline status in case that pipeline has no jobs
      
      ## What does this MR do?
      
      This MR resolves problem with pipeline status when there are no build in pipeline.
      
      This can happen when builds were skipped - for example - by using `only`/`except` keyword in `.gitlab-ci.yml`.
      
      ## What are the relevant issue numbers?
      
      Closes #17977
      
      See merge request !4403
      46bba4e7
    • Jacob Vosmaer's avatar
      Use gitlab_git 10.1.4 · 18d4bd95
      Jacob Vosmaer authored
      18d4bd95
    • Yorick Peterse's avatar
      Fixed ordering in Project.find_with_namespace · 42598786
      Yorick Peterse authored
      This ensures that Project.find_with_namespace returns a row matching
      literally as the first value, instead of returning a random value.
      
      The ordering here is _only_ applied to Project.find_with_namespace and
      _not_ Project.where_paths_in as currently there's no code that requires
      Project.where_paths_in to return rows in a certain order. Since this
      method also returns all rows that match there's no real harm in not
      setting a specific order either. Another reason is that generating all
      the "WHEN" arms for multiple values in Project.where_paths_in becomes
      really messy.
      
      On MySQL we have to use the "BINARY" operator to turn a "WHERE" into a
      case-sensitive WHERE as otherwise MySQL may still end up returning rows
      in an unpredictable order.
      
      Fixes gitlab-org/gitlab-ce#18603
      42598786