BigW Consortium Gitlab

  1. 10 Aug, 2016 26 commits
    • Improve the performance of the GET /:sources/:id/{access_requests,members} API endpoints · 5010be77
      Rémy Coutable authored
      The performance was greatly improved by removing two N+1 queries issues
      for each endpoint.
      
      For comparison:
      
      1. `GET /projects/:id/members`
      
      With two N+1 queries issues (one was already fxed in the following
      snippet):
      
      ```
        ProjectMember Load (0.2ms)  SELECT "members".* FROM "members" WHERE
      "members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
      AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
      "members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
      NULL  ORDER BY "members"."id" DESC  [["source_type", "Project"],
      ["source_id", 1], ["source_type", "Project"]]
        User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN
      (5, 22, 16, 13)  ORDER BY "users"."id" DESC
        ActiveRecord::SchemaMigration Load (0.2ms)  SELECT
      "schema_migrations".* FROM "schema_migrations"
        ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
      "members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
      AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
      "members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
      NULL AND "members"."user_id" = $4  ORDER BY "members"."id" DESC LIMIT 1
      [["source_type", "Project"], ["source_id", 1], ["source_type",
      "Project"], ["user_id", 5]]
        ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
      "members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
      AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
      "members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
      NULL AND "members"."user_id" = $4  ORDER BY "members"."id" DESC LIMIT 1
      [["source_type", "Project"], ["source_id", 1], ["source_type",
      "Project"], ["user_id", 22]]
        ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
      "members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
      AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
      "members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
      NULL AND "members"."user_id" = $4  ORDER BY "members"."id" DESC LIMIT 1
      [["source_type", "Project"], ["source_id", 1], ["source_type",
      "Project"], ["user_id", 16]]
        ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
      "members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
      AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
      "members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
      NULL AND "members"."user_id" = $4  ORDER BY "members"."id" DESC LIMIT 1
      [["source_type", "Project"], ["source_id", 1], ["source_type",
      "Project"], ["user_id", 13]]
      ```
      
      Without the N+1 queries issues:
      
      ```
        ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
      "members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
      AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
      "members"."type" IN ('ProjectMember') AND "members"."requested_at" IS
      NULL  ORDER BY "members"."id" DESC LIMIT 20 OFFSET 0  [["source_type",
      "Project"], ["source_id", 1], ["source_type", "Project"]]
        User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN
      (5, 22, 16, 13)  ORDER BY "users"."id" DESC
      ```
      
      2. `GET /projects/:id/access_requests`
      
      With two N+1 queries issues:
      
      ```
        ProjectMember Load (0.3ms)  SELECT "members".* FROM "members" WHERE
      "members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
      AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
      "members"."type" IN ('ProjectMember') AND ("members"."requested_at" IS
      NOT NULL)  ORDER BY "members"."id" DESC  [["source_type", "Project"],
      ["source_id", 8], ["source_type", "Project"]]
        User Load (0.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" =
      $1  ORDER BY "users"."id" DESC LIMIT 1  [["id", 24]]
        User Load (0.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" =
      $1  ORDER BY "users"."id" DESC LIMIT 1  [["id", 23]]
        ActiveRecord::SchemaMigration Load (0.2ms)  SELECT
      "schema_migrations".* FROM "schema_migrations"
        ProjectMember Load (0.1ms)  SELECT  "members".* FROM "members" WHERE
      "members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
      AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
      "members"."type" IN ('ProjectMember') AND ("members"."requested_at" IS
      NOT NULL) AND "members"."user_id" = $4  ORDER BY "members"."id" DESC
      LIMIT 1  [["source_type", "Project"], ["source_id", 8], ["source_type",
      "Project"], ["user_id", 24]]
        ProjectMember Load (0.2ms)  SELECT  "members".* FROM "members" WHERE
      "members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
      AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
      "members"."type" IN ('ProjectMember') AND ("members"."requested_at" IS
      NOT NULL) AND "members"."user_id" = $4  ORDER BY "members"."id" DESC
      LIMIT 1  [["source_type", "Project"], ["source_id", 8], ["source_type",
      "Project"], ["user_id", 23]]
      ```
      
      Without the N+1 queries issues:
      
      ```
        ProjectMember Load (0.3ms)  SELECT  "members".* FROM "members" WHERE
      "members"."source_type" = $1 AND "members"."type" IN ('ProjectMember')
      AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND
      "members"."type" IN ('ProjectMember') AND ("members"."requested_at" IS
      NOT NULL)  ORDER BY "members"."id" DESC LIMIT 20 OFFSET 0
      [["source_type", "Project"], ["source_id", 8], ["source_type",
      "Project"]]
        User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN
      (24, 23)  ORDER BY "users"."id" DESC
      ```
      Signed-off-by: 's avatarRémy Coutable <remy@rymai.me>
    • New AccessRequests API endpoints for Group & Project · 29850364
      Rémy Coutable authored
      Also, mutualize AccessRequests and Members endpoints for Group &
      Project.
      New API documentation for the AccessRequests endpoints.
      Signed-off-by: 's avatarRémy Coutable <remy@rymai.me>
    • Merge branch 'decouple-secret-keys' into 'master' · b1aac038
      Douwe Maan authored
      Store OTP secret key in secrets.yml
      
      ## What does this MR do?
      
      Migrate the value of `.secret` to `config/secrets.yml` if present, so that `.secret` can be rotated without preventing all users with 2FA from logging in. (On a clean setup, generate different keys for each.)
      
      ## Are there points in the code the reviewer needs to double check?
      
      I'm not sure we actually need `.secret` at all after this, but it seems safer not to touch it.
      
      ## Why was this MR needed?
      
      We have some DB encryption keys in `config/secrets.yml`, and one in `.secret`. They should all be in the same place.
      
      ## What are the relevant issue numbers?
      
      #3963, which isn't closed until I make the relevant changes in Omnibus too.
      
      ## Does this MR meet the acceptance criteria?
      
      - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
      - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
      - ~~API support added~~
      - Tests
        - [x] Added for this feature/bug
        - [x] 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 !5274
    • Merge branch 'clean-up-project-destroy' into 'master' · 4ccba6bf
      Robert Speicher authored
      Clean up project destruction
      
      Instead of redirecting from the project service to the service and back to the model, put all destruction code in the service. Also removes a possible source of failure where run_after_commit may not destroy the project.
      
      See merge request !5695
    • Merge branch 'feature/svg-badge-template' into 'master' · ae63f152
      Douwe Maan authored
      Use badge image template instead of using separate images
      
      ## What does this MR do?
      
      Makes it possible to use template for badge instead of having multiple files.
      
      ## Are there points in the code the reviewer needs to double check?
      
      We also have a deprecated badge in `controllers/ci/projects_controller.rb`.  We decided to leave it until 9.0, so we still have images in `public/ci/` until 9.0.
      
      ## Why was this MR needed?
      
      We are going to implement build coverage badge, and we do not want to store 101 SVG images for each percentage value.
      
      ## What are the relevant issue numbers?
      
      #3714
      
      ## Screenshots (if relevant)
      
      ![new_build_badge](/uploads/f1d4ed5e34278eb01f48994b5b0579f1/new_build_badge.png)
      
      ## Does this MR meet the acceptance criteria?
      
      - [ ] ~~[CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added~~ (refactoring)
      - [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
      - [ ] ~~API support added~~
      - Tests
        - [x] Added for this feature/bug
        - [x] 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)
      - [ ] ~~[Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)~~ (refactoring)
      
      See merge request !5520
    • Update CHANGELOG for 8.10.5 · 34d5426f
      Rémy Coutable authored
      Signed-off-by: 's avatarRémy Coutable <remy@rymai.me>
    • Clean up project destruction · 4955a47c
      Stan Hu authored
      Instead of redirecting from the project service to the service and back to the model,
      put all destruction code in the service. Also removes a possible source of failure
      where run_after_commit may not destroy the project.
    • Merge branch 'add-column-with-default-to-downtime-guide' into 'master' · ae2d3c41
      Achilleas Pipinellis authored
      Mention add_column_with_default in downtime guide
      
      ## What does this MR do?
      
      This extends the "What causes downtime" guide with a mention of the `add_column_with_default` migration helper.
      
      ## Are there points in the code the reviewer needs to double check?
      
      Spelling, grammar, etc.
      
      ## Why was this MR needed?
      
      Currently the guide may lead one to believe it's not possible at all to add a column with a default value.
      
      ## Does this MR meet the acceptance criteria?
      
      - [x] ~~[CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added~~
      - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
      - Tests
        - [ ] 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)
      - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
      
      See merge request !5719
    • Merge branch 'fix-angle-brackets-in-docs' into 'master' · b50e8c29
      Achilleas Pipinellis authored
      Fix escaped angle bracket's in integration documentation.
      
      There are several escaped angle brackets in our integration docs.  While these
      render fine within GitLab, they are broken when rendered on doc.gitlab.com because
      pandoc does not escape them correctly.
      
      You can see the problem here: http://doc.gitlab.com/ce/integration/github.html
      
      Note that the strings `<Organization>` and `<Your Name>` are being interpreted as html tags.
      
      It looks like doc.gitlab.com is using pandoc: https://gitlab.com/gitlab-com/doc-gitlab-com/blob/master/generate.rb#L64
      
      You can verify these changes by running something like this and then inspecting `test.html`:
      
          pandoc --from markdown_github-hard_line_breaks -o test.html doc/integration/twitter.md
      
      You can also verify that GitLab continues to render the docs correctly by checking, for example, http://localhost:3000/help/integration/twitter.md
      
      
      See merge request !4128
    • Merge branch 'fix-filter-label-tooltip' into 'master' · eccefa9b
      Fatih Acet authored
      Fix filter label tooltip HTML rendering
      
      ## What does this MR do?
      Tooltips on labels used in a filter are now rendered as HTML
      
      ## Are there points in the code the reviewer needs to double check?
      Shouldn't be
      
      ## Why was this MR needed?
      Fix existing bug (See screenshot below for reference)
      
      ## What are the relevant issue numbers?
      Closes #20592 
      
      ## Screenshots (if relevant)
      Before:
      ![Screen_Shot_2016-08-04_at_10.27.59_AM__2_](/uploads/7ca37d4116f15a2d22ad16fbbe682f1f/Screen_Shot_2016-08-04_at_10.27.59_AM__2_.png)
      
      After:
      ![Screen_Shot_2016-08-04_at_10.24.37_AM__2_](/uploads/7fce6c8a93d293767dacbcd682831f86/Screen_Shot_2016-08-04_at_10.24.37_AM__2_.png)
      
      ## Does this MR meet the acceptance criteria?
      
      - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
      - Tests
        - [x] 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 !5671
    • Merge branch 'use-cached-project-count-ce' into 'master' · 242c00dc
      Rémy Coutable authored
      Used cached value of project count to reduce DB load
      
      Following !5746, backport a change from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/637/diffs#diff-2.
      
      ## Does this MR meet the acceptance criteria?
      
      - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
      - Tests
        - [x] 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 !5754
    • Merge branch 'update-ui-guide--svgs' into 'master' · 58bde303
      Dmitriy Zaporozhets authored
      Update UI Guide with SVG guidelines
      
      This addition to the guide is to provide some guidelines to UX designers when exporting SVGs. Please let me know if anything is unclear or if you any improvements so we can document it clearly for everyone.
      
      cc / @hazelyang @cperessini @dimitrieh @connorshea @annabeldunstone @dzaporozhets 
      
      ## What are the relevant issue numbers?
      https://gitlab.com/gitlab-org/gitlab-ee/issues/872
      
      See merge request !5748
    • Merge branch 'doc-styleguides' into 'master' · 9d5d14a8
      Achilleas Pipinellis authored
      Small refactor of doc/development/README.md
      
      
      
      See merge request !5757
    • Merge branch 'add-mailmap' into 'master' · fb4edfde
      Rémy Coutable authored
      Add an initial .mailmap
      
      ## What does this MR do?
      
      Add an intiail ".mailmap" file to better map users names and email adresses for `git shortlog` and `git check-mailmap` to work better.
      
      ## Are there points in the code the reviewer needs to double check?
      
      The reviewer can try `git shortlog -nse` with and without the ".mailmap" to see the difference.
      
      ## Why was this MR needed?
      
      It starts to make `git shortlog` and `git check-mailmap` useful.
      
      ## What are the relevant issue numbers?
      
      I don't know of any. I searched for "mailmap" and found nothing.
      
      ## Screenshots (if relevant)
      
      ## Does this MR meet the acceptance criteria?
      
      I can add an entry into the CHANGELOG but this is for developers only so I am not sure it is really needed.
      
      - [ ] [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 !5583
    • Small refactor of doc/development/README.md · 01c0039c
      Achilleas Pipinellis authored
      - Fix wrong doc_styleguide URL
      - Clarify migrations refer to SQL
      - Capitalize CSS
    • Removed extra newline from redis_spec.rb · 023d4812
      Yorick Peterse authored
    • Merge branch 'zj-import-gitlab-fa-icon' into 'master' · 0f4ff69f
      Rémy Coutable authored
      Use FA GitLab Icon for import project button
      
      Before:
      
      ![Screen_Shot_2016-08-08_at_09.43.47](/uploads/e419dc0d229ff848294cf277ffbb02f9/Screen_Shot_2016-08-08_at_09.43.47.png)
      
      After:
      
      ![Screen_Shot_2016-08-08_at_09.43.09](/uploads/3a77c5e98385bbc1c7139300eeca5866/Screen_Shot_2016-08-08_at_09.43.09.png)
      
      See merge request !5702
    • Remove duplicate link_to statements · ef462216
      Z.J. van de Weg authored
    • Mention add_column_with_default in downtime guide · ee451ea5
      Yorick Peterse authored
      [ci skip]
    • Merge branch 'link-to-gdk-howtos' into 'master' · 9db46cc8
      Achilleas Pipinellis authored
      Link to doc root, not readme of GDK
      
      I hope this makes navigation between gitlab-ce developer docs and GDK docs more smooth.
      
      See merge request !5716
    • Merge branch 'api-examples-curl-long-options' into 'master' · 68097a3a
      Achilleas Pipinellis authored
      Use long options for curl examples in documentation
      
      ## What does this MR do?
      
      Use long options (e.g. `--header` instead of `-H`) for curl examples in documentation.
      
      ## Why was this MR needed?
      
      Short options are less readable.
      
      ## What are the relevant issue numbers?
      
      https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5465#note_13603730
      
      
      See merge request !5703
    • Merge branch 'default-label-documentation' into 'master' · 2aad2f05
      Achilleas Pipinellis authored
      Clarify the features for generating default label sets
      
      ## What does this MR do?
      
      * Split out the information regarding the label set that GitLab can generate
      * Add information for the labels view in the Admin panel
      
      ## Are there points in the code the reviewer needs to double check?
      
      * Please ensure that the newly added section relating to the Admin area seems relevant
      * Please verify adherence to the documentation styleguide
      
      ## Why was this MR needed?
      
      Documentation regarding default label sets was missing
      
      ## What are the relevant issue numbers?
      Closes #1865
      
      See merge request !5736
    • Merge branch 'rs-rename-run-helper' into 'master' · 46015c15
      Douwe Maan authored
      Rename `run` task helper method to prevent conflict with StateMachine
      
      This prevents the following message from appearing whenever running a
      Rake task:
      
          Instance method "run" is already defined in Object, use generic
          helper instead or set StateMachines::Machine.ignore_method_conflicts
          = true.
      
      See merge request !5750
  2. 09 Aug, 2016 14 commits