Commit Graph
224 Commits
Author SHA1 Message Date
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
Stan Hu 79c0e7212a Annotate models 2016-01-06 13:09:55 +00:00
Mike Wyatt bb6b793c55 Don't log backtrace in Asana service 2016-01-04 11:19:39 -04:00
Mike Wyatt cf4ccdda27 Merge remote-tracking branch 'upstream/master' into better-asana-refs
* upstream/master: (307 commits)
  Update CHANGELOG
  spinach fix
  Updated allocations Gem to version 1.0.3
  Removed various default metrics tags
  Update CHANGELOG
  Fix "I see current user as the first user" step
  Swap Author and Assignee Selectors on issuable index view
  Update CHANGELOG
  Make sure that is no pending migrations in Gitlab::CurrentSettings
  Added additional config environmental variables to help Debian packaging
  We don't use whenever anymore. Lets remove the schedule file
  Fix project transfer e-mail sending incorrect paths in e-mail notification
  Update CHANGELOG
  Use Gitlab::CurrentSettings for InfluxDB
  Write to InfluxDB directly via UDP
  Strip newlines from obfuscated SQL
  Add hotfix that allows to access build artifacts created before 8.3
  note votes methids implementation
  When reCAPTCHA is disabled, allow registrations to go through without a code
  Downcased user or email search for avatar_icon.
  ...
2015-12-31 18:45:55 -04:00
Mike Wyatt 9e7a88f089 Better handling of errors in Asana service
[ci skip]
2015-12-30 00:52:56 -04:00
Mike Wyatt 7b98d0e1a2 Update Asana service documentation 2015-12-30 00:51:05 -04:00
Mike Wyatt 6eb273a11c Restore colon in Asana comment 2015-12-30 00:50:44 -04:00
Mike Wyatt e8080fc8fb Fix error in Asana service 2015-12-29 16:00:36 -04:00
Mike Wyatt 12ec1e3c40 Update Asana service to work with Personal Access Token, lessen number of requests to Asana API 2015-12-29 15:39:58 -04:00
Mike Wyatt 2cd2c54bd1 Update Asana field descriptions 2015-12-29 15:37:48 -04:00
Kamil Trzcinski a495b9bc18 Deprecate GitLabCiService making it to always be inactive 2015-12-22 00:28:38 +01:00
Drew Blessing f177aaa5fa Backport JIRA service 2015-12-18 14:19:48 -06:00
Mike Wyatt b45ee2c314 better support for referencing and closing issues in asana_service.rb 2015-12-16 10:08:05 -04:00
Gabriel Mazetto 9072098215 Fixed CiServices validation 2015-12-15 17:37:23 -02:00
Gabriel Mazetto b5291f9599 Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
Kamil Trzcinski e80e3f5372 Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00
Kamil Trzcinski 8b4cdc50fc Fix indentation and BuildsEmailService 2015-12-11 18:01:57 +01:00
Kamil Trzcinski 71e6a93db9 Change default values 2015-12-11 13:28:40 +01:00
Kamil Trzcinski dc4e2744ba Fix issue tracker service 2015-12-10 17:21:06 +01:00
Kamil Trzcinski 80f8074d01 Migrate SlackService and HipChat service 2015-12-10 16:04:08 +01:00
Kamil Trzcinski d5c91bb9a6 Migrate CI WebHooks and Emails to new tables 2015-12-10 16:04:08 +01:00
Kamil Trzcinski 2988e1fbf5 Migrate CI::Services and CI::WebHooks to Services and WebHooks 2015-12-10 16:04:08 +01:00
Robert Speicher d5ea93469b Add custom UrlValidator 2015-12-07 16:57:26 -05:00
Valery Sizov 162cd0099c fix deprecation messages in tests 2015-12-03 10:33:43 +02:00
Valery Sizov f1504e1ad5 test fix 2015-11-30 18:03:07 +02:00
Valery Sizov e92ceb7b57 fix specs 2015-11-30 16:12:31 +02:00
Valery SizovandValery Sizov 7f214cee74 Migrate mailers to ActiveJob 2015-11-26 17:03:43 +02:00
Kamil Trzcinski 57e974c03b Fix 500 when using CI
- Fix for Ci::Build state machine, allowing to process builds without the project
- Forcefully update builds that didn't want to update with state machine
- Fix saving GitLabCiService as Admin Template
2015-11-23 13:51:41 +01:00
Stan Hu ad1f451f24 Fix Drone web hook URL not being updated 2015-11-20 08:13:25 -08:00
Dmitriy Zaporozhets 3cebe9e780 Refactor duplciate code for groups_controller.rb and slack_service/note_message.rb
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-17 11:03:18 +01:00
Dmitriy Zaporozhets a237999f00 Annotate models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-13 19:22:46 +01:00
Stan Hu 5aa142212f Fix Drone CI service template not saving properly
Closes #3419
2015-11-10 10:52:45 -08:00
Kamil Trzcinski ba68facf8d CI details cleanup
- Add page titles to CI settings.
- Fix CI admin navigation.
- Remove duplicated scope.
- Use monospace font for commit sha.
- Add page title and header title to build page.
- Proper authorization for cancel/retry builds.
- Use gitlab pagination theme for builds and group members.
- Don't paginate builds widget on build page.
- Add badges to commit page Changes/Builds tabs.
- Add "Builds" to commit Builds tab page title.
- Add and use Ci::Build#retryable? method.
- Add CI::Build#retried? method.
- Allow all failed commit builds to be retried.
- Proper authorization for cancel/retry all builds.
- Remove unused param.
- Use time_ago_with_tooltip where appropriate.
- Tweak builds index text
- Remove duplication between builds/build and commit_statuses/commit_status.
- Use POST rather than GET for canceling and retrying builds.
- Remove redundant URL helpers.
- Add build ID to build page.
- Link branch name on build page.
- Move commit/:sha/ci to commit/:sha/builds.
2015-11-05 15:24:27 +01:00
Alex Lossent 98e666ab6a Improve invalidation of stored service password if the endpoint URL is changed
Password can now be specified at the same time as the new URL, and the service
template admin pages now work.
2015-10-15 12:07:59 +02:00
Valery Sizov b83a18a55c Revert "Improve invalidation of stored service password if the endpoint URL is changed"
This reverts commit b463975480.
2015-10-14 19:21:27 +03:00
Alex Lossent b463975480 Improve invalidation of stored service password if the endpoint URL is changed
It now allows to specify a password at the same time as the new URL, and works
on the service template admin pages.
2015-10-14 15:27:59 +02:00
Kamil Trzciński e3edd53ae4 Merge branch 'commit_status' into 'master'
Implement Commit Status API

This is preliminary implementation of Commit Status API, pretty much compatible with GitHub.

1. The Commit Statuses are stored in separate table: ci_commit_status.
2. The POST inserts a new row.
3. To POST execute GitLab API `post :id/repository/commits/:sha/status`. This accepts dual authorization:
- Using authorized user
- Using ci-token to allow easy posting from CI Services
4. This adds predefined variable to GitLab CI build environment: CI_BUILD_STATUS_URL, allowing to easy post status from within build (ex. with code coverage or other metrics).
5. This adds statuses to commit's builds view.
6. The commit's status is calculated taking into account status of all builds and all posted statuses.
7. The commit statuses doesn't trigger notifications.
8. The commit status API introduces two new privileges: `read_commit_statuses` and `create_commit_status`.
9. We still miss a few tests and documentation updates for API and CI.

@dzaporozhets @sytses What do you think?




See merge request !1530
2015-10-13 14:33:00 +00:00
Kamil Trzcinski 5cd504ed33 Rename builds_without_retry to latest_builds 2015-10-12 16:39:08 +02:00
Valery Sizov 07f6055272 Invalidate stored service password if the endpoint URL is changed 2015-10-12 13:21:57 +03:00
Dmitriy Zaporozhets 8dcc8e5db6 Fix routing in CI mailer
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-07 10:26:40 +02:00