Commit Graph

2189 Commits

Author SHA1 Message Date
Stan Hu 88c4248ac7 Remove remaining N+1 queries in merge requests API with emojis and labels
Closes #34159
2017-07-08 22:19:34 -07:00
Stan Hu 43b9141c36 Merge branch 'sh-optimize-mr-api' into 'master'
Remove many N+1 queries with merge requests API

See merge request !12726
2017-07-08 06:22:09 +00:00
Robert Speicher 42481d1b43 Merge branch 'gitaly-internal-allowed-send-repo' into 'master'
Send Gitaly Repository with /api/internal/allowed

See merge request !12452
2017-07-08 00:48:12 +00:00
Stan Hu b963d45ca4 Remove many N+1 queries with merge requests API
Identified via `ENABLE_BULLET=1 bundle exec rspec spec/requests/api/merge_requests_spec.rb:34`

Improves speed of #34159
2017-07-07 16:31:21 -07:00
Douwe Maan 94e2a28684 Merge branch 'feature/user-datetime-search-api-mysql' into 'master'
Add creation time filters to user search API for admins

Closes #29507

See merge request !12682
2017-07-07 20:52:17 +00:00
Kim "BKC" Carlbäcker 8b074b4e78 Send Gitaly Repository with /api/internal/allowed
- Make single gitaly payload
- Add feature-flag specs to verify payload
2017-07-07 22:24:16 +02:00
Sean McGivern b151951418 Merge branch '33929-allow-to-enable-perf-bar-for-a-group' into 'master'
Allow to enable the performance bar per user or Feature group

Closes #33929 and #34528

See merge request !12362
2017-07-07 18:18:22 +00:00
Douwe Maan 820aeb4e8d Merge branch 'feature/user-agent-details-api' into 'master'
Allow admins to retrieve user agent details for an issue or snippet

Closes #29508

See merge request !12655
2017-07-07 17:13:31 +00:00
Sean McGivern 8b33e654c0 Merge branch 'master' into '33929-allow-to-enable-perf-bar-for-a-group'
# Conflicts:
#   db/schema.rb
2017-07-07 15:40:28 +00:00
Kamil Trzciński a77158ff31 Merge branch 'feature/intermediate/32568-adding-variables-to-pipelines-schedules' into 'master'
Add variables to pipelines schedules

Closes #32568

See merge request !12372
2017-07-07 15:17:02 +00:00
Felipe Artur b5f596c3ff Native group milestones 2017-07-07 15:08:49 +00:00
Sean McGivern b8c4d5e0f5 Merge branch 'master' into 33929-allow-to-enable-perf-bar-for-a-group 2017-07-07 15:54:39 +01:00
James Lopez 5e66c6568b fix specs 2017-07-07 16:09:30 +02:00
James Lopez a9e8af3386 add spec and project snippet user agent details endpoint 2017-07-07 15:54:39 +02:00
Kamil Trzcinski f108153cef Remove update|admin_pipeline_schedule from Project, and grant it in PipelineSchedule 2017-07-07 12:11:48 +02:00
James Lopez 1a7d2aba3b add created at filter logic to users finder and API 2017-07-07 10:38:57 +02:00
Robert Speicher 49430c47d4 Merge branch '33748-fix-n-plus-1-query-in-the-projects-api' into 'master'
Fix some N+1 queries in the GET /projects API

Closes #33748

See merge request !12679
2017-07-07 02:06:27 +00:00
Rémy Coutable 033acc0120
Fix some N+1 queries in the GET /projects API
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-07 02:38:18 +02:00
James Lopez 2aa95aa018 refactor code based on feedback 2017-07-06 15:27:49 +02:00
James Lopez 6ee87aea89 add user agent details API endpoints to issues and snippets 2017-07-06 15:27:48 +02:00
James Lopez 383138af61 add issues spec and user agent details to entities 2017-07-06 15:27:48 +02:00
Douwe Maan ec3b10e078 Merge branch '34716-environment-specific-variables-ce' into 'master'
Backports for ee-2112

Closes #34716

See merge request !12671
2017-07-06 13:11:07 +00:00
Rémy Coutable e5a7d1da8c Improve Features API and its docs and add a Changelog item
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-06 11:18:26 +02:00
Rémy Coutable 050eae8c4d Merge branch '33657-user-projects-api' into 'master'
Add user projects API

Closes #33657

See merge request !12596
2017-07-06 09:18:06 +00:00
Lin Jen-Shin d9435d6121 Backports for ee-2112
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2112
2017-07-06 16:25:03 +08:00
Kamil Trzciński 7f500acb5f Merge branch '33772-readonly-gitlab-ci-cache' into 'master'
Introduce cache policies for CI jobs

Closes #33772

See merge request !12483
2017-07-06 07:40:43 +00:00
Grzegorz Bizon 6afe25ef33 Merge branch '32815--Add-Custom-CI-Config-Path' into 'master'
Resolve "Project option to allow customizing CI/CD config path"

Closes #32815 and #33130

See merge request !12509
2017-07-06 07:20:36 +00:00
vanadium23 8d44d5142a Add user projects API 2017-07-06 08:04:54 +03:00
Douwe Maan fe13f11041 Create and use project path helpers that only need a project, no namespace 2017-07-05 11:11:59 -05:00
Nick Thomas 35f4a00f37 Introduce cache policies for CI jobs 2017-07-05 15:39:26 +01:00
Lin Jen-Shin 33a5157ad4 Merge remote-tracking branch 'upstream/master' into 32815--Add-Custom-CI-Config-Path
* upstream/master: (149 commits)
  Revert change to design. Go back to scrollable page
  Fixes the column widths for the new navigation options in settings
  Migrate #submodule_url_for to Gitaly
  Add test example for external commit status retries
  Fix invalid Rails.logger call in lib/gitlab/health_checks/fs_shards_check.rb
  Fix build for !12300.
  Log rescued exceptions to Sentry
  Fix issues with non-UTF8 filenames by always fixing the encoding of tree and blob paths
  Revert "Merge branch 'revert-12499' into 'master'"
  Prevent accidental deletion of protected MR source branch by repeating checks before actual deletion
  Improve the overall UX for the new monitoring dashboard
  Document that GitLab 9.3 requires the TRIGGER permission on MySQL
  Instrument Unicorn with Ruby exporter
  Remove group modal like remove project modal. Closes #33130
  Update prometheus client gem
  Enables the option in user preferences to turn on the new navigation
  Add Jasmine tests for `OAuthRememberMe`
  Simplify authentication logic in the v4 users API for !12445.
  Use stub_application_setting when testing ApplicationHelper#support_url
  wait_for_requests is not needed when AJAX is not in play
  ...
2017-07-05 22:05:39 +08:00
Lin Jen-Shin 9f5ac179d1 Rename ci_config_file to ci_config_path 2017-07-05 20:11:01 +08:00
Douwe Maan 5e2f7f25eb Merge branch 'master' into '33580-fix-api-scoping'
# Conflicts:
#   lib/api/users.rb
2017-07-04 15:00:01 +00:00
Rémy Coutable 52862754ab Merge branch '34141-allow-unauthenticated-access-to-the-users-api' into 'master'
Allow unauthenticated access to the `/api/v4/users` API

Closes #34141

See merge request !12445
2017-07-04 14:45:40 +00:00
Timothy Andrew d1488268b2 Simplify authentication logic in the v4 users API for !12445.
- Rather than using an explicit check to turn off authentication for the
  `/users` endpoint, simply call `authenticate_non_get!`.

- All `GET` endpoints we wish to restrict already call
  `authenticated_as_admin!`, and so remain inacessible to anonymous users.

- This _does_ open up the `/users/:id` endpoint to anonymous access. It contains
  the same access check that `/users` users, and so is safe for use here.

- More context: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12445#note_34031323
2017-07-04 12:19:48 +00:00
Stan Hu 2a9c2fec4e Optimize creation of commit API by using Repository#commit instead of Repository#commits
Repository#commits is expensive because it has to use Rugged to walk the Git
tree as opposed to doing a direct ref lookup.

Improves performance in #34533
2017-07-03 15:48:13 -07:00
Lin Jen-Shin d7c32c5870 Fix various descriptions given the feedback 2017-07-04 02:00:50 +08:00
Timothy Andrew 5dedea358d Merge remote-tracking branch 'origin/master' into 34141-allow-unauthenticated-access-to-the-users-api
- Modify policy code to work with the `DeclarativePolicy` refactor
  in 37c401433b.
2017-06-30 13:45:51 +00:00
Timothy Andrew 3c88a7869b Implement review comments for !12445 from @godfat and @rymai.
- Use `GlobalPolicy` to authorize the users that a non-authenticated user can
  fetch from `/api/v4/users`. We allow access if the `Gitlab::VisibilityLevel::PUBLIC`
  visibility level is not restricted.

- Further, as before, `/api/v4/users` is only accessible to unauthenticated users if
  the `username` parameter is passed.

- Turn off `authenticate!` for the `/api/v4/users` endpoint by matching on the actual
  route + method, rather than the description.

- Change the type of `current_user` check in `UsersFinder` to be more
  compatible with EE.
2017-06-30 13:06:03 +00:00
Timothy Andrew afbc7520c2 `AccessTokenValidationService` accepts `String` or `API::Scope` scopes.
- There's no need to use `API::Scope` for scopes that don't have `if`
  conditions, such as in `lib/gitlab/auth.rb`.
2017-06-30 07:32:25 +00:00
Lin Jen-Shin 62fdbbeeb0 Merge remote-tracking branch 'upstream/master' into 32815--Add-Custom-CI-Config-Path
* upstream/master: (123 commits)
  Backport changes to Projects::IssuesController and the search bar
  bugfix: use `require_dependency` to bring in DeclarativePolicy
  Resolve "Select branch dropdown is too close to branch name"
  Clean up issuable lists
  Defer project destroys within a namespace in Groups::DestroyService#async_execute
  Fixed new navgiation bar logo height in Safari
  Resolve "Issue dropdown persists when adding issue number to issue description"
  Move verification to block level instead of paragraph
  Revert "Merge branch 'dm-drop-default-scope-on-sortable-finders' into 'master'"
  Added code for defining SHA attributes
  Minor edits
  Job details won't scroll horizontally to show long lines
  Run mysql tests on stable preperation branches like 9-3-stable-patch-2
  Bring back branches badge to main project page
  optimize translation content based on comments
  supplement traditional chinese in taiwan translation
  Inserts exact matches of username, email and name to the top of the user search list
  Remove Namespace model default scope override and write additional test to Project search
  optimize translation content based on comments
  Limit OpenGraph image size to 64x64
  ...
2017-06-30 13:46:51 +08:00
http://jneen.net/ 7765dd6a1d bugfix: use `require_dependency` to bring in DeclarativePolicy 2017-06-29 11:57:59 -07:00
Robert Speicher 066a6c8ba8 Merge branch '34078-allow-to-enable-feature-flags-with-more-granularity' into 'master'
Allow the feature flags to be enabled/disabled with more granularity

Closes #34078

See merge request !12357
2017-06-29 16:36:22 +00:00
Sean McGivern 8c5538be40 Merge branch 'refactor/declarative-policy' into 'master'
Refactor/declarative policy

See merge request !10515
2017-06-29 13:20:24 +00:00
Douwe Maan 46def2045e Merge branch 'add-members-count-and-parent-id-data-on-namespaces-api' into 'master'
Add group members counting related data on namespaces API

See merge request !12497
2017-06-29 13:04:13 +00:00
Timothy Andrew b8ec1f4201 Extract a `Gitlab::Scope` class.
- To represent an authorization scope, such as `api` or `read_user`
- This is a better abstraction than the hash we were previously using.
2017-06-29 06:15:57 +00:00
Oswaldo Ferreira bd4c2847f4 Rename members_count to members_count_with_descendants and expose only to group admins 2017-06-28 17:27:01 -03:00
Oswaldo Ferreira da3e4f4128 Add "members_count" and "parent_id" data on namespaces API 2017-06-28 15:50:29 -03:00
Rémy Coutable 289fae78e9
Rename flipper_group to feature_group
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-28 19:29:56 +02:00
Tiago Botelho 34f57b462b Fix current feature related specs 2017-06-28 11:32:34 +01:00