263 Commits
Author SHA1 Message Date
Grzegorz Bizon 4c388fb865 Remove legacy conditional from irker service code 2016-07-08 11:06:54 +02:00
Grzegorz Bizon c6f9a1c273 Enable Style/IdenticalConditionalBranches Rubocop cop 2016-07-08 11:04:04 +02:00
Douwe Maan 6ce25e7b4c Rename MergeRequest methods that return commits or shas to be more clear and consistent 2016-07-06 18:50:58 -04:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Robert Speicher 84113d7e72 Merge branch 'rubocop/enable-space-after-cops' into 'master'
Enable Style/SpaceAfterComma and Colon Rubocop cops

See #17478

See merge request !4991
2016-06-29 19:50:08 +00:00
Grzegorz Bizon 28bafd5354 Enable Style/SpaceAfterComma Rubocop cop 2016-06-29 15:23:44 +02:00
Tim 65a9d89736 Removed redudant methods implemented by parent class 2016-06-29 06:01:54 -04:00
Tim 3d108760ea Set field defaults to be the same as IssueTrackerService
Rebased to resolve merge conflicts
2016-06-29 06:01:54 -04:00
Tim bc313deaae Added Bugzilla as external issue tracker option
Requested in #14669

Added note to changelog
2016-06-29 06:01:54 -04:00
Rémy Coutable 2f7b2057f2 Fix broken URI joining for teamcity_url with suffixes
If one had configured a `teamcity_url` like http://foo.bar/teamcity in
the previous implementation the plugin directed it's request i.e. to
http://foo.bar/httpAuth/... instead of http://foo.bar/teamcity/httpAuth/...

`URI.join` only works correctly, if the prefix URL has
  - at least one or more  trailing '/'
  - the appended parts are _not_ prefixed with '/'

The current implementation should work with all sorts of TeamCity base
URLs.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 10:07:37 +02:00
Rémy Coutable 17c32ee8d0 Factorize duplicated code into a method in BambooService and update specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 10:07:37 +02:00
Benjamin SchmidandRémy Coutable 46f3cd7c65 Fix broken URI joining for bamboo_url with suffixes
If one had configured a `bamboo_url` like http://foo.bar/bamboo in the
previous implementation the plugin directed it's request i.e. to
http://foo.bar/rest/... instead of http://foo.bar/bamboo/rest/...

`URI.join` only works correctly, if the prefix URL has
  - at least one or more  trailing '/'
  - the appended parts are _not_ prefixed with '/'

The current implementation should work with all sorts of Bamboo base URLs.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 10:07:34 +02:00
Benjamin SchmidandRémy Coutable 84b07f7054 Honor credentials on calling Bamboo CI trigger
This improves the Bamboo Service and provides a fix for situations,
where the build trigger won't work, because Bamboo is requiring
authentication also for the trigger GET.

The change now does provide additional HTTP Basic Auth parameters
if user credentials were provided and appends an request parameter
indicating the HTTP Basic Authentication should be used.
This aligns interaction with Bamboo with the other calls this service
executes.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 10:00:37 +02:00
Douglas Barbosa Alexandre 0568b90c97 Remove deprecated issues_tracker and issues_tracker_id from project 2016-06-13 18:13:55 -03:00
Grzegorz Bizon 080997d87e Enable Lint/AmbiguousOperator rubocop cop
See #17478
2016-06-03 10:59:43 +02:00
Grzegorz Bizon 86cf9dd253 Enable Lint/LiteralInCondition rubocop cop
Checks of literals used in conditions.

See #17478
2016-05-30 12:34:25 +02:00
Aran Koning fcd723eda6 Seconds plural slack 2016-05-24 10:54:16 +02:00
Jeroen van Baarsen 80817644a7 Improve issue formatting in Slack service
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2016-05-18 11:09:51 -05:00
Gabriel Mazetto f5a0ac0fc1 Codestyle: make sure we have space around operators 2016-05-13 04:46:56 -03:00
Jeroen van Baarsen f1479b56b7 Remove the annotate gem and delete old annotations
In 8278b763d9 the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.

Fixes: #17382
2016-05-09 18:00:28 +02:00
Zeger-Jan van de Weg 47da013cf8 Annotate the models 2016-05-06 08:27:46 +02:00
Rémy CoutableandRobert Speicher ef340f6e77 Ensure URL in all Service subclasses are valid
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-25 15:28:24 -04:00
Sebastian Klier d472810e49 formatting and test structure 2016-04-20 08:25:41 +08:00
Sebastian Klier 54661d3d44 add slack notifications for wiki pages
update changelog
2016-04-20 08:25:40 +08:00
Ben Bodenmiller b68e3925ff format merge request references properly 2016-04-18 23:32:02 -07:00
Frank Groeneveld 2fd05aed46 Allow empty recipient list when pusher is added
Closes #13574
2016-04-14 10:24:09 +02:00
Robert Speicher 0b447a9977 Merge branch 'fix-trailing-slash-in-bamboo_url' into 'master'
Fix a bug with trailing slash in bamboo_url

Also, improve specs for BambooService

Similar to !3679.

See merge request !3680
2016-04-13 16:18:46 +00:00
Rémy Coutable acf911eeae Fix a bug with trailing slash in bamboo_url
Also, improve specs for BambooService

Similar to https://gitlab.com/gitlab-org/gitlab-ce/issues/3515

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-13 15:58:14 +02:00
Rémy Coutable 3ea955a637 Improve TeamcityService and its specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-13 10:01:49 +02:00
Charles MayandRémy Coutable 061370790e Fix a bug with trailing slash in teamcity_url
See https://gitlab.com/gitlab-org/gitlab-ce/issues/3515
2016-04-12 18:08:05 +02:00
Rémy Coutable e79b867d2b Ensure empty recipients are rejected in BuildsEmailService
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-06 16:14:51 +02:00
Yorick Peterse 84b0ab7766 Added & use Gitlab::Routing for URL helpers
Rails' "url_helpers" method creates an anonymous Module (which a bunch
of methods) on every call. By caching the output of this method in a
dedicated method we can shave off about 10 seconds of loading time for
an issue with around 200 comments.
2016-04-01 11:13:48 +02:00
Stan Hu 2fa20f2d4f Handle nil descriptions in Slack issue messages
Closes #14676
2016-03-28 04:15:41 -07:00
James Lopez fc610c182e add SHA256 to secure_compare 2016-03-08 15:57:45 +01:00
James Lopez ecb1c59665 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/token-timing-attack 2016-03-08 15:55:04 +01:00
Rubén Dávila eb068b0fff Add commit message to JIRA's notification payload. 2016-03-03 09:55:53 -05:00
James Lopez 70623cd423 fix token issue - timing attack 2016-03-02 12:18:43 +01:00
Dmitriy Zaporozhets e7364050b0 Revert "Merge branch 'issue_5854' into 'master' "
This reverts merge request !2992
2016-02-29 17:30:41 +00:00
Rubén Dávila 496b9c0761 Add commit message to JIRA's notification payload. 2016-02-26 20:11:34 -05:00
Rémy Coutable 1de9513790 Use project.web_url instead deprecated repository.homepage in PushoverService 2016-02-16 13:03:00 +01:00
Yorick Peterse b4ee6f57b9 Greatly improve external_issue_tracker performance
This greatly improves the performance of Project#external_issue_tracker
by moving most of the fields queried in Ruby to the database and letting
the database handle all logic. Prior to this change the process of
finding an external issue tracker was along the lines of the following:

1. Load all project services into memory.
2. Reduce the list to only services where "issue_tracker?" returns true
3. Reduce the list from step 2 to service where "default?" returns false
4. Find the first service where "activated?" returns true

This has to two big problems:

1. Loading all services into memory only to reduce the list down to a
   single item later on is a waste of memory (and slow timing wise).
2. Calling Array#select followed by Array#reject followed by Array#find
   allocates extra objects when this really isn't needed.

To work around this the following service fields have been moved to the
database (instead of being hardcoded):

* category
* default

This in turn means we can get the external issue tracker using the
following query:

    SELECT *
    FROM services
    WHERE active IS TRUE
    AND default IS FALSE
    AND category = 'issue_tracker'
    AND project_id = XXX
    LIMIT 1

This coupled with memoizing the result (just as before this commit)
greatly reduces the time it takes for Project#external_issue_tracker to
complete. The exact reduction depends on one's environment, but locally
the execution time is reduced from roughly 230 ms to only 2 ms (= a
reduction of almost 180x).

Fixes gitlab-org/gitlab-ce#10771
2016-01-19 14:03:20 +01:00
Douwe Maan c7d9e7806a Merge branch 'fix/reference_filter_uri_decode_error_for_master' into 'master'
Fix #9963 reference_filter "Encoding::CompatibilityError" bug with some complex URL;

https://github.com/gitlabhq/gitlabhq/pull/9964

@DouweM

See merge request !2383
2016-01-13 14:21:32 +00:00
Landon 4819de1e70 Mention channel/key bug in irkerd docs
Per this issue: https://gitlab.com/esr/irker/issues/2

A documentation update was added to irkerd (https://gitlab.com/esr/irker/commit/190808c37d4ab5f0f16fe35352ff36863c2732d5) but the bug is still there. Making a note of it here could save someone a lot of hassle. 

This could probably be worded better if someone else wants to take a stab at it.
2016-01-12 15:54:09 -07:00
Jason Lee 932a247f5f Use CGI.escape instead of URI.escape, because URI is obsoleted.
ref: https://github.com/ruby/ruby/commit/238b979f1789f95262a267d8df6239806f2859cc
2016-01-12 18:20:03 +08:00
Robert Speicher 4de89291a3 Merge branch 'fix_jira_shortterm' into 'master'
Do not call API if there is no API URL

Fixes #5878 

CE users may not be interested in the new JIRA features. In this case,
we should detect they haven't set an API URL and fallback to the
behavior pre-8.3. This patch does that very easily.

There are planned improvements to JIRA in future releases such as
gitlab-org/gitlab-ce#5541 which will make this more configurable.

See merge request !2341
2016-01-10 22:12:10 +00:00
Stan Hu 7403df6ca7 Merge branch 'suppress-allow-failure-builds' into 'master'
Suppress e-mails on failed builds if allow_failure is set

Every time I push to GitLab, I get > 2 emails saying a spec failed when I don't care about the benchmarks and others that have `allow_failure` set to `true`.

@ayufan mentioned creating a summary e-mail to prevent getting one e-mail per build, but the latter might actually be desirable. For example, I do want to know if Rubocop errors fail right away.

See merge request !2178
2016-01-08 17:31:35 +00:00
Achilleas Pipinellis d09f1a4443 Remove useless assignment to variable 2016-01-08 15:22:42 +01:00
Achilleas Pipinellis fc7b14a534 Remove reference to EE from JIRA service model 2016-01-08 13:21:40 +01:00
Drew Blessing f7fdcb95da Do not call API if there is no API URL 2016-01-07 16:23:42 -06:00
Stan Hu 69209612e1 Suppress e-mails on failed builds if allow_failure is set
Every time I push to GitLab, I get > 2 emails saying a spec failed when
I don't care about benchmarks and other specs that have `allow_failure` set to `true`.
2016-01-07 10:45:39 -08:00