Commit graph

110 commits

Author SHA1 Message Date
GitLab Bot
0a850868df Add latest changes from gitlab-org/gitlab@master 2019-10-09 12:06:13 +00:00
GitLab Bot
a712542edb Add latest changes from gitlab-org/gitlab@master 2019-10-08 15:06:04 +00:00
GitLab Bot
7bb7a8d529 Add latest changes from gitlab-org/gitlab@master 2019-09-25 03:06:21 +00:00
GitLab Bot
b7dfe2ae40 Add latest changes from gitlab-org/gitlab@master 2019-09-13 13:26:31 +00:00
Alex Kalderimis
e3a91089b7 Allow be_url to specify the type
This allows the be_url matcher to be more specific. By default, it only
matches HTTP and HTTPS URIs.
2019-08-30 04:43:16 +00:00
David Wilkins
467a411e88 Convert RestClient to Gitlab::HTTP for Prometheus Monitor
- Closes 

- Change PrometheusClient.new to accept a base url instead of an
  already created RestClient

- Use Gitlab::HTTP in PrometheusClient instead of creating RestClient
  in PrometheusService

- Move http_options from PrometheusService to
  PrometheusClient (follow_redirects: false)

- ensure that base urls don't have the trailing slash

- Created a `PrometheusClient#url` method that might not be strictly
  required

- Change rescued exceptions from RestClient::* to
  HTTParty::ResponseError where possible and StandardError for the
  rest
2019-08-07 02:42:20 +00:00
Thong Kuah
f0391c2517 Add frozen_string_literal to spec/support
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-07-25 17:33:34 +12:00
Gabriel Mazetto
c1fe76f15b Added the abort_execution matcher 2019-07-10 22:14:50 +01:00
Stan Hu
645c7f9631 Fix order-dependent Gitaly specs failing
If `spec/tasks/gitlab/cleanup_rake_spec.rb` preceded any of the Gitaly
request specs, it would import the `cleanup.rake` and the global
function `limit`. For some reason, the Protobuf implementation would use
the global function instead of the getter method. For example:

```
def limit
  puts "hi"
end

req = Gitaly::WikiGetAllPagesRequest.new
req.send(:limit)
hi
=> nil
```

To fix this problem, access the field value using the [] operator
instead.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64006
2019-07-02 20:33:02 -07:00
Kamil Trzciński
3f543cd2c9 Fix N+1 problem in JobsController#index
This adds missing preloads, and introduces
additional n+1 matcher to look for
duplicates.
2019-06-19 12:23:05 +02:00
Vladimir Shushlin
39e21fb266 Generate lets_encrypt_private_key on the fly
Remove migration generating lets encrypt key
Don't generate private_key if database is readonly

For reference:
This reverts commit 988a7f70489b99383b95e9f271a2caf6bb5b3a44.
This reverts commit 21acbe531592d55caf0e5b8716a3b551dafd6233.
2019-05-31 05:22:55 +00:00
Douwe Maan
838f7e56a4
Remove .wiki and @md-typography mixin in favor of .md and .md-file
Before, the styling for `img:not(.emoji)`` was repeated between
`.md:not(.use-csslab):not(.wiki)` (for comments and the Markdown
preview), `.documentation.wiki` (for help pages), and
`.issuable-details .description .wiki` (for MR and issue descriptions).

In these places, we now simply use `.md`. Wherever we use `.md` but
don't want this image styling (like wikis and blobs), `.md-file` is
added.
2019-03-26 14:29:33 +01:00
Rémy Coutable
88d6bdcfec
Reduce differences in spec/support/matchers/access_matchers.rb
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-03-07 08:13:38 +01:00
João Cunha
4c974f50f6 Get rid of ScheduleInstallationService
- deletes schedule_installation_service.rb
- moves schedule_installation_service.rb logic to create_service.rb
- moves specs as well

Removes code duplication

Remove unecessary spec block

Abide review suggestions

Test installable applications which are not associated to a cluster

Fix a typo

Removes duplciated expectation

Reuse variable instead of redefining

Remove method in favor of a local scoped lambda

Improve 'failing service' shared examples

Test the increase of status count

Remove duplicated test

Enable fronzen literal
2019-02-26 16:44:31 +00:00
Luke Duncalfe
ccb4edbca1 Improve GraphQL Authorization DSL
Previously GraphQL field authorization happened like this:

    class ProjectType
      field :my_field, MyFieldType do
        authorize :permission
      end
    end

This change allowed us to authorize like this instead:

    class ProjectType
      field :my_field, MyFieldType, authorize: :permission
    end

A new initializer registers the `authorize` metadata keyword on GraphQL
Schema Objects and Fields, and we can collect this data within the
context of Instrumentation like this:

    field.metadata[:authorize]

The previous functionality of authorize is still being used for
mutations, as the #authorize method here is called at during the code
that executes during the mutation, rather than when a field resolves.

https://gitlab.com/gitlab-org/gitlab-ce/issues/57828
2019-02-26 10:22:12 +13:00
Rémy Coutable
83a0db0c55 Merge branch 'bvl-user-status-message-35463' into 'master'
Allow users to set a status

Closes 

See merge request 
2018-08-01 15:21:24 +00:00
Sean McGivern
e6dd3c5276 Merge branch 'feature/gb/login-activity-metrics' into 'master'
Add user authentication activity metrics

Closes 

See merge request 
2018-07-31 10:44:22 +00:00
Bob Van Landuyt
f1d3ea63cf Show the status of a user in interactions
The status is shown for
- The author of a commit when viewing a commit
- Notes on a commit (regular/diff)
- The user that triggered a pipeline when viewing a pipeline
- The author of a merge request when viewing a merge request
- The author of notes on a merge request (regular/diff)
- The author of an issue when viewing an issue
- The author of notes on an issue
- The author of a snippet when viewing a snippet
- The author of notes on a snippet
- A user's profile page
- The list of members of a group/user
2018-07-30 15:01:26 +02:00
Grzegorz Bizon
c44541a506 Improve readability and move custom matchers to better place 2018-07-27 12:29:49 +02:00
Bob Van Landuyt
3bcb04f100 Add mutation toggling WIP state of merge requests
This is mainly the setup of mutations for GraphQL. Including
authorization and basic return type-structure.
2018-07-25 18:37:12 +02:00
Imre Farkas
c62fce9883
Delete UserActivities and related workers 2018-07-18 15:44:10 +02:00
Mark Chao
a63bce1a4b Resolve "Rename the Master role to Maintainer" Backend 2018-07-11 14:36:08 +00:00
Brett Walker
f3e1028371 Refactor rspec matchers in read_only_spec.rb 2018-07-07 04:22:44 +00:00
Bob Van Landuyt
54b56f20b7 Expose permissions on types in GraphQL
This adds a reusable way to expose permissions for a user to types in
GraphQL.
2018-06-28 13:50:17 +02:00
Lin Jen-Shin
3c242dda8c Bring changes from EE 2018-06-22 23:46:33 +08:00
Bob Van Landuyt
9403b1d951 Allow querying a single MR within a project
This allows the user to get a single MR nested in a GraphQL project
query.

Since we need the full path and the iid anyway, this makes more sense
than having a root query that needs the full path as well.
2018-06-15 14:38:32 +02:00
Bob Van Landuyt
9b65d4bb41 Initial setup GraphQL using graphql-ruby 1.8
- All definitions have been replaced by classes:
  http://graphql-ruby.org/schema/class_based_api.html
- Authorization & Presentation have been refactored to work in the
  class based system
- Loaders have been replaced by resolvers
- Times are now coersed as ISO 8601
2018-06-06 10:58:54 +02:00
Nick Thomas
9c6c17cbcd Add a minimal GraphQL API 2018-06-05 20:47:42 +02:00
Rémy Coutable
8576e45f28 Merge branch 'sh-add-uncached-query-limiter' into 'master'
Remove N+1 query for author in issues API

See merge request 
2018-06-05 08:22:14 +00:00
Stan Hu
cbc20d2b7f Remove N+1 query for author in issues API
This was being masked by the statement cache because only one author was used
per issue in the test..

Also adds support for an Rspec matcher `exceed_all_query_limit`.
2018-06-04 16:39:33 -07:00
Takuya Noguchi
3579ed016a Revert "Add a new have_html_escaped_body_text that match an HTML-escaped text"
This reverts commit 517598ba10.
2018-06-03 22:17:36 +09:00
Rémy Coutable
023d4f6f2f
Move spec helpers/matchers/shared examples/contexts to their relevant folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-04-23 12:20:30 +02:00
Bob Van Landuyt
2bf3846adc Add matcher for emoji 2018-04-11 10:51:44 +02:00
blackst0ne
dc4ae317ea Replace the project/issues/issues.feature spinach test with an rspec analog 2018-04-03 10:27:56 +00:00
Toon Claes
b0e5906d19 Add matcher to match elements by ids
Initially added in  and
.
2018-03-06 20:42:14 +01:00
Jarka Kadlecová
1b2400b529 Return only limited pagination headers for search API endpoints 2018-02-06 17:58:18 +01:00
Tony Rom
d90d141c24 Add Colors to GitLab Flavored Markdown 2018-01-29 17:39:19 +03:00
🙈 jacopo beschi 🙉
729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Markus Koller
257fd57134 Allow password authentication to be disabled entirely 2017-11-23 13:16:14 +00:00
Jacob Vosmaer (GitLab)
4cfcc97544 Fix encoding bugs in Gitlab::Git::User 2017-11-23 10:48:57 +00:00
Douwe Maan
20ac30a705 Merge branch '36099-api-responses-missing-x-content-type-options-header' into '10-1-stable'
Include X-Content-Type-Options (XCTO) header into API responses

See merge request 

(cherry picked from commit 6c818e77f2abeef2dd7b17a269611b018701fa79)

e087e075 Include X-Content-Type-Options (XCTO) header into API responses
2017-11-08 20:11:18 -08:00
Alessio Caiazza
c0299ce494
Add Projects::Clusters::ApplicationsController tests 2017-11-03 16:40:13 +01:00
Vitaliy @blackst0ne Klachkov
0ed3d8a07b Replace the 'project/shortcuts.feature' spinach test with an rspec analog 2017-09-22 14:29:19 +11:00
Vitaliy @blackst0ne Klachkov
2a966f1b4e Improve 'spec/features/profiles/*' specs 2017-09-16 21:09:58 +11:00
Robert Speicher
4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Rémy Coutable
c946ee1282
Enable the Layout/SpaceBeforeBlockBraces cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-09 11:52:22 +02:00
Sean McGivern
149528f472 Support references to group milestones
Group milestones can only be referred to by name, not IID. They also do not
support cross-project references.
2017-08-07 11:55:00 +01:00
Tim Zallmann
52b8a0db68 Resolve "Lazy load images on the Frontend" 2017-07-24 17:36:52 +00:00
Lin Jen-Shin
0fd4a6b637 Introduce have_gitlab_http_status
So that whenever this failed:

    expect(response).to have_gitlab_http_status(200)

We see what's the response there. Here's an example:

```
1) API::Settings Settings PUT /application/settings custom repository storage type set in the config updates application settings
   Failure/Error: expect(response).to have_gitlab_http_status(200)
     expected the response to have status code 200 but it was 400. The response was: {"error":"password_authentication_enabled, signin_enabled are mutually exclusive"}
```
2017-07-15 01:43:26 +08:00
Shinya Maeda
dbd0111390 Revert unnecesarry changes 2017-07-05 21:00:22 +09:00