Commit Graph

591 Commits

Author SHA1 Message Date
Rémy Coutable f52a15e022
Revert "Merge branch 'wiki-fix' into 'master' "
This reverts commit 4cc85a58e8, reversing
changes made to 90ae445ba9.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-05-10 10:57:48 +02:00
Artem Sidorenko 14b36f91d9 Use the proper GitLab URL for links in Wiki 2016-05-09 11:50:23 +02:00
Robert Speicher 4fce876542 Merge branch 'fix/import-url-issues' into 'master'
Fix importer bug when throwing exceptions

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

See merge request !3941
2016-05-05 22:27:40 +00:00
Douglas Barbosa Alexandre 6fbf6b2936 Fix the line code when importing PR review comments from GitHub
Pull Request Review Comments are comments on a portion of the unified
diff.
2016-05-05 10:45:14 -03:00
Rémy Coutable 5addff7e6c Merge branch 'use-remote-ip-for-akismet' into 'master'
Use ActionDispatch Remote IP for Akismet checking

Previously all remote IPs appeared at 127.0.0.1, which made Akismet
not very useful. Using the ActionDispatch Remote IP (http://api.rubyonrails.org/classes/ActionDispatch/RemoteIp.html)
should provide more reliable results.

Closes #16629

See merge request !3961
2016-04-28 13:09:44 +00:00
James Lopez 9a9681772c fix failing spec 2016-04-28 11:40:23 +02:00
James Lopez 8793025dd0 added spec testing exception raised 2016-04-28 10:26:44 +02:00
Stan Hu e99cf05875 Use ActionDispatch Remote IP for Akismet checking
Previously all remote IPs appeared at 127.0.0.1, which made Akismet
not very useful. Using the ActionDispatch Remote IP (http://api.rubyonrails.org/classes/ActionDispatch/RemoteIp.html)
should provide more reliable results.

Closes #16629
2016-04-27 22:12:55 -07:00
Stan Hu eede032345 Backport GitHub Enterprise import support from EE
These changes were pulled from GitLab EE to support configuring
an alternative API URL than the default https://api.github.com.
In addition, the `verify_ssl` flag allows users to disable SSL cert
checking.

One modification: add a default `args` option if it does not exist
to avoid breaking existing configurations.
2016-04-26 21:00:55 -07:00
Kamil Trzciński d240666800 Merge branch 'ci-commit-as-pipeline' into 'master'
Ci::Commit becomes a Pipeline object

1. Ci::Commit receives context: ref, :tag.
1. One Ci::Commit describes a one Pipeline
1. Pipeline is created from `.gitlab-ci.yml`
1. Pipeline is a ordered group of builds
1. We test MR against Pipeline
1. Pipelines have a separate view (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3703)
1. Pipeline can be triggered from UI (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3703)
1. Later we change `Trigger -> TriggerRequest -> Build` to `Trigger -> Pipeline` (future)
1. We add a Pipeline Hook that will be triggered on Pipeline status change  (future)
1. We extend notifications to use `Pipeline Hook` to send summary on pipeline changes (future)

After merging that I'll prepare a separate MR that will unify naming, database columns, table names:
```
Ci::Commit -> Pipeline
Ci::Build -> Build
CommitStatus -> Job
GenericCommitStatus -> ExternalJob

ci_commits -> pipelines
ci_builds -> jobs
```

This MR implements first 5 points.

This is made to solve this issue https://gitlab.com/gitlab-org/gitlab-ce/issues/14149.

See merge request !3653
2016-04-21 08:10:37 +00:00
Yorick Peterse a257d117a0
Fix setting of "action" for Grape transactions
Merely setting the "action" tag will only result in the transaction
itself containing a value for this tag. To ensure other metrics also
contain this tag we must set the action using Transaction#action=
instead.
2016-04-20 22:42:52 +02:00
Sebastian Klier edd07e2363 Fix wiki tests 2016-04-20 08:25:41 +08:00
Kamil Trzcinski 27e0c7723c Merge remote-tracking branch 'origin/master' into ci-commit-as-pipeline
# Conflicts:
#	db/schema.rb
2016-04-19 14:00:14 -04:00
Gabriel Mazetto 5330af3fa6 Using single builder for push and tag events 2016-04-19 11:00:30 +02:00
Gabriel Mazetto ee1090e2b2 Added System Hooks for push and tag_push
Code is based on Project Webhooks, removing deprecations and without
commits listing.
2016-04-19 11:00:30 +02:00
Douglas Barbosa Alexandre 0ed0758735 Use double instead of OpenStruct in the Issue/PR formatters specs 2016-04-18 20:07:05 -03:00
Douglas Barbosa Alexandre f2fe4af19d Set GitHub milestones to Issue/Merge Request that were imported 2016-04-18 20:07:05 -03:00
Douglas Barbosa Alexandre 06ec511164 Import milestones from GitHub 2016-04-18 20:07:04 -03:00
Douglas Barbosa Alexandre 05a4f444c3 Import labels from GitHub 2016-04-18 17:14:59 -03:00
Douglas Barbosa Alexandre d13bba44f0 Use GitHub Issue/PR number as iid to keep references
With these changes we don’t lost the issue/pr references when importing
them to GitLab.
2016-04-18 12:15:50 -03:00
Yorick Peterse 7e6f0ac0e0
Count the number of SQL queries per transaction
Fixes gitlab-org/gitlab-ce#15335
2016-04-18 14:53:13 +02:00
Yorick Peterse 7b6785b3b1
Use Module#prepend for method instrumentation
By using Module#prepend we can define a Module containing all proxy
methods. This removes the need for setting up crazy method alias chains
and in turn prevents us from having to deal with all that madness (e.g.
methods calling each other recursively).

Fixes gitlab-org/gitlab-ce#15281
2016-04-18 11:16:31 +02:00
Kamil Trzcinski 065e0c0fe4 Merge remote-tracking branch 'origin/master' into ci-commit-as-pipeline
# Conflicts:
#	db/schema.rb
2016-04-16 19:55:14 +02:00
James Lopez e5f7a54530 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url 2016-04-14 18:12:10 +02:00
Rémy Coutable c71cdb194f Merge branch 'simplify-gitlab-url_builder-15202' into 'master'
Refactor and expose only Gitlab::UrlBuilder.build(record)

```
$ git grep Gitlab::UrlBuilder

app/models/commit.rb:      url: Gitlab::UrlBuilder.build(self),
app/services/issues/base_service.rb:      issue_url = Gitlab::UrlBuilder.build(issue)
app/services/merge_requests/base_service.rb:      hook_data[:object_attributes][:url] = Gitlab::UrlBuilder.build(merge_request)
app/views/search/results/_note.html.haml:- note_url = Gitlab::UrlBuilder.build(note)
lib/gitlab/note_data_builder.rb:        base_data[:object_attributes][:url] = Gitlab::UrlBuilder.build(note)
spec/lib/gitlab/note_data_builder_spec.rb:    expect(data[:object_attributes][:url]).to eq(Gitlab::UrlBuilder.build(note))
spec/lib/gitlab/url_builder_spec.rb:describe Gitlab::UrlBuilder, lib: true do
```

Fixes #15202.

See merge request !3696
2016-04-14 10:27:49 +00:00
Rémy Coutable 02cfbf0db5
Refactor and expose only Gitlab::UrlBuilder.build(record)
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-13 16:07:04 +02:00
Kamil Trzcinski 4af0968c43 Merge remote-tracking branch 'origin/master' into ci-commit-as-pipeline 2016-04-13 15:47:18 +02:00
Marin Jankovski c746046992 Merge branch 'external-omniauth-providers' into 'master'
Allow Omniauth providers to be marked as external

Related to #4009 

With this MR we will be able to allow the user to set which Omniauth Providers they would like to have as external. All users login in via these providers will be marked as external, even if they already had an account before. If the provider is removed form the list of external providers, the users will be marked as internal at their next login.

MR for Omnibus: gitlab-org/omnibus-gitlab!727

/cc @dblessing @DouweM 

See merge request !3657
2016-04-13 13:09:47 +00:00
Yorick Peterse 3240ecfbef
Added ability to add custom tags to transactions
One use case for this is manually setting the "action" tag for Grape API
calls. Due to Grape running blocks there are no human readable method
names that can be used for the "action" tag, thus we have to set these
manually on a case by case basis.
2016-04-13 11:22:37 +02:00
Kamil Trzcinski 52be9e20f9 Merge remote-tracking branch 'origin/master' into ci-commit-as-pipeline
# Conflicts:
#	app/views/projects/commits/_commit.html.haml
2016-04-11 23:33:50 +02:00
Kamil Trzcinski af7214d0f0 Fix specs 2016-04-11 23:32:55 +02:00
Patricio Cano ea04b0191d Added default setting for `external_providers` 2016-04-11 10:16:42 -05:00
Yorick Peterse 7eed4608fe
Fixed stubbing for Gitlab::Metrics specs
If the measure method uses Transaction.current directly the SQL
subscriber (Subscribers::ActiveRecord) will add timings of queries
triggered by DB cleaner.
2016-04-11 14:29:38 +02:00
Yorick Peterse d9110a7eca
Track call counts in Gitlab::Metrics.measure_block 2016-04-11 13:27:52 +02:00
Yorick Peterse 185d78bcb3
Added specs for Gitlab::Metrics::System.cpu_time 2016-04-11 13:11:13 +02:00
Yorick Peterse 16926a676b
Store block timings as transaction values
This makes it easier to query, simplifies the code, and makes it
possible to figure out what transaction the data belongs to (simply
because it's now stored _in_ the transaction).

This new setup keeps track of both the real/wall time _and_ CPU time
spent in a block, both measured using milliseconds (to keep all units
the same).
2016-04-11 13:09:36 +02:00
Yorick Peterse c56f702ec3
Instrument Rails cache code
This allows us to track how much time of a transaction is spent in
dealing with cached data.
2016-04-08 17:54:52 +02:00
Jacob Schatz 0bbeebc8f9 Remove dumb debug statement and add many tests. 2016-04-07 08:47:29 -04:00
James Lopez e8b7e37c6d Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-import_url 2016-04-07 14:15:48 +02:00
Rémy Coutable 8eae7b1088 Merge branch 'feature/expose-builds-badge' into 'master'
Expose badges

This MR exposes badge somewhere in visible place.

![expose_badges](/uploads/d2e290d3013d1ef2b1bdeebbbe2c5d8b/expose_badges.png)

Closes #13801

See merge request !3326
2016-04-07 08:40:15 +00:00
Robert Speicher 936be025cd Merge branch 'saml-external-groups' into 'master'
Allow SAML to identify external users and set them as such

Related to #4009

Fixes #14577

This allows SAML to retrieve group information form the `SAML Response`
and match that to a setting that will flag all matching users as external.

See merge request !3530
2016-04-07 00:35:08 +00:00
Patricio Cano 8110e75309 Implemented suggested fixes 2016-04-06 18:12:25 -05:00
Robert Speicher 5bdc18c5b3 Merge branch 'patch/fix-ldap-unblock-user-logic' into 'master'
Unblocks user when active_directory is disabled and it can be found

We implemented a specific block state to handle user blocking that originates from LDAP filtering rules / directory state in !2242. 

That introduced a regression in LDAP authentication when Active Directory support was disabled. You could have a scenario where the user would not be temporarily found (like a filtering rule), that would mark the user as `ldap_blocked`, but will never unblock it automatically when that state changed.

Fixes #14253, #13179, #13259, #13959

See merge request !3550
2016-04-06 21:50:40 +00:00
Patricio Cano 3a36fa8957 Fix error that was causing only one group to be returned and corrected specs to use the proper attribute type 2016-04-06 16:03:35 -05:00
Grzegorz Bizon b7fa7c4d59 Extend build status badge, add html/markdown methods 2016-04-06 19:56:34 +02:00
Yorick Peterse 1af6cf28c0 Measure Ruby blocks using Gitlab::Metrics
This allows measuring of timings of arbitrary Ruby blocks, this allows
for more fine grained performance monitoring. Custom values and tags can
also be attached to a block.
2016-04-06 14:31:52 +02:00
Yorick Peterse a3cf3d1982 Corrected some spec headers for Gitlab::Metrics 2016-04-06 14:31:52 +02:00
Patricio Cano 7efaf22bcc Removed extra LDAP tests and added tests for the external groups feature 2016-04-05 19:22:58 -05:00
Gabriel Mazetto 5ee6badade Unblocks user when active_directory is disabled and it can be found 2016-04-05 16:34:31 -03:00
Patricio Cano d14f080c0a Remove unnecessary LDAP tests from SAML tests 2016-04-04 19:09:46 -05:00