Commit Graph

418 Commits

Author SHA1 Message Date
Stan Hu f5847911ca Bump Gitaly version to v1.12.0 2018-12-21 23:41:37 +00:00
Jasper Maes 56296f1eda Remove rails4 specific code 2018-12-16 10:48:41 +01:00
Kamil Trzciński 39c1731a53 Log and pass correlation-id between Unicorn, Sidekiq and Gitaly
The Correlation ID is taken or generated from received X-Request-ID.
Then it is being passed to all executed services (sidekiq workers
or gitaly calls).

The Correlation ID is logged in all structured logs as `correlation_id`.
2018-12-06 20:46:14 +01:00
Francisco Javier López 9a5703ec82 Set content disposition attachment to several endpoints 2018-11-23 16:44:09 +00:00
William George 1b153d497b Make getting a user by the username case insensitive 2018-10-18 09:06:44 +00:00
gfyoung 3836d69119 Enable frozen string in lib/api and lib/backup
Partially addresses #47424.

Had to make changes to spec files because
stubbing methods on frozen objects is a mess
in RSpec and leads to failures:

https://github.com/rspec/rspec-mocks/issues/1190
2018-09-29 21:04:50 -07:00
Robert Speicher c7d1eef671 Merge branch 'rubocop-code-reuse' into 'master'
Add RuboCop cops to enforce code reusing rules

See merge request gitlab-org/gitlab-ce!21391
2018-09-13 14:53:05 +00:00
🙈 jacopo beschi 🙉 8e52f56d8d Resolve "500 Internal Server Error: Deleting branch of deleted project" 2018-09-12 20:52:30 +00:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Robert Schilling 4e39fc1a40 Fix rubocop 2018-09-08 11:44:55 +02:00
Robert Schilling a14e9cfde8 API: Use find_branch! in all places 2018-09-08 10:55:17 +02:00
Marko, Peter 6d72bb3832 Add min_access_level filter to projects API
Signed-off-by: Marko, Peter <peter.marko@siemens.com>
2018-07-23 20:57:50 +02:00
Marko, Peter 209fd86442 Fix archived parameter for projects API 2018-07-16 16:25:38 +02:00
Jasper Maes 876d43b9f5 Rails5 fix no implicit conversion of Hash into String. ActionController::Parameters no longer returns an hash in Rails 5 2018-06-13 23:49:44 +02:00
Jan Provaznik 7a76caa5a8 Merge request and commit discussions API 2018-05-01 12:39:44 +00:00
Andreas Brandl c4e4258721 Validate project path prior to hitting the database.
Closes #45247.
2018-04-13 15:59:45 +02:00
Douwe Maan 44f4a674e2 Merge branch 'jramsay-38830-tarball' into 'master'
Add alternative archive route

Closes #38830

See merge request gitlab-org/gitlab-ce!17225
2018-04-06 14:14:39 +00:00
Grzegorz Bizon dd271e2460 Merge branch 'direct-upload-of-artifacts' into 'master'
Direct upload of artifacts

See merge request gitlab-org/gitlab-ce!18160
2018-04-05 20:59:40 +00:00
Kamil Trzciński 678620cce6 Add `direct_upload` setting for artifacts 2018-04-05 15:01:14 +02:00
James Ramsay 0b1b9c409d Add option to suppress archive commit sha
Repository archives are always named `<project>-<ref>-<sha>` even if
the ref is a commit. A consequence of always including the sha even
for tags is that packaging a release is more difficult because both
the ref and sha must be known by the packager.

- add append_sha option (defaults true) to provide a method for
toggling this feature.

Support added to GitLab Workhorse by gitlab-org/gitlab-workhorse!232
2018-04-04 16:56:18 -04:00
Felipe Artur ad7148d9ea Allow assigning and filtering issuables by ancestor group labels 2018-04-04 15:40:29 +00:00
Micaël Bergeron fc6587f1f2 Add proxy_download to perform proxied sending of all files 2018-03-09 09:16:06 -05:00
Kamil Trzciński a2f375e8f7 Merge remote-tracking branch 'origin/master' into object-storage-ee-to-ce-backport 2018-02-28 21:28:43 +01:00
Kamil Trzciński 729391fbfc Merge commit '8af23def1d6' into object-storage-ee-to-ce-backport 2018-02-28 21:11:53 +01:00
Grzegorz Bizon b14c484bb1 Merge branch 'use-send-url-for-incompatible-runners' into 'master'
Support SendURL for performing indirect download of artifacts if clients does…

See merge request gitlab-org/gitlab-ee!4401
2018-02-28 20:58:56 +01:00
Kamil Trzciński 45d2c31643 Merge commit '4b92efd90cedaa0aff218d11fdce279701128bea' into object-storage-ee-to-ce-backport 2018-02-28 20:46:53 +01:00
Kamil Trzciński 965dc28691 Merge commit '7fabc892f251740dbd9a4755baede662e6854870' into object-storage-ee-to-ce-backport 2018-02-28 20:36:55 +01:00
Kamil Trzciński e3fafa7632 Merge commit 'f2f58a60b76acd479e37bdbc9246ec9f9b2bea82' into object-storage-ee-to-ce-backport 2018-02-28 20:36:07 +01:00
Kamil Trzciński e0401df121 Merge commit '11c67e7c2f992299ff5918ce67995b73d1e0be6d' into object-storage-ee-to-ce-backport 2018-02-28 20:35:22 +01:00
Kamil Trzciński 5a69b51bc8 Merge commit 'b39d0c318921bae2e3a11df9ee6828291dad9864' into object-storage-ee-to-ce-backport 2018-02-28 20:06:12 +01:00
Kamil Trzciński b1f8d8a173 Merge commit '5b08d59f07fc53c1e34819fac20352119d5343e6' into object-storage-ee-to-ce-backport 2018-02-28 20:03:02 +01:00
Grzegorz Bizon 52c3b8f312 Merge branch 'zj-object-store-artifacts' into 'master'
Object store for artifacts

Closes gitlab-ce#29203

See merge request !1762
2018-02-28 20:00:27 +01:00
Bob Van Landuyt 148816cd67 Port `read_cross_project` ability from EE 2018-02-22 17:11:36 +01:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Stan Hu eaf9088ba8 Save user ID and username in Grape API log (api_json.log)
This will enable admins to identify who actually made the API request.

Relates to #36960
2018-01-08 21:23:24 -08:00
Sean McGivern 0f33ac6442 Merge branch 'backport-issue_3413' into 'master'
[EE-backport] Add group boards API endpoint

See merge request gitlab-org/gitlab-ce!16194
2018-01-05 14:17:19 +00:00
Felipe Artur 5e148d4e93 EE-BACKPORT group boards 2018-01-04 17:28:10 -02:00
Rubén Dávila cf8f09636b Fix API endpoints to edit wiki pages where project belongs to a group
In some cases is prefered to manually create a ProjectWiki over using
Project#wiki. This is because Project#wiki always uses the #owner (which
is a User sometimes) as the
author of the wiki changes but sometimes the owner is a Group and it
doesn't respond to #username
2018-01-03 00:22:01 -05:00
Lin Jen-Shin 85be6d83be Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (170 commits)
  support ordering of project notes in notes api
  Redirect to an already forked project if it exists
  Reschedule the migration to populate fork networks
  Create fork networks for forks for which the source was deleted.
  Fix item name and namespace text overflow in Projects dropdown
  Minor backport from EE
  fix link that was linking to `html` instead of `md`
  Backport epic tasklist
  Add timeouts for Gitaly calls
  SSHUploadPack over Gitaly is now OptOut
  fix icon colors in commit list
  Fix star icon color/stroke
  Backport border inline edit
  Add checkboxes to automatically run AutoDevops pipeline
  BE for automatic pipeline when enabling Auto DevOps
  I am certainly weary of debugging sidekiq but I don't think that's what was meant
  Ensure MRs always use branch refs for comparison
  Fix issue comment submit button disabled on GFM paste
  Lock seed-fu at the correct version in Gemfile.lock
  Improve indexes on merge_request_diffs
  ...
2017-11-30 15:20:00 +08:00
Tomasz Maczukin 97f966c445
Introduce :read_namespace access policy for namespace and group 2017-11-23 17:44:05 +01:00
Tomasz Maczukin dfbfd3c7d7
Allow request namespace by ID or path 2017-11-23 17:44:05 +01:00
Lin Jen-Shin 663593e87e Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (126 commits)
  Update VERSION to 10.3.0-pre
  Update CHANGELOG.md for 10.2.0
  default fill color for SVGs
  ignore hashed repos (for now) when using `rake gitlab:cleanup:repos`
  Use Redis cache for branch existence checks
  Update CONTRIBUTING.md: Link definition of done to criteria
  Use `make install` for Gitaly setups in non-test environments
  FileUploader should check for hashed_storage?(:attachments) to use disk_path
  Set the default gitlab-shell timeout to 3 hours
  Update composite pipelines index to include "id"
  Use arrays in Pipeline#latest_builds_with_artifacts
  Fix blank states using old css
  Skip confirmation user api
  Custom issue tracker
  Revert "check for `read_only?` first before seeing if request is disallowed"
  add `#with_metadata` scope to remove a N+1 from the notes' API
  Fix promoting milestone updating all issuables without milestone
  Batchload blobs for diff generation
  check for `read_only?` first before seeing if request is disallowed
  use `Gitlab::Routing.url_helpers` instead of `Rails.application.routes.url_helpers`
  ...
2017-11-22 17:07:01 +08:00
Lin Jen-Shin 07d3d44775 Move ModuleWithInstanceVariables to Gitlab namespace
And use .rubocop.yml to exclude paths we don't care,
rather than using the cop itself to exclude.
2017-11-22 17:06:57 +08:00
Lin Jen-Shin 9ac0c76b78 Use StrongMemoize and enable/disable cops properly 2017-11-18 01:01:53 +08:00
Lin Jen-Shin 0af35d7e30 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (507 commits)
  Add dropdowns documentation
  Convert migration to populate latest merge request ID into a background migration
  Set 0.69.0 instead of latest for codeclimate image
  De-duplicate background migration matchers defined in spec/support/migrations_helpers.rb
  Update database_debugging.md
  Update database_debugging.md
  Move installation of apps higher
  Change to Google Kubernetes Cluster and add internal links
  Add Ingress description from official docs
  Add info on creating your own k8s cluster from the cluster page
  Add info about the installed apps in the Cluster docs
  Resolve "lock/confidential issuable sidebar custom svg icons iteration"
  Update HA README.md to clarify GitLab support does not troubleshoot DRBD.
  Update license_finder to 3.1.1
  Make sure NotesActions#noteable returns a Noteable in the update action
  Cache the number of user SSH keys
  Adjust openid_connect_spec to use `raise_error`
  Resolve "Clicking on GPG verification badge jumps to top of the page"
  Add changelog for container repository path update
  Update container repository path reference
  ...
2017-11-17 19:19:06 +08:00
Francisco Lopez 1436598e49 Moved Exceptions to Gitlab::Auth 2017-11-17 10:02:11 +01:00
Francisco Lopez aa84ef1e1a Moving exceptions to UserAuthFinders 2017-11-17 10:02:11 +01:00
Travis Miller 1162d89ac4 Add administrative endpoint to list all pages domains 2017-11-13 16:05:44 +00:00
Lin Jen-Shin fc6aad0b44 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (1723 commits)
  Resolve "Editor icons"
  Refactor issuable destroy action
  Ignore routes matching legacy_*_redirect in route specs
  Gitlab::Git::RevList and LfsChanges use lazy popen
  Gitlab::Git::Popen can lazily hand output to a block
  Merge branch 'master-i18n' into 'master'
  Remove unique validation from external_url in Environment
  Expose `duration` in Job API entity
  Add TimeCop freeze for DST and Regular time
  Harcode project visibility
  update a changelog
  Put a condition to old migration that adds fast_forward column to MRs
  Expose project visibility as CI variable
  fix flaky tests by removing unneeded clicks and focus actions
  fix flaky test in gfm_autocomplete_spec.rb
  Use Gitlab::Git operations for repository mirroring
  Encapsulate git operations for mirroring in Gitlab::Git
  Create a Wiki Repository's raw_repository properly
  Add `Gitlab::Git::Repository#fetch` command
  Fix Gitlab::Metrics::System#real_time and #monotonic_time doc
  ...
2017-11-06 21:44:57 +08:00
Markus Koller 6902848a9c
Support custom attributes on projects 2017-11-06 10:51:46 +01:00
Douwe Maan b7c8f7d76d Update specs for sudo behavior 2017-11-02 11:39:03 +01:00
Douwe Maan 3f24f9ed18 Add sudo API scope 2017-11-02 11:39:03 +01:00
Travis Miller 8d1ab256bf Add pages domains API implementation 2017-10-22 08:04:43 -05:00
Douwe Maan 025c6eeaa1 Move all API authentication code to APIGuard 2017-10-12 11:13:37 +02:00
Alejandro Rodríguez 60a35e4230 Send API parameters as extra data for sentry errors 2017-10-05 18:31:34 -03:00
Rémy Coutable 3040b994df
Ensure no exception is raised when Raven tries to get the current user in API context
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-09-29 18:57:22 +02:00
Douwe Maan b6c5a73c0b Make sure API responds with 401 when invalid authentication info is provided 2017-09-28 14:17:52 +02:00
Lin Jen-Shin 6a4ee9aa71 Allow simple ivar ||= form. Update accordingly 2017-09-19 01:29:32 +08:00
Lin Jen-Shin 9ae92b8caa Add cop to make sure we don't use ivar in a module 2017-09-18 21:23:45 +08:00
Ruben Davila 62bb6235c2 Make Members with Owner and Master roles always able to create subgroups 2017-09-07 13:47:58 -05:00
Grzegorz Bizon 8ed0a05107 Merge branch 'wiki_api' into 'master'
Add API support for wiki pages

Closes #12747

See merge request !13372
2017-09-07 10:38:03 +00:00
blackst0ne 2915bb2707 Add API support for wiki pages 2017-09-07 09:21:52 +11:00
Grzegorz Bizon c922fb4b68 Respond with a bad request if artifact path is invalid 2017-09-06 11:31:08 +02:00
Grzegorz Bizon 80b3dcc777 Extract job artifacts API code to a separate file 2017-09-06 11:20:12 +02:00
Grzegorz Bizon dfb8fcbb65 Use API helper to send artifact file through Workhorse 2017-09-05 11:16:49 +02:00
Sean McGivern b9d8946395 Don't use public_send in destroy_conditionally! helper
As we only override in two places, we could just ask for the value rather than
the method name.
2017-08-30 14:32:02 +01:00
Robert Schilling dcd4ea473c Update remaining endpoints 2017-08-28 17:10:30 +02:00
Robert Schilling e80313f9ee Conditionally destroy a ressource 2017-08-28 16:40:25 +02:00
Robert Schilling 998afa5f74 API: Respect the 'If-Unmodified-Since' for delete endpoints 2017-08-28 16:40:25 +02:00
Zeger-Jan van de Weg dc8e1676cd
Upgrade grape to 1.0
Main feature was the deprication of the Hashie stuff, so the access by
calling keys as method is gone now.
2017-08-16 22:06:31 +02:00
Lin Jen-Shin 4f0fa13eb8 Show error message for API 500 error in tests, and
document have_gitlab_http_status
2017-08-11 20:50:35 +08:00
Douwe Maan 14644d40e0 Do not validate CSRF token in API unless needed 2017-08-02 18:20:31 +02:00
Douwe Maan dcf4a2e83c Rescue only from ActionController::InvalidAuthenticityToken 2017-07-26 11:25:10 +02:00
blackst0ne cc3a82bc8b Add `rescue false`. 2017-07-26 11:05:44 +02:00
blackst0ne 8ce8b21f67 Refactor CSRF protection 2017-07-26 11:05:44 +02:00
blackst0ne 2902235099 Add CSRF token verification to API 2017-07-26 11:05:44 +02:00
Felipe Artur c5c9dce270 Add group milestones API endpoint 2017-07-21 11:00:00 -03:00
vanadium23 8d44d5142a Add user projects API 2017-07-06 08:04:54 +03:00
Timothy Andrew 4dbfa14e16 Implement review comments from @dbalexandre for !12300. 2017-06-28 07:17:13 +00:00
Timothy Andrew d774825f98 When verifying scopes, manually include scopes from `API::API`.
- They are not included automatically since `API::Users` does not inherit from
  `API::API`, as I initially assumed.

- Scopes declared in `API::API` are considered global (to the API), and need to
  be included in all cases.
2017-06-28 07:17:13 +00:00
Timothy Andrew 80c1ebaa83 Allow API scope declarations to be applied conditionally.
- Scope declarations of the form:

    allow_access_with_scope :read_user, if: -> (request) { request.get? }

  will only apply for `GET` requests

- Add a negative test to a `POST` endpoint in the `users` API to test this. Also
  test for this case in the `AccessTokenValidationService` unit tests.
2017-06-28 07:17:13 +00:00
Timothy Andrew 6f1922500b Initial attempt at refactoring API scope declarations.
- Declaring an endpoint's scopes in a `before` block has proved to be
  unreliable. For example, if we're accessing the `API::Users` endpoint - code
  in a `before` block in `API::API` wouldn't be able to see the scopes set in
  `API::Users` since the `API::API` `before` block runs first.

- This commit moves these declarations to the class level, since they don't need
  to change once set.
2017-06-28 07:17:13 +00:00
Rémy Coutable 4cfa5ce4a9
Enable the Style/PreferredHashMethods cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-02 19:11:26 +02:00
Kamil Trzcinski 6185d12c18 Add missing specs 2017-06-01 16:34:48 +02:00
Toon Claes db679788e4 Add :owned param to ProjectFinder
And use it in the API.
2017-05-30 22:45:59 +02:00
Toon Claes 0f0b9a8466 Use helper to construct Finder params
The ProjectsFinder and GroupFinder both support the same set of params. And the
`/api/v4/projects` and `/api/v4/group/:id/projects` also support the same set of
params. But they do not match the Finder params. So use a helper method to
transform them.
2017-05-30 22:45:59 +02:00
Toon Claes a1deed629e Use ProjectFinder to filter the projects
Instead of trying to do the heavy lifting in the API itself, use the existing
features of the ProjectFinder.
2017-05-30 22:45:59 +02:00
Toon Claes 07fc79e7c5 Handle `membership` in ProjectFinder
The ProjectFinder supports the `non_public` parameter. This can be used to find
only projects the user is member of.
2017-05-30 22:45:59 +02:00
Robert Speicher cb2f739d48 Merge branch '27144-enforce-rubocop-trailing_commas-no_comma-style' into 'master'
Resolve "Use consistent style for trailing commas"

Closes #27144

See merge request !11063
2017-05-10 21:43:34 +00:00
Rémy Coutable 3db37e0562 Enable the Style/TrailingCommaInArguments cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Bob Van Landuyt ebd8b7f60f Use new SnippetsFinder signature in API 2017-05-10 16:48:18 +02:00
Timothy Andrew 4dfdef2ddf Allow admins to sudo to blocked users.
- Currently, (for example) admins can't delete snippets for blocked users, which
  is an unexpected limitation.

- We modify `authenticate!` to conduct the `access_api` policy check against the
  `initial_current_user`, instead of the user being impersonated.

- Update CHANGELOG for !10842
2017-04-26 08:00:19 +00:00
blackst0ne 11aff97d88 Remove the User#is_admin? method 2017-04-09 13:20:57 +11:00
Toon Claes add5cd996f API: Make the /notes endpoint work with noteable iid instead of id
In API V4 all endpoints were changed so Merge Requests and Issues
should be referred by iid, instead of id. Except the /notes endpoint
was forgotten. So change the endpoints from:

- /projects/:id/issues/:issue_id/notes
- /projects/:id/merge_requests/:merge_request_id/notes

To:

- /projects/:id/issues/:issue_iid/notes
- /projects/:id/merge_requests/:merge_request_iid/notes

For Project Snippets nothing changes.
2017-03-27 15:29:37 +02:00
http://jneen.net/ 0ea04cc5bf use the policy stack to protect logins 2017-03-09 11:49:52 -08:00
http://jneen.net/ 846e581732 use a magic default :global symbol instead of nil
to make sure we mean the global permissions
2017-03-09 11:49:52 -08:00
Timothy Andrew 719327112c
API routes referencing a specific merge request should use the MR `iid`
- As opposed to the `id` that was previously being used.
- This brings the API routes closer to the web interface's routes.
- This is specific to API v4.
2017-03-07 13:06:42 +05:30
Timothy Andrew dd99622347
API routes referencing a specific issue should use the issue `iid`
- As opposed to the issue `id` that was previously being used.
- This brings the API routes closer to the web interface's routes.
- This is specific to API v4.
2017-03-07 13:06:42 +05:30
Pawel Chojnacki 8993801f0c Test various login scenarios if the limit gets enforced 2017-03-06 15:41:25 +01:00
Adam Niedzielski c727d4328f Remove "subscribed" field from API responses returning list of issues or merge requests 2017-03-06 14:17:07 +01:00
Toon Claes 6357635686 Rename query parameter to `membership`
The query parameter `membership` should be more self-explaining.
2017-03-03 13:42:39 +01:00
Oswaldo Ferreira 06e96907ee Add filter param for authorized projects for current_user for V4 2017-03-03 12:02:41 +01:00
Mark Fletcher 61baf3528d Enable filtering milestones by search criteria in the API
- Also remove a redundant test
2017-03-02 10:07:57 +05:30
Oswaldo 2b001d9e7a Return 202 with JSON body on async removals on V4 API 2017-02-23 19:55:13 -03:00
Douwe Maan b7d8df503c Enable Style/MutableConstant 2017-02-23 09:31:56 -06:00
Sean McGivern 7e8a6a63af Merge branch '28093-snippet-and-issue-spam-check-on-edit' into 'master'
Spam check and reCAPTCHA improvements

Closes #28093

See merge request !9248
2017-02-22 10:13:20 +00:00
Douwe Maan f40716f48a No more and/or 2017-02-21 16:31:14 -06:00
Oswaldo Ferreira 2ace39f242 Spam check and reCAPTCHA improvements 2017-02-21 13:32:49 -03:00
Robert Schilling 612e61f4c4 Use grape validation for dates 2017-02-20 14:24:09 +01:00
Toon Claes 4e9e29d295 API: Consolidate /projects endpoint
It consolidates these endpoints:
 - /projects
 - /projects/owned
 - /projects/visible
 - /projects/starred
 - /projects/all

Into the /projects endpoint using query parameters.
2017-02-14 16:41:57 +01:00
Robert Schilling 6e1d675de9 API: Fix file downloading 2017-02-03 12:42:11 +01:00
Adam Pahlevi a0586dbc16 replace `find_with_namespace` with `find_by_full_path`
add complete changelog for !8949
2017-02-03 07:14:04 +07:00
Robert Speicher 3a5df1d8fc Merge branch 'fix-api-mr-permissions' into 'security'
Ensure that only privileged users can access merge requests in the API

See merge request !2053
2017-01-23 13:54:35 -05:00
Kamil Trzcinski d8e440c8e0
Fix specs 2017-01-19 23:41:12 +01:00
Kamil Trzcinski 31af6be076
Fix specs 2017-01-19 23:31:03 +01:00
Kamil Trzcinski 8171a1932b
Merge remote-tracking branch 'origin/master' into 21698-redis-runner-last-build 2017-01-19 15:31:04 +01:00
Sean McGivern cc1e43da39 Merge branch 'time-tracking-api' into 'master'
Time tracking API

Closes #25861

See merge request !8483
2017-01-18 18:18:13 +00:00
Ruben Davila 0f3c9355c1 Add some API endpoints for time tracking.
New endpoints are:

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/time_estimate"

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/reset_time_estimate"

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/add_spent_time"

POST :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/reset_spent_time"

GET  :project_id/(issues|merge_requests)/(:issue_id|:merge_request_id)/time_stats"
2017-01-18 10:48:16 -06:00
Robert Schilling 1cccb37831 Fix a API deprecation warning 2017-01-16 00:38:25 +01:00
Lin Jen-Shin 8c9a4ed373 WIP: Add tests and make sure that headers are set
* We realized that headers were not set whenever we give 204
  because `render_api_error!` doesn't preserve the headers.

* We also realized that `update_runner_info` would be called in
  POST /builds/register every time therefore runner is updated
  every time, ticking the queue, making this last_update didn't
  work very well, and the test would be failing due to that.
2017-01-04 17:46:56 +08:00
Regis 0a074f2e09 fix pipelines/index.html.haml merge conflict 2017-01-02 16:24:37 -07:00
Robert Schilling 465700ddc2 Merge branch 'fix-api-deprecation' into 'master'
Fix a Grape deprecation, use `#request_method` instead of `#route_method`

See merge request !8297
2016-12-28 11:36:28 +00:00
Rémy Coutable 1b109c99a4
Fix a Grape deprecation, use `#request_method` instead of `#route_method`
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-23 19:07:23 +01:00
Markus Koller 3ef4f74b1a
Add more storage statistics
This adds counters for build artifacts and LFS objects, and moves
the preexisting repository_size and commit_count from the projects
table into a new project_statistics table.

The counters are displayed in the administration area for projects
and groups, and also available through the API for admins (on */all)
and normal users (on */owned)

The statistics are updated through ProjectCacheWorker, which can now
do more granular updates with the new :statistics argument.
2016-12-21 16:39:49 +01:00
Grzegorz Bizon 468b47d47c Remove redundant pagination helpers after a bad merge
[ci skip]
2016-12-21 15:19:00 +01:00
Grzegorz Bizon 3deaf1342e Merge branch 'master' into auto-pipelines-vue
* master: (367 commits)
  Set “Remove branch” button to default size
  remove unused helper method
  reduce common code even further to satisfy rake flay
  remove button class size alteration from revert and cherry pick links
  factor out common code to satisfy rake flay
  homogenize revert and cherry-pick button styles generated by commits_helper
  apply margin on alert banners only when there is one or more alerts
  Rename MattermostNotificationService back to MattermostService
  Rename SlackNotificationService back to SlackService
  Fix stage and pipeline specs and rubocop offenses
  Added QueryRecorder to test N+1 fix on Milestone#show
  Use gitlab-workhorse 1.2.1
  Make 'unmarked as WIP' message more consistent
  Improve specs for Files API
  Allow unauthenticated access to Repositories Files API GET endpoints
  Add isolated view spec for pipeline stage partial
  Move test for HTML stage endpoint to controller specs
  Fix sizing of avatar circles; add border
  Fix broken test
  Fix broken test Changes after review
  ...

Conflicts:
	app/assets/stylesheets/pages/pipelines.scss
	app/controllers/projects/pipelines_controller.rb
	app/views/projects/pipelines/index.html.haml
	spec/features/projects/pipelines/pipelines_spec.rb
2016-12-21 12:09:06 +01:00
Timothy Andrew 7fa06ed55d Calls to the API are checked for scope.
- Move the `Oauth2::AccessTokenValidationService` class to
  `AccessTokenValidationService`, since it is now being used for
  personal access token validation as well.

- Each API endpoint declares the scopes it accepts (if any). Currently,
  the top level API module declares the `api` scope, and the `Users` API
  module declares the `read_user` scope (for GET requests).

- Move the `find_user_by_private_token` from the API `Helpers` module to
  the `APIGuard` module, to avoid littering `Helpers` with more
  auth-related methods to support `find_user_by_private_token`
2016-12-16 16:29:31 +05:30
Regis 77daed05ca merge master 2016-12-13 13:03:49 -07:00
Sean McGivern e3231cc297 Merge branch '25482-fix-api-sudo' into 'master'
API: Memoize the current_user so that the sudo can work properly

Closes #25482

See merge request !8017
2016-12-13 18:58:23 +00:00
Rémy Coutable d95b709a66
Be smarter when finding a sudoed user in API::Helpers
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-13 15:53:00 +01:00
Rémy Coutable 927a75567a Merge branch 'grapify-service-api' into 'master'
Grapify the service API

Related to #22928 

See merge request !7970
2016-12-12 17:54:00 +00:00
Rémy Coutable 2f45d3bcf0 API: Memoize the current_user so that the sudo can work properly
The issue was arising when `#current_user` was called a second time
after a user was impersonated: the `User#is_admin?` check would be
performed on it and it would fail.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-12 13:50:31 +01:00
Grzegorz Bizon 0f40ae5f18 Merge branch 'master' into auto-pipelines-vue
* master: (76 commits)
  Update "Installation from source" guide for 8.15.0
  Group links spec update
  Updates the font weight of button styles because of the change to system fonts
  Refactor SSH keys docs
  Improvements to setting up ssh
  Do not reload diff for merge request made from fork when target branch in fork is updated
  Add 8.12.10, 8.12.11, and 8.12.12 CHANGELOG.md items
  Changes after review
  Fix broken test
  Adds CHANGELOG entry
  Adds tests
  Uniformize props name format
  Replace commit icon svg logic
  Replace play icon svg logic
  Updated JS based on review Fixed group links dropdown to match
  Update docs to reflect new defaults on omnibus
  Merge branch 'jej-23867-use-mr-finder-instead-of-access-check' into 'security'
  Merge branch 'html-safe-diff-line-content' into 'security'
  Merge branch 'rs-filter-authentication_token' into 'security'
  Merge branch 'destroy-session' into 'security'
  ...

Conflicts:
	app/models/ci/pipeline.rb
	app/models/commit_status.rb
	app/views/projects/ci/pipelines/_pipeline.html.haml
	app/views/projects/commit/_pipeline.html.haml
	app/views/projects/pipelines/_with_tabs.html.haml
	app/views/projects/pipelines/index.html.haml
	lib/api/helpers.rb
2016-12-09 20:30:39 +01:00
Robert Schilling 593c912151 Grapify the service API 2016-12-09 17:20:12 +01:00
Douwe Maan 05efd19e89 Merge branch 'dz-nested-groups' into 'master'
Add nested groups support on data level

## What does this MR do?

- [x] Add  `parent_id` field to `Namespace`model. 
- [x] Create new database table `routes` that keeps information about full path to each group or project
- [x] Remove uniq index from `namespaces.path`
- [x] Add uniq index on `routes.path`
- [x] Fill routes table with path data from namespaces and projects
- [x] Change Namespace/Project URL lookup by routes table
- [x] Rename related routes (nested groups, projects) when parent path changes

This is solely backend preparation. UI, Permissions and API support will be added in separate merge request.   
 
## Are there points in the code the reviewer needs to double check?

migrations, Route model, Routable concern

Will require downtime. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7121#note_19490281 discussion

## Why was this MR needed?

One step further to full nested groups support

## Screenshots (if relevant)

No UI changes in this merge request so far

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added~~
- ~~[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 [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [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 it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/2772

See merge request !7121
2016-12-09 01:52:36 +00:00
Dmitriy Zaporozhets 83232be0e1
Add nested groups support on data level
* add parent_id field to namespaces table to store relation with nested groups
* create routes table to keep information about full path of every group and project
* project/group lookup by full path from routes table

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-08 11:47:16 +02:00
Douwe Maan cf2206eb2b Merge branch '24537-reenable-private-token-with-sudo' into 'master'
Reenables /user API request to return private-token if user is admin and requested with sudo

## What does this MR do?

Reenables the API /users to return `private-token` when sudo is either a parameter or passed as a header and the user is admin.

## Screenshots (if relevant)

Without **sudo**:

![Screen_Shot_2016-11-21_at_11.44.49](/uploads/ebecf95dbadaf4a159b80c61c75771d9/Screen_Shot_2016-11-21_at_11.44.49.png)

With **sudo**:
![Screen_Shot_2016-11-21_at_11.45.52](/uploads/f25f9ddffcf2b921e9694e5a250191d3/Screen_Shot_2016-11-21_at_11.45.52.png)

## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [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 it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?


Closes #24537

See merge request !7615
2016-12-08 00:17:44 +00:00
tiagonbotelho 3ed96afc47 adds impersonator variable and makes sudo usage overall more clear 2016-12-07 14:42:51 +00:00
Grzegorz Bizon 7870614fb9 Extract API pagination code to a separete module 2016-12-07 15:23:07 +01:00
Robert Schilling 3e7818e93a Grapify the issues API 2016-12-07 10:19:28 +01:00
Rémy Coutable d757247247
Allow public access to some Project API endpoints
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-01 16:39:42 +01:00
Rémy Coutable 43c8788e7b Merge branch 'grapify-projects-api' into 'master'
Grapify the projects API

Related to #22928 

See merge request !7456
2016-11-30 11:32:32 +00:00
Douwe Maan 3bf34face4 Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security'
Replace issue access checks with use of IssuableFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

## Which fixes are in this MR?

⚠️ - Potentially untested  
💣 - No test coverage  
🚥 - Test coverage of some sort exists (a test failed when error raised)  
🚦 - Test coverage of return value (a test failed when nil used)  
 - Permissions check tested

### Issue lookup with access check

Using `visible_to_user` likely makes these security issues too. See [Code smells](#code-smells).

- [x] 🚦 app/finders/notes_finder.rb:15 [`visible_to_user`]
- [x] 🚥 app/views/layouts/nav/_project.html.haml:73 [`visible_to_user`] [`.count`]
- [x]  app/services/merge_requests/build_service.rb:84 [`issue.try(:confidential?)`]
- [x]  lib/api/issues.rb:112 [`visible_to_user`]
  - CHANGELOG: Prevented API returning issues set to 'Only team members' to everyone
- [x]  lib/api/helpers.rb:126 [`can?(current_user, :read_issue, issue)`] Maybe here too?
- [x]  lib/gitlab/search_results.rb:53 [`visible_to_user`]

### Previous discussions
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b2ff264eddf9819d7693c14ae213d941494fe2b3_128_126
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#7b6375270d22f880bdcb085e47b519b426a5c6c7_87_87

See merge request !2031
2016-11-28 21:26:23 -03:00
Douwe Maan 3d7704ae5f Merge branch 'zj-fix-label-creation-non-members' into 'security'
Fix label creation non members

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23416

See merge request !2006
2016-11-28 21:24:19 -03:00
Robert Schilling 7c607a55ab Grapify the projects API 2016-11-28 21:01:43 +01:00
Rémy Coutable 81ba3f9177
API: Introduce `#find_group!` which also check access permission
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-24 16:58:32 +01:00
Rémy Coutable 4f5ed81232
API: Introduce `#find_project!` which also check access permission
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-24 14:40:35 +01:00
Rémy Coutable 4d2e7894ef
Make API::Helpers find a project with only one query
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-24 10:19:36 +01:00
Z.J. van de Weg f749fb7fe0 Improve style, add more tests 2016-11-18 11:38:54 +01:00
Z.J. van de Weg 0d04724fa1 More coverage on service level 2016-11-18 10:00:40 +01:00
Douwe Maan 4e63411daa Merge branch 'adam-build-missing-services-when-necessary' into 'master'
Defer saving project services to the database if there are no user changes

## What does this MR do?

It defers saving project services to the database as long as it is possible. It creates a project service when creating a project only if this project service has an active template. After that project services are saved on the first edit.

## Are there points in the code the reviewer needs to double check?

- tests that used `build_missing_services` before the change
- number of queries executed

## Why was this MR needed?

Motivation in #22281

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [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 it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Fixes #22281

See merge request !6958
2016-11-16 16:27:54 +00:00
Adam Niedzielski ef3be00a02 Defer saving project services to the database if there are no user changes 2016-11-16 12:46:07 +01:00
Robert Schilling 510092c83a Use #to_h to convert params to a hash 2016-11-14 11:17:51 +01:00
Felipe Artur f4e31b820e Fix project features default values 2016-11-01 11:03:56 -02:00
Rémy Coutable cae27eae3f
API: Fix booleans not recognized as such when using the `to_boolean` helper
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-27 18:21:09 +02:00
Douglas Barbosa Alexandre bf710b5119 Validate label params against all labels available to project on the API 2016-10-19 14:58:26 -02:00
Rémy Coutable 0876b46024 Merge branch 'memoize_shell_secret_token' into 'master'
Memoize Github::Shell's secret token

## What does this MR do?

`API::Helpers#secret_token` was reading the secret file on every invocation. This MR reads the file in the `gitlab_shell_secret_token.rb` initializer and saves it as a class variable at `Gitlab::Shell.secret_token`

## Are there points in the code the reviewer needs to double check?

 - I'm not sure if the use of `cattr_accessor` is the best approach, or if should be moved into the `class << self` block?
 - Should `API::Helpers#secret_token` be removed in favor of using `Gitlab::Shell.secret_token`?

## Why was this MR needed?

Performance optimization.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/22510

See merge request !6599
2016-10-07 10:35:03 +00:00
Justin DiPierro fe46e4eb35 Load Github::Shell's secret token from file on initialization instead of every request. 2016-10-06 11:22:37 -04:00
Nick Thomas 86c0c0869d Switch from request to env in ::API::Helpers
Per https://gitlab.com/gitlab-org/gitlab-ce/issues/22820, this helper is mixed
in to classes that lack a `request` method. They do include `env`, so use it
instead.
2016-10-06 15:07:25 +01:00
Nick Thomas fd51f19c97 API: disable rails session auth for non-GET/HEAD requests 2016-09-23 12:21:47 +01:00
Nick Thomas 10c072263b Enable Warden for the Grape API
The practical effect of this commit is to make the API check the Rails session
cookie for authentication details. If the cookie is present and valid, it will
be used to authenticate.

The API now has several authentication options for users. They follow in this
order of precedence:

* Authentication token
* Personal access token
* OAuth2 Bearer token (Doorkeeper - application access)
* Rails session cookie
2016-09-19 12:27:37 +01:00
Tomasz Maczukin 940f900f1c
Change response for /ci/api/v1/builds/register.json from 404 to 204 2016-09-13 17:44:18 +02:00
http://jneen.net/ 2bdcef4d67 use a nil subject when we want to check global abilities 2016-08-30 11:39:22 -07:00
http://jneen.net/ 5853c96b49 remove Ability.abilities 2016-08-30 11:35:06 -07:00
http://jneen.net/ 99ee86206e remove six, and use a Set instead 2016-08-30 11:32:55 -07:00
Stan Hu 170885edd6 Add Sentry logging to API calls
Closes #21043
2016-08-24 12:09:51 -07:00
Rémy Coutable 7c1b33b48f Restore back-compatibility for current members API endpoints
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-10 19:07:05 +02:00
Rémy Coutable 29850364ec New AccessRequests API endpoints for Group & Project
Also, mutualize AccessRequests and Members endpoints for Group &
Project.
New API documentation for the AccessRequests endpoints.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-10 19:07:05 +02:00
Robert Schilling 839aec1a61 Replace parse_boolean with to_boolean 2016-07-20 08:55:44 +02:00
Robert Schilling 54d26c89f6 API: Expose 'developers_can_push' for branches 2016-07-19 11:11:56 +02:00
Rémy Coutable 2cf7f09b1e
Revert "Revert "Merge branch '18193-developers-can-merge' into 'master' ""
This reverts commit 530f5158e2.

See !4892.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-18 10:16:56 +02:00
Robert Speicher 530f5158e2 Revert "Merge branch '18193-developers-can-merge' into 'master' "
This reverts commit 9ca633eb4c, reversing
changes made to fb229bbf79.
2016-07-13 13:57:30 -05:00
Timothy Andrew 60245bbe22 Refactor `Gitlab::GitAccess`
1. Don't use case statements for dispatch anymore. This leads to a lot
   of duplication, and makes the logic harder to follow.

2. Remove duplicated logic.

    - For example, the `can_push_to_branch?` exists, but we also have a
      different way of checking the same condition within `change_access_check`.

    - This kind of duplication is removed, and the `can_push_to_branch?`
      method is used in both places.

3. Move checks returning true/false to `UserAccess`.

    - All public methods in `GitAccess` now return an instance of
      `GitAccessStatus`. Previously, some methods would return
      true/false as well, which was confusing.

    - It makes sense for these kinds of checks to be at the level of a
      user, so the `UserAccess` class was repurposed for this. The prior
      `UserAccess.allowed?` classmethod is converted into an instance
      method.

    - All external uses of these checks have been migrated to use the
      `UserAccess` class

4. Move the "change_access_check" into a separate class.

    - Create the `GitAccess::ChangeAccessCheck` class to run these
      checks, which are quite substantial.

    - `ChangeAccessCheck` returns an instance of `GitAccessStatus` as
      well.

5. Break out the boolean logic in `ChangeAccessCheck` into `if/else`
   chains - this seems more readable.

6. I can understand that this might look like overkill for !4892, but I
   think this is a good opportunity to clean it up.

    - http://martinfowler.com/bliki/OpportunisticRefactoring.html
2016-07-13 13:24:56 +05:30
Timothy Andrew 7ee0898a9e Implement @DouweM's feedback.
- Extract a duplicated `redirect_to`
- Fix a typo: "token", not "certificate"
- Have the "Expires at" datepicker be attached to a text field, not inline
- Have both private tokens and personal access tokens verified in a
  single "authenticate_from_private_token" method, both in the
  application and API. Move relevant logic to
  `User#find_by_personal_access_token`
- Remove unnecessary constants relating to API auth. We don't need a
  separate constant for personal access tokens since the param is the
  same as for private tokens.
2016-06-16 08:24:13 +05:30
Timothy Andrew d0bcba1105 Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-14 09:06:53 +05:30
Stan Hu a85dde9182 Fix Error 500 when using closes_issues API with an external issue tracker
Closes #18484
2016-06-11 19:50:08 -07:00
Douwe Maan 701e2df7e5 Satisfy Rubocop 2016-06-10 12:29:15 +02:00
Douwe Maan 8c3ba8d6c9 Add workhorse controller and API helpers 2016-06-06 13:16:30 +02:00
Timothy Andrew ae0d8222af Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-03 09:31:16 +05:30
Robert Speicher 013bccbd93 Enable Style/DefWithParentheses cop and fix single offense 2016-05-23 13:06:36 -04:00
Gabriel Mazetto f5a0ac0fc1 Codestyle: make sure we have space around operators 2016-05-13 04:46:56 -03:00
Ahmad Sherif 0c22698bd4 Add API endpoints for un/subscribing from/to a label
Closes #15638
2016-05-12 22:48:09 +02:00
Timothy Andrew d915e7d5ca Reuse the private token param and header for personal access tokens.
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3749#note_11626427
- Personal access tokens are still a separate entity as far as the
  codebase is concerned - they just happen to use the same entry point
  as private tokens.
- Update tests and documentation to reflect this change
2016-05-11 10:16:23 +05:30
Timothy Andrew 2e9742997d Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-05-11 09:52:58 +05:30
Paco Guzman c4b9bd0413 API support for the 'since' and 'until' operators on commit requests
- Parameter validation as ISO8601 format
2016-04-29 09:26:52 +02:00
Timothy Andrew b22a47c62e Combine `API::Helpers::Core` and `API::Helpers::Authentication` back into `API::Helpers`
- Makes the MR easier to read; this can go in a separate MR
- This is a (sort of) revert of 99bea01
2016-04-28 22:28:36 +05:30
Timothy Andrew e8314ccca5 Refactor `API::Helpers` into `API::Helpers::Core` and `API::Helpers::Authentication` 2016-04-28 22:28:36 +05:30
Rémy Coutable 94e130cec3 Merge branch 'api-star-project' into 'master'
API: Star and unstar a project

Add two new endpoints `POST /projects/:id/star` and `POST /projects/:id/unstar` to star and unstar a project.

* Closes #12739


See merge request !3578
2016-04-13 15:05:21 +00:00
Robert Schilling 54231aa4e0 Styling changes to code and docs 2016-04-13 16:25:24 +02:00
Robert Schilling ea2193aaeb API: Star and unstar a project 2016-04-13 14:26:40 +02:00
Robert Schilling b2f48d8c46 API: Return 404 if user does not have access to group 2016-04-13 11:11:09 +02:00
Zeger-Jan van de Weg 1d77822816 minor improvements and fixed specs 2016-03-19 21:24:05 +01:00
Michi302 c41a8be8d2 Fix add_pagination_headers to keep request parameters in Link header 2016-02-02 15:26:29 +01:00
Kamil Trzcinski 95d2f0fb51 Fix CI runner version not being properly updated when asking for a build
Due to broken implementation of attribute_for_keys the runner information was not updated correctly.

This MR adds test to check that such scenario will never happen again.
2016-01-27 12:04:54 +01:00
Josh Frye 11797df1af Change 'public' flag to more robust 'visibility' query. 2016-01-19 09:57:00 -05:00
Josh Frye 10669097fa Add public params to GET /projects api. Closes #3788 2016-01-19 09:57:00 -05:00
Rémy Coutable 1b08cd811a Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into add-pagination-headers-to-api 2016-01-14 14:23:42 +01:00
Grzegorz Bizon 154b8ceba4 Refactor build artifacts upload API endpoint 2016-01-14 12:48:17 +01:00
Rémy Coutable 3183092ca9 Add pagination headers to already paginated API resources 2016-01-14 12:10:27 +01:00
Kamil Trzcinski e80e3f5372 Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00