Commit Graph

113 Commits

Author SHA1 Message Date
GitLab Bot a32e60a7ea Add latest changes from gitlab-org/gitlab@master 2021-05-20 12:10:26 +00:00
GitLab Bot c19bb4adbf Add latest changes from gitlab-org/gitlab@master 2021-05-14 09:10:24 +00:00
GitLab Bot 71a67d17b0 Add latest changes from gitlab-org/gitlab@master 2021-05-12 12:10:24 +00:00
GitLab Bot 454973238c Add latest changes from gitlab-org/gitlab@master 2021-05-06 21:10:07 +00:00
GitLab Bot e5e0589e09 Add latest changes from gitlab-org/gitlab@master 2021-04-26 12:09:44 +00:00
GitLab Bot 52591f253b Add latest changes from gitlab-org/gitlab@master 2021-04-03 03:09:13 +00:00
GitLab Bot c59765a50a Add latest changes from gitlab-org/gitlab@master 2020-06-24 18:09:03 +00:00
GitLab Bot d7b136d547 Add latest changes from gitlab-org/gitlab@master 2020-05-28 21:08:22 +00:00
GitLab Bot 7a73453665 Add latest changes from gitlab-org/gitlab@master 2020-04-22 15:09:27 +00:00
GitLab Bot c8e28a0bb8 Add latest changes from gitlab-org/gitlab@master 2020-01-27 09:08:32 +00:00
GitLab Bot 1caa60060b Add latest changes from gitlab-org/gitlab@master 2019-12-19 00:08:01 +00:00
GitLab Bot c2b98d3dbd Add latest changes from gitlab-org/gitlab@master 2019-12-17 15:08:15 +00:00
GitLab Bot b3e4ec8e8a Add latest changes from gitlab-org/gitlab@master 2019-10-23 09:06:03 +00:00
GitLab Bot 238d22c072 Add latest changes from gitlab-org/gitlab@master 2019-10-17 15:06:17 +00:00
Grzegorz Bizon 1068ec2e92 Merge branch '66741-remove-spec-rails_helper-rb' into 'master'
Remove spec/rails_helper.rb

Closes #66741

See merge request gitlab-org/gitlab-ce!32380
2019-09-03 13:48:17 +00:00
Brandon Williams 2bd4d580d1
Add system hooks for project/group membership updates
When updating group and project members, new system hooks
`user_update_for_group` and `user_update_for_team` will be executed.

Fixes https://gitlab.com/gitlab-org/gitlab-ee/issues/12252
2019-09-02 18:35:36 -05:00
Ash McKenzie 19ff9d9899
Replace rails_helper.rb with spec_helper.rb
rails_helper.rb's only logic was to require
spec_helper.rb.
2019-08-30 12:26:18 +10:00
Thong Kuah a2cfc150ce Add # frozen_string_literal to spec/models
Adds `# frozen_string_literal: true` to spec/models ruby files
2019-04-01 14:37:54 +13:00
Nick Thomas 466371a06c
Migrate sensitive web hook data in the background 2018-10-01 15:34:16 +01:00
Dmitriy Zaporozhets 464b0de1ac Merge branch 'filter-web-hooks-by-branch' into 'master'
Filter web hooks by branch

See merge request gitlab-org/gitlab-ce!19513
2018-09-05 13:39:41 +00:00
Duana Saskia 9d742e61a7 Refactor: move active hook filter to TriggerableHooks 2018-09-05 21:58:52 +10:00
Yorick Peterse 9606dbbb03
Whitelist existing destroy_all offenses
This whitelists all existing places where we use "destroy_all".
2018-08-16 17:29:37 +02:00
Duana Saskia ece6a1ea6e Filter project hooks by branch
Allow specificying a branch filter for a project hook and only trigger
a project hook if either the branch filter is blank or the branch matches.
Only supported for push_events for now.
2018-08-13 13:20:58 +02:00
Mark Chao a63bce1a4b Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
Yorick Peterse f30089075f
Fixed pagination of web hook logs
For reasons unknown, the logs of a web hook were paginated in memory.
This would result in the "Edit" page of a web hook timing out once it
has more than a few thousand log entries.

This commit makes the following changes:

1. We use LIMIT/OFFSET to paginate the data, instead of doing this in
   memory.

2. We limit the logs to the last two days, just like the documentation
   says (instead of retrieving everything).

3. We change the indexes on "web_hook_logs" so the query to get the data
   can perform a backwards index scan, without the need for a Filter.

These changes combined ensure that Projects::HooksController#edit no
longer times out.
2018-07-03 14:24:17 +02:00
Douwe Maan 8e9c073a14 Merge branch 'feature/merge-request-system-hook' into 'master'
System hooks for Merge Requests

See merge request gitlab-org/gitlab-ce!14387
2018-01-18 11:37:16 +00:00
Robert Speicher 791ca43f3f Merge branch '41293-fix-command-injection-vulnerability-on-system_hook_push-queue-through-web-hook' into 'security-10-3'
Don't allow line breaks on HTTP headers

See merge request gitlab/gitlabhq!2277

(cherry picked from commit 7fc0a6fc096768a5604d6dd24d7d952e53300c82)

073b8f9c Don't allow line breaks on HTTP headers
2018-01-16 17:04:51 -08:00
Alexis Reigel 9f7811e474 execute system hooks from project 2018-01-04 09:33:41 +01:00
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Rémy Coutable cddc5cacfb Use described_class when possible
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Alexander Randa e0ab5618a0 Wrong data type when testing webhooks 2017-07-20 15:12:06 +00:00
Alexander Randa 330789c23c Implement web hooks logging
* implemented logging of project and system web hooks
* implemented UI for user area (project hooks)
* implemented UI for admin area (system hooks)
* implemented retry of logged webhook
* NOT imeplemented log remover
2017-05-25 10:07:52 +03:00
Gabriel Mazetto 2e97db051c Make the new repository_update_events configurable in System Hooks UI 2017-05-12 23:26:48 +01:00
Gabriel Mazetto f661980904 Added repository_update hook 2017-05-12 23:26:48 +01:00
George Andrinopoulos 7c74a0209b Implement new service for creating user 2017-03-27 09:37:24 +00:00
Robert Speicher fcb37542e7 Use `:empty_project` where possible in model specs 2017-01-26 17:44:59 -05:00
Valery Sizov 8b2dbe8997 Remove schema annotations completely 2016-09-16 14:37:48 +03:00
Stan Hu 4955a47cb1 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.
2016-08-10 09:28:21 -07:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Gabriel Mazetto f5a0ac0fc1 Codestyle: make sure we have space around operators 2016-05-13 04:46:56 -03:00
Jacob Vosmaer a19508d6b7 Fix test failures 2016-05-09 13:58:43 +02:00
Gabriel Mazetto 0cd5edf35c Backported minimal safewebhook implementation to GitLab CE 2016-04-30 05:04:10 -03:00
Zeger-Jan van de Weg 4b1ad75ab5 minor cleanup in system_hook_spec 2016-03-30 20:00:57 +02:00
ashleys 4cd9a5208c web hooks to webhooks 2016-03-10 14:48:29 -05:00
evuez 4d0e2979b9 Allow webhooks URL to have leading and trailing spaces 2016-02-26 14:34:06 -05:00
Josh Frye 91b9cbff8d First pass at deleting projects in the background. 2016-01-29 09:14:16 -05:00
Stan Hu 8386edafd1 Accept 2xx status codes for successful Web hook triggers
Closes https://github.com/gitlabhq/gitlabhq/issues/9956
2016-01-07 06:28:24 -08:00
Douwe Maan 1e8d703a85 Tag model specs 2015-12-09 10:50:51 +01:00
Stan Hu a120b78940 Handle and report SSL errors in Web hook test. Check for status 200 for success.
If a Web hook test fails due to an SSL error or some other error, report
the result back to the user instead of an Error 500.

Closes #3656

Handle response
2015-12-04 07:13:28 -08:00
Guilherme Garnier 848d7b2a2b Fix rubocop warnings in spec/models 2015-10-03 01:48:54 -05:00
Robert Speicher fb6dc1f07d Add `Group#add_*` convenience methods
Encapsulates the logic for `Gitlab::Access::WHATEVER` levels.
2015-08-07 00:20:02 -04:00
Dmitriy Zaporozhets f40b99d02e
Merge branch 'master' into rubocop-for-tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	spec/features/issues_spec.rb
	spec/models/forked_project_link_spec.rb
	spec/models/hooks/service_hook_spec.rb
	spec/models/hooks/web_hook_spec.rb
	spec/models/project_services/hipchat_service_spec.rb
	spec/requests/api/project_members_spec.rb
	spec/requests/api/projects_spec.rb
	spec/requests/api/system_hooks_spec.rb
	spec/services/archive_repository_service_spec.rb
	spec/support/matchers.rb
	spec/tasks/gitlab/backup_rake_spec.rb
2015-06-23 10:44:03 +02:00
Robert Speicher 15a05be70d Fix Style/Blocks cop violations 2015-06-22 16:00:54 -04:00
Robert Speicher 94eff65569 Fix Style/SpaceInsideHashLiteralBraces cop violations
These fixes were performed automatically by Rubocop's `-a` flag.
2015-06-22 14:41:00 -04:00
Robert Speicher 0f627f1c60 Fix `raise_error` without an argument deprecation warnings 2015-06-22 12:13:47 +02:00
Stan Hu deeff56967 Add support for Webhook note events
Closes https://github.com/gitlabhq/gitlabhq/issues/6745
2015-05-21 23:48:16 -04:00
bugagazavr acac788902 Added X-GitLab-Event header for web hooks 2015-05-08 16:49:03 +03:00
Valery Sizov bc9ba5237c Revert "Added X-GitLab-Event header for web hooks"
This reverts commit 548f182814.
2015-04-27 16:29:31 +03:00
bugagazavr 548f182814 Added X-GitLab-Event header for web hooks 2015-04-25 21:31:52 +03:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Robert Speicher ab6f7164e0 Make the structure of spec/models match app/models 2015-01-30 15:51:10 -05:00