Commit Graph

3930 Commits

Author SHA1 Message Date
Douwe Maan 4d64a32c88 Merge branch 'feature/ldap-sync-edgecases' into 'master'
LDAP Sync blocked user edgecases

Allow GitLab admins to block otherwise valid GitLab LDAP users
(https://gitlab.com/gitlab-org/gitlab-ce/issues/3462)

Based on the discussion on the original issue, we are going to differentiate "normal" block operations to the ldap automatic ones in order to make some decisions when its one or the other.

Expected behavior:

- [x] "ldap_blocked" users respond to both `blocked?` and `ldap_blocked?`
- [x] "ldap_blocked" users can't be unblocked by the Admin UI
- [x] "ldap_blocked" users can't be unblocked by the API
- [x] Block operations that are originated from LDAP synchronization will flag user as "ldap_blocked"
- [x] Only "ldap_blocked" users will be automatically unblocked by LDAP synchronization
- [x] When LDAP identity is removed, we should convert `ldap_blocked` into `blocked`
 
Mockup for the Admin UI with both "ldap_blocked" and normal "blocked" users:
![image](/uploads/4f56fc17b73cb2c9e2a154a22e7ad291/image.png)

There will be another MR for the EE version.

See merge request !2242
2016-01-14 11:00:08 +00:00
Douwe Maan 9f8c38bdac Merge branch 'fix/private-references' into 'master'
Show referenced MRs & Issues only when the current viewer can access them

This addresses both issues identified in #6066.

## The private MR by user `remy2` with a note referencing to a public issue

![Screen_Shot_2016-01-12_at_16.45.02](/uploads/c245ec2c1fdea1f9ba05183c24e142d9/Screen_Shot_2016-01-12_at_16.45.02.png)

---

## The public issue viewed by user `remy` **who doesn't have access to `remy2/private-project`** before the fix

![Screen_Shot_2016-01-12_at_18.14.50](/uploads/8db5580e803f5bddd6cb935233c579a0/Screen_Shot_2016-01-12_at_18.14.50.png)

---

## The public issue viewed by user `remy` **who doesn't have access to `remy2/private-project`** with the fix

![Screen_Shot_2016-01-13_at_12.02.32](/uploads/cb199f7b78191fba486a11412412e307/Screen_Shot_2016-01-13_at_12.02.32.png)

---

## The public issue viewed by user `remy2` with the fix (no change)

![Screen_Shot_2016-01-13_at_11.54.06](/uploads/ddece590d69f597a95559beddcd36660/Screen_Shot_2016-01-13_at_11.54.06.png)


See merge request !2405
2016-01-14 10:36:39 +00:00
Tomasz Maczukin 57a67c4fdb Merge branch '8-4-stable' into ci/api-triggers
* 8-4-stable: (280 commits)
  Add Changelog entry for build traces data integrity fix
  Update doc_styleguide.md [ci skip]
  Added hint that you can search users by name, username, or email.
  Add changelog
  Version 8.4.0.rc1
  Randomize metrics sample intervals
  Make the metrics sampler interval configurable
  Don't automatically require awesome_print
  Disable colorization if STDOUT is not a tty
  Block the reported user before destroying the record
  changes `$quote-gray` to `$secondary-text`
  makes message plural for multiple MRs and removes from loop. Duh.
  Prepare Installation and Update docs for 8.4 RC1
  Mention channel/key bug in irkerd docs
  Revert "Remove the `:coffee` and `:coffeescript` Haml filters"
  gets merge request discussion working again
  adds back in discussion.haml.html for issues commenting and closing/reopening properly.
  removing last chunk of MR ajax changes, rest will be in another MR
  reverting more MR ajax files, will appear in different commit
  reverting MR ajax changes, which will be in a different MR
  ...
2016-01-14 10:58:40 +01:00
Rémy Coutable e918493f55 Fix specs and rubocop warnings 2016-01-14 10:04:48 +01:00
Gabriel Mazetto dd6fc01ff8 fixed LDAP activation on login to use new ldap_blocked state 2016-01-14 03:31:27 -02:00
Tomasz Maczukin 220c3a44c9 Merge branch '8-4-stable' into ci/api-variables
* 8-4-stable: (285 commits)
  Add Changelog entry for build traces data integrity fix
  Update doc_styleguide.md [ci skip]
  Added hint that you can search users by name, username, or email.
  Add changelog
  Version 8.4.0.rc1
  Randomize metrics sample intervals
  Make the metrics sampler interval configurable
  Don't automatically require awesome_print
  Disable colorization if STDOUT is not a tty
  Block the reported user before destroying the record
  changes `$quote-gray` to `$secondary-text`
  makes message plural for multiple MRs and removes from loop. Duh.
  Prepare Installation and Update docs for 8.4 RC1
  Mention channel/key bug in irkerd docs
  Revert "Remove the `:coffee` and `:coffeescript` Haml filters"
  gets merge request discussion working again
  adds back in discussion.haml.html for issues commenting and closing/reopening properly.
  removing last chunk of MR ajax changes, rest will be in another MR
  reverting more MR ajax files, will appear in different commit
  reverting MR ajax changes, which will be in a different MR
  ...
2016-01-13 23:59:00 +01:00
Tomasz Maczukin c9a1661979 Merge branch 'master' into ci/api-builds
* master: (76 commits)
  Add Changelog entry for build traces data integrity fix
  Update doc_styleguide.md [ci skip]
  Added hint that you can search users by name, username, or email.
  Add changelog
  Randomize metrics sample intervals
  Make the metrics sampler interval configurable
  Don't automatically require awesome_print
  Disable colorization if STDOUT is not a tty
  Block the reported user before destroying the record
  changes `$quote-gray` to `$secondary-text`
  makes message plural for multiple MRs and removes from loop. Duh.
  Prepare Installation and Update docs for 8.4 RC1
  Mention channel/key bug in irkerd docs
  Revert "Remove the `:coffee` and `:coffeescript` Haml filters"
  gets merge request discussion working again
  adds back in discussion.haml.html for issues commenting and closing/reopening properly.
  removing last chunk of MR ajax changes, rest will be in another MR
  reverting more MR ajax files, will appear in different commit
  reverting MR ajax changes, which will be in a different MR
  reverting _mr_title.html.haml
  ...
2016-01-13 20:53:42 +01:00
Tomasz Maczukin 3b7f34281e Modify :ci_variable factory 2016-01-13 19:57:23 +01:00
Rémy Coutable 33ea09bdf9 Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into fix/private-references 2016-01-13 19:46:38 +01:00
Rémy Coutable 0c10aee596 Ensure the API doesn't return notes that the current user shouldn't see 2016-01-13 19:42:36 +01:00
Tomasz Maczukin 13032b713d Add seperated 'describe' block for build trace specs 2016-01-13 18:30:49 +01:00
Rémy Coutable 1f0b8c32e7 Add spec for Note#cross_reference_not_visible_for? 2016-01-13 18:18:59 +01:00
Robert Speicher 843662821d Move `BroadcastMessage#status` to a helper since it's presentational 2016-01-13 11:49:59 -05:00
Robert Speicher df496fcaf0 Update BroadcastMessage model
- Adds default values for `color` and `font` attributes
- Adds `active?`, `started?`, `ended?`, and 'status' methods
2016-01-13 11:34:58 -05:00
Robert Speicher 5a1706791e Update broadcast_message helper
Now it returns the fully-formatted message so we can be consistent about
how it's shown.
2016-01-13 11:34:58 -05:00
Robert Speicher 8086b2bd2e Simplify BroadcastMessage factory
Also make the feature tests less brittle.
2016-01-13 11:34:58 -05:00
Robert Speicher 6ae39c2cd1 Remove alert_type attribute from BroadcastMessage 2016-01-13 11:34:57 -05:00
Tomasz Maczukin 990bd06c04 Change :ci_build_canceled factory to :canceled trait 2016-01-13 16:05:49 +01:00
Yorick Peterse b7f49aa0f0 Merge branch 'configure-randomize-metrics-sample-interval' into 'master'
See merge request !2406
2016-01-13 14:54:45 +00:00
Tomasz Maczukin 9733849618 Add some fixes after review 2016-01-13 15:17:59 +01:00
Yorick Peterse 057eb824b5 Randomize metrics sample intervals
Sampling data at a fixed interval means we can potentially miss data
from events occurring between sampling intervals. For example, say we
sample data every 15 seconds but Unicorn workers get killed after 10
seconds. In this particular case it's possible to miss interesting data
as the sampler will never get to actually submitting data.

To work around this (at least for the most part) the sampling interval
is randomized as following:

1. Take the user specified sampling interval (15 seconds by default)
2. Divide it by 2 (referred to as "half" below)
3. Generate a range (using a step of 0.1) from -"half" to "half"
4. Every time the sampler goes to sleep we'll grab the user provided
   interval and add a randomly chosen "adjustment" to it while making
   sure we don't pick the same value twice in a row.

For a specified timeout of 15 this means the actual intervals can be
anywhere between 7.5 and 22.5, but never can the same interval be used
twice in a row.

The rationale behind this change is that on dev.gitlab.org I'm sometimes
seeing certain Gitlab::Git/Rugged objects being retained, but only for a
few minutes every 24 hours. Knowing the code of Gitlab and how much
memory it uses/leaks I suspect we're missing data due to workers getting
terminated before the sampler can write its data to InfluxDB.
2016-01-13 12:57:46 +01:00
Tomasz Maczukin d44653da1f Add some fixes after review 2016-01-13 12:20:59 +01:00
Dmitriy Zaporozhets 73e0754070 Merge branch 'rs-block-user-before-removal' into 'master'
Block the reported user before destroying the record

This is intended to prevent the user from creating new objects while the
transaction that removes them is being run, resulting in objects with
nil authors which can then not be edited.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/7117

See merge request !2402
2016-01-13 09:14:30 +00:00
Dmitriy Zaporozhets 9552db2fa7 Merge branch 'rs-time_ago_with_tooltip-conversion' into 'master'
Make sure time_ago_with_tooltip is using a Time object

Somehow this test existed on EE but not in CE, so it started failing
after a bad CE-to-EE merge.

See merge request !2398
2016-01-13 09:13:51 +00:00
Dmitriy Zaporozhets 96351a1e9f Merge branch 'comment-and-close-button-does-not-submit-comment' into 'master'
Comment and close button does not submit comment



See merge request !2399
2016-01-13 09:13:17 +00:00
Dmitriy Zaporozhets 32a5b741c2
Merge branch 'add_username_to_user_system_hooks' of https://github.com/tbeadle/gitlabhq
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-01-13 10:12:30 +01:00
Dmitriy Zaporozhets 678ee247ee Merge pull request #9952 from tbeadle/user_id_in_member_system_hook
Include the user_id in user_*_team system hooks.
2016-01-13 10:09:37 +01:00
Robert Speicher da40274fdc Block the reported user before destroying the record
This is intended to prevent the user from creating new objects while the
transaction that removes them is being run, resulting in objects with
nil authors which can then not be edited.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/7117
2016-01-12 20:59:55 -05:00
Rubén Dávila f547e733d1 Add more specs. #3945 2016-01-12 17:49:11 -05:00
Jacob Schatz 63363e47f4 reverting more MR ajax files, will appear in different commit 2016-01-12 14:55:54 -05:00
Robert Speicher 100cdce21e Make sure time_ago_with_tooltip is using a Time object
Somehow this test existed on EE but not in CE, so it started failing
after a bad CE-to-EE merge.
2016-01-12 13:13:16 -05:00
Yorick Peterse 83ad5fa5cb Merge branch 'remove-application-frames-from-views' into 'master'
See merge request !2392
2016-01-12 15:44:57 +00:00
Yorick Peterse 355c341fe7 Stop tracking call stacks for instrumented views
Where a vew is called from doesn't matter as much. We already know what
action they belong to and this is more than enough information. By
removing the file/line number from the list of tags we should also be
able to reduce the number of series stored in InfluxDB.
2016-01-12 15:41:22 +01:00
Gabriel Mazetto ac6a10f3e8 Codestyle changes 2016-01-12 12:29:10 -02:00
Yorick Peterse 5679ee0120 Track memory allocated during a transaction
This gives a very rough estimate of how much memory is allocated during
a transaction. This only works reliably when using a single-threaded
application server and a Ruby implementation with a GIL as otherwise
memory allocated by other threads might skew the statistics. Sadly
there's no way around this as Ruby doesn't provide a reliable way of
gathering accurate object sizes upon allocation on a per-thread basis.
2016-01-12 14:59:30 +01:00
Jacob Schatz f2edb26a1e fixes conflicts 2016-01-11 18:06:15 -05:00
Robert Speicher 6fc1aba4a3 Merge branch 'fix/ci-linter-sequence-validations' into 'master'
Allow subsequent validations in CI Linter

Closes #5851

See merge request !2368
2016-01-11 19:09:09 +00:00
Yorick Peterse d65e7aa9c8 Merge branch 'add-action-to-all-metrics' into 'master'
See merge request !2370
2016-01-11 17:04:34 +00:00
Tomasz Maczukin 5ba0232f79 Fix :ci_build_with_trace factory 2016-01-11 16:57:15 +01:00
Yorick Peterse 35b501f30a Tag all transaction metrics with an "action" tag
Without this it's impossible to find out what methods/views/queries are
executed by a certain controller or Sidekiq worker. While this will
increase the total number of series it should stay within reasonable
limits due to the amount of "actions" being small enough.
2016-01-11 16:51:01 +01:00
Dmitriy Zaporozhets 5500f9159f Merge branch 'group-issues-sorting' into 'master'
Improve performance of getting issues on group level

For testing I used the URL http://localhost:3000/groups/gitlab-org/issues?milestone_title=8.1. Prior to these changes said URL would take about 10-12 seconds to load. By applying these changes the loading time has been reduced to roughly 2-3 seconds. 

There's still some stuff going on in some views that I have to look at, resolving those changes might reduce the loading time a bit more. I also still have to check if I didn't break too many tests.

Fixes: gitlab-org/gitlab-ce#3707 gitlab-org/gitlab-ce#4071 

See merge request !2318
2016-01-11 15:28:41 +00:00
Tomasz Maczukin a30377c6f1 Merge branch 'master' into ci/api-builds
* master: (143 commits)
  Only load autocomplete data when actually needed
  Check for current user
  Add pencil icon to edit group settings
  Issue #5817 wording of the web hooks updated on issue and merge events
  use JavaScript instead of CoffeeScript in Views, the reason #9819
  Before project save ensure that a runners_token exists
  Fix Error 500 when visiting build page of project with nil runners_token
  Remove outdated gitlab-git-http-server reference from Install doc
  Fix typo in build page of projects
  Update docs for shared runner default settings
  Disable "Already Blocked" button in admin abuse report page
  Add CHANGELOG entry for reply-by-email fix
  Use WOFF versions of SourceSansPro
  Clean up document on adding users to a project
  Refactor ZenMode
  Fix caching issue where build status was not updating in project dashboard
  Add a CHANGELOG entry for The Most Important Feature of All Time(TM)
  changes verb `references` to noun `reference`.
  fixes new branch button positioning, when visible and not visible container
  DRY up upload and download services
  ...
2016-01-11 15:34:29 +01:00
Douwe Maan 66dee188d8 Merge branch 'rs-zenmode-cleanup' into 'master'
Refactor ZenMode

- No longer depends on the "hidden checkbox".
- No longer depends on manually storing/restoring the scroll position.
  Instead, we take advantage of jquery.scrollTo.
- Event-based.
- Simplifies the state-based styling.

See merge request !2354
2016-01-11 13:50:30 +00:00
Grzegorz Bizon cdd3a80682 Allow subsequent validations in CI Linter
Closes #5851
2016-01-11 13:37:31 +01:00
Tomasz Maczukin 96bbc145f3 Change commit builds URL in builds API 2016-01-11 10:20:45 +01:00
Stan Hu 4b4fdf58c7 Fix Error 500 when visiting build page of project with nil runners_token
Properly ensure that the token exists and add defensively check for a
non-nil value.

Closes #4294
2016-01-10 18:12:47 -08:00
Zeger-Jan van de Weg 26cedc7e0b Minor improvements, unsubscribe from email footer 2016-01-09 19:32:03 +01:00
Zeger-Jan van de Weg 58867eff46 Unsubscribe from thread through link in email footer 2016-01-09 12:41:22 +01:00
Robert Speicher 89ca4f04f6 Refactor ZenMode
- No longer depends on the "hidden checkbox".
- No longer depends on manually storing/restoring the scroll position.
  Instead, we take advantage of jquery.scrollTo.
- Event-based.
- Simplifies the state-based styling.
2016-01-08 23:36:09 -05:00
Rubén Dávila 164c6374a7 Fix broken specs. #3945 2016-01-08 19:57:51 -05:00
Rubén Dávila 78d7c0e0d8 Fix broken specs. #3945 2016-01-08 19:05:55 -05:00
Rubén Dávila 52f8286a02 Update specs. #3945 2016-01-08 18:40:05 -05:00
Tomasz Maczukin 4eb27d7c72 Add some modifications to builds API and specs 2016-01-08 23:33:45 +01:00
Tomasz Maczukin d54bff2a77 Change test access level from MASTER to DEVELOPER
This should help us detect potential regressions in the future.
2016-01-08 23:04:44 +01:00
Tomasz Maczukin 1eb7b5ee8d Modify entities for builds API 2016-01-08 22:57:42 +01:00
Robert Speicher af68897acd Merge branch 'api-project-upload' into 'master'
Add API project upload endpoint

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

See merge request !2329
2016-01-08 20:29:43 +00:00
Gabriel Mazetto 47e4613f4a Code style fixes and some code simplified 2016-01-08 16:26:04 -02:00
Gabriel Mazetto ec67e9be1d Repair ldap_blocked state when no ldap identity exist anymore 2016-01-08 16:26:04 -02:00
Gabriel Mazetto d6dc088aff LDAP synchronization block/unblock new states 2016-01-08 16:26:04 -02:00
Gabriel Mazetto 6e7db8e23e Prevent ldap_blocked users from being blocked/unblocked by the API 2016-01-08 16:26:04 -02:00
Gabriel Mazetto ba9855d487 Prevent ldap_blocked users from being unblocked by the Admin UI 2016-01-08 16:26:04 -02:00
Gabriel Mazetto bc7ef8e5b7 Add ldap_blocked as new state to users state machine 2016-01-08 16:26:04 -02: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
Douwe Maan 0614793b38 DRY up upload and download services 2016-01-08 17:38:53 +01:00
Douwe Maan 8429f6f409 Merge branch 'rs-single-item-task-list-spec' into 'master'
Add spec for single-item task lists

Follow-up to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2330

See merge request !2340
2016-01-08 16:33:57 +00:00
Drew Blessing c1e974ed88 Merge branch 'issue_3076' into 'master'
Fix problem with projects ending with .keys #3076

Closes #3076

Move route `:username.keys` below project's routes. This allow project's to handle names ending with `.keys`

See merge request !1883
2016-01-08 15:52:05 +00:00
Dmitriy Zaporozhets b64ec38aae Merge branch 'api-delete-tag' into 'master'
Delete tag via API

### What does this MR do?

Implements deleting a tag via the API.

### Are there points in the code the reviewer needs to double check?

On success, it returns the name of the deleted tag. This is similar to the [delete branch API](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/api/branches.rb#L111).

###  What are the relevant issue numbers / Feature requests?

* This MR closes #1575 
* Closes http://feedback.gitlab.com/forums/176466-general/suggestions/6599203-delete-tags-through-the-api

@stanhu Could you do a review?

See merge request !1862
2016-01-08 13:47:42 +00:00
Tomasz Maczukin 549a2fa787 Modify builds scope filtering in builds API 2016-01-08 14:01:31 +01:00
Dmitriy Zaporozhets 08213ed4f5 Merge branch 'accept-2xx-status-codes-for-webhooks' into 'master'
Accept 2xx status codes for successful Web hook triggers

Closes https://github.com/gitlabhq/gitlabhq/issues/9956

See merge request !2332
2016-01-08 10:56:39 +00:00
Robert Schilling 4c90ed52fe Delete tag via API 2016-01-08 10:10:04 +01:00
Rubén Dávila f1f4fdf778 Don't process inline diffs on backend. #3945 2016-01-07 21:08:57 -05:00
Robert Speicher fa36749bce Add two custom Date/Time conversion formats 2016-01-07 20:01:08 -05:00
Robert Speicher 65308a9c15 Add spec for single-item task lists 2016-01-07 15:25:39 -05:00
Robert Speicher 90510f0037 Merge branch 'milestone-ref' into 'master'
Link to milestone in "Milestone changed" system note

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

See merge request !2203
2016-01-07 19:22:43 +00: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
Dmitriy Zaporozhets 3c93e588e9 Merge branch 'annotate-models-20160105' into 'master'
Annotate models

Time to refresh the comments via `annotate`.


See merge request !2311
2016-01-07 18:22:32 +00:00
Tommy Beadle 1f64332e11 Include user_username in user_(add_to/remove_from)_(project/group) system hooks. 2016-01-07 12:54:54 -05:00
Tommy Beadle dada25d447 Include the username in user_create/destroy system hooks. 2016-01-07 12:54:35 -05:00
Tomasz Maczukin e0ec69d919 Change 'trigger_id' to 'token' as resource ID in triggers API 2016-01-07 18:48:33 +01:00
Jacob Schatz 8f6ca70055 fixes ajax issue with issue spec 2016-01-07 12:27:01 -05:00
Douwe Maan 1e927d39b4 Update spec 2016-01-07 15:51:12 +01: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
Yorick Peterse 9b0c360bd5 Fixed issue sorting specs for ID changes
These specs assumed data was still sorted by timestamp, instead of by
ID.
2016-01-07 14:53:02 +01:00
Yorick Peterse 61561a9eeb Merge branch 'remove-more-influxdb-tags' into 'master'
See merge request !2328
2016-01-07 13:38:42 +00:00
Tomasz Maczukin b60c146267 Change :variable_id to :key as resource ID in API 2016-01-07 13:49:38 +01:00
Douwe Maan 1886d727f7 Add API project upload endpoint 2016-01-07 13:37:14 +01:00
Yorick Peterse 7b10cb6f0f Store request methods/URIs as values
Since filtering by these values is very rare (they're mostly just
displayed as-is) we don't need to waste any index space by saving them
as tags. By storing them as values we also greatly reduce the number of
series in InfluxDB.
2016-01-07 13:05:00 +01:00
Jacob Vosmaer 41b8a238ce Merge branch 'master' of github.com:gitlabhq/gitlabhq 2016-01-07 12:56:18 +01:00
Yorick Peterse 364b07cff0 Removed UUIDs from metrics transactions
While useful for finding out what methods/views belong to a transaction
this might result in too much data being stored in InfluxDB.
2016-01-07 12:44:15 +01:00
Douwe Maan 539b41929b Milestone reference is a Markdown link 2016-01-07 12:26:05 +01:00
Yorick Peterse 7ed3a5a240 Revert "Store SQL/view timings in milliseconds"
This reverts commit 7549102bb7.

Apparently I was wrong about
ActiveSupport::Notifications::Event#duration returning the duration in
seconds, instead it returns it in milliseconds already.
2016-01-07 11:47:06 +01:00
Robert Speicher d47b3e63d5 Merge branch 'more-opengraph' into 'master'
Add Open Graph data for group, project and commit.

See merge request !2211
2016-01-06 19:11:05 +00:00
Robert Speicher 623fa2caf7 Merge branch 'fix-banzai-cache' into 'master'
Fix mentionable reference extraction caching.

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

Reverts https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2120 and https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2283

See merge request !2315
2016-01-06 18:11:46 +00:00
Tommy Beadle 4d41294d71 Include the user_id in user_*_team system hooks.
This fixes an issue where the user_id is not included in the data for
user_add_to_team and user_remove_from_team system hooks.  The documentation
already states that the user_id should be included.
2016-01-06 11:49:59 -05:00
Yorick Peterse 7549102bb7 Store SQL/view timings in milliseconds
Transaction timings are also already stored in milliseconds, this keeps
things consistent.
2016-01-06 16:37:14 +01:00
Jose Corcuera 0b2fa3bfa4 Fix problem with projects ending with .keys #3076 2016-01-06 09:54:43 -05:00
Stan Hu 79c0e7212a Annotate models 2016-01-06 13:09:55 +00:00
Douwe Maan 7884a26176 Merge branch 'import-gh-pull-requests' into 'master'
Import GitHub Pull Requests into GitLab

Fixes #2833

See merge request !2168
2016-01-06 12:58:32 +00:00
Jacob Schatz f71642017e adds tests (and passes them) for ajax open and close merge requests. 2016-01-06 07:33:50 -05:00
Douwe Maan 18b17072c6 Add regression test. 2016-01-06 13:33:47 +01:00
Douwe Maan 2474a5921f Merge branch 'master' into milestone-ref 2016-01-06 13:06:50 +01:00
Douwe Maan 639d428046 Merge branch 'master' into more-opengraph 2016-01-06 13:06:25 +01:00
Douwe Maan 384445eca6 Don't override issue page description in project layout. 2016-01-06 13:02:51 +01:00
Robert Speicher 43053c2e6f Make `page_description` less magical 2016-01-05 14:54:59 -05:00
Robert Speicher a298f69432 Use `User#avatar_url` instead of `avatar_icon` helper 2016-01-05 14:50:52 -05:00
Douglas Barbosa Alexandre 837a9065f0 Ensure that we're only importing local pull requests 2016-01-05 15:24:55 -02:00
Douglas Barbosa Alexandre 98909dd12c Generate separate comments when importing GitHub Issues into GitLab 2016-01-05 15:24:55 -02:00
Douglas Barbosa Alexandre dc72a8b305 Refactoring GithubImport::Importer 2016-01-05 15:24:55 -02:00
Douwe Maan b541446389 Fix notification spec 2016-01-05 18:17:55 +01:00
Douwe Maan 8de1f7159c Merge branch 'mikew1/gitlab-ce-better-asana-refs' into 'master'
Better support for referencing and closing issues in asana_service.rb (by @mikew1)



See merge request !2302
2016-01-05 16:10:16 +00:00
Douwe Maan 0b66151632 Remove icon from milestone reference. 2016-01-05 16:45:53 +01:00
Douwe Maan fd91b48f24 Merge branch 'master' into milestone-ref 2016-01-05 16:40:23 +01:00
Douwe Maan 7a3b762978 Merge branch 'master' into more-opengraph
# Conflicts:
#	app/views/layouts/_head.html.haml
2016-01-05 16:35:18 +01:00
Douwe Maan 0bab4788ef Satisfy Rubocop 2016-01-05 16:31:05 +01:00
Tomasz Maczukin 962b97d813 Merge branch 'master' into ci/api-builds
* master: (75 commits)
  Fix grammar
  Clarify the key generation step
  Remove misleading `ssh-dsa`
  markdown fixes
  markdown fixes
  Add `AbuseReport#notify`
  Make AbuseReportMailer responsible for knowing if it should deliver
  Redirect back to user profile page after abuse report
  Redesign the AbuseReports index
  Don't notify users twice if they are both project watchers and subscribers
  Restructure logo JS to use `setInterval`
  Decrease the logo sweep delay
  Correct the logo ID names
  Update CHANGELOG
  Merge pull request GH-9938 from huacnlee/hotfix/note_mail_with_notification
  Remove jquery.blockUI.js plugin
  rempves tests for "you have master access" text
  Revert "Merge branch 'rs-remove-jquery-blockui' into 'master'
"
  removes footer message about access to project
  remove public field from namespace and refactoring
  ...
2016-01-05 15:53:34 +01:00
Douwe Maan 9b1270280a Merge branch 'rs-abuse-reports-refactor' into 'master'
Abuse Report refactors

- Redirect back to user profile after report
- "Tell, Don't Ask" for sending report notifications

See merge request !2293
2016-01-05 14:11:15 +00:00
Douwe Maan 2479af4d5a Merge branch 'pr-9938' into 'master'
Merge pull request GH-9938 from huacnlee/hotfix/note_mail_with_notification

Hotfix note mail with notification

See merge request !2288
2016-01-05 14:00:13 +00:00
Douwe Maan a7c424515c Merge branch 'rs-relative-links-to-root' into 'master'
Support a single directory traversal in RelativeLinkFilter

Prior, if we were viewing a blob at
`https://example.com/namespace/project/blob/master/doc/some-file.md` and
it contained a relative link such as `[README](../README.md)`, the
resulting link when viewing the blob would be:
`https://example.com/namespace/project/blob/README.md` which omits the
`master` ref, resulting in a 404.

Fixes https://gitlab.com/gitlab-org/release-tools/issues/3

See merge request !2247
2016-01-05 13:32:25 +00:00
Tomasz Maczukin 8675664655 Get show details feature to triggers API 2016-01-05 12:25:16 +01:00
Tomasz Maczukin 49c8bf4e9b Add create feature to triggers API 2016-01-05 11:47:54 +01:00
Tomasz Maczukin f00607431c Add delete feature to triggers API 2016-01-05 11:32:21 +01:00
Tomasz Maczukin 3098500835 Fix ci_trigger_request factory 2016-01-05 11:01:44 +01:00
Dmitriy Zaporozhets aa3c7219e3 Merge branch 'fix-api-lookup-with-usernames-with-dots' of https://gitlab.com/stanhu/gitlab-ce 2016-01-05 10:43:29 +01:00
Dmitriy Zaporozhets e6713cd945 Merge branch 'improved-leave-project' into 'master'
Adds settings menu to the top for editting and leaving projects

@creamzy @skyruler @dzaporozhets 
Menu contents depends on user's rights.

Fixes #4221


![Screen_Shot_2015-12-23_at_10.02.47_PM](/uploads/daeaef937bf9d9f4db7ccb674e344ac1/Screen_Shot_2015-12-23_at_10.02.47_PM.png)
![Screen_Shot_2015-12-23_at_10.02.41_PM](/uploads/58eb4eea7d640f01d7f05c2a408a2c04/Screen_Shot_2015-12-23_at_10.02.41_PM.png)
![Screen_Shot_2015-12-23_at_10.02.55_PM](/uploads/4b2ae027a13efcbad3eb81b04f134c4f/Screen_Shot_2015-12-23_at_10.02.55_PM.png)
![Screen_Shot_2015-12-23_at_10.04.47_PM](/uploads/bd5d9d8ddd72d16d74c32c6c1f569776/Screen_Shot_2015-12-23_at_10.04.47_PM.png)


See merge request !2195
2016-01-05 09:34:13 +00:00
Dmitriy Zaporozhets 9914893954 Merge branch 'metrics-tuning' into 'master'
Tuning of metrics data to store

This removes data we don't really need, as well as making sure we don't overload any cache stores or databases.

See merge request !2265
2016-01-05 09:32:19 +00:00
Robert Speicher 46a220ae3c Add `AbuseReport#notify`
Tell, Don't Ask.
2016-01-04 18:59:42 -05:00
Robert Speicher 01248d2051 Make AbuseReportMailer responsible for knowing if it should deliver 2016-01-04 18:59:25 -05:00
Stan Hu 93096247d8 Don't notify users twice if they are both project watchers and subscribers
Closes #4708
2016-01-04 15:01:52 -08:00
Robert Speicher 6f4ea679d9 Merge branch 'show-all-builds-by-default' into 'master'
Show all builds by default in the builds page

Fixes #4240 

See merge request !2243
2016-01-04 18:42:37 +00:00
Douwe Maan 12ce1cbfcf Merge pull request GH-9938 from huacnlee/hotfix/note_mail_with_notification
Hotfix note mail with notification
2016-01-04 13:33:58 -05:00
Dmitriy Zaporozhets e586492e48 Merge branch 'rs-issue-201' into 'master'
Prevent duplicate "username has already been taken" validation message

Closes #201 - two-year-old bug, woo! 💥 🎉

See merge request !2279
2016-01-04 17:20:38 +00:00
Tomasz Maczukin d9da81f736 Add triggers feature to API 2016-01-04 16:44:09 +01:00
Stan Hu 561acdebf8 Merge branch 'extra-system-hooks' into 'master'
Added system hooks messages for renaming and transferring a project

This is work in progress but I wanted to get some feedback on it in case there is something I've missed or a better way to do it.

As the title says when a project is renamed or transferred to another group a system hook message is generated.

Currently adds a couple of extra properties to the standard project system hooks messages.

old_path_with_namespace - The old path of the project so we can see what has been renamed / transferred
changed_at - The time that change took place

My main concern is if there is a better way of doing this than passing the extra_data variable into the system hook.  Would it be better to extend the project model with these 2 items as transient properties as I doubt they would need to be saved to the database?  The other 

I've also seen, but can't find, someone talking about the emails sent when a project is renamed or transferred doesn't reference the original project path so if you have similarly named projects then you might not know what has been moved.  I think the extra_data (or however it is best to implement this) would allow the extra information to be sent in emails.

Closes [System hooks for project transfer and repository rename](http://feedback.gitlab.com/forums/176466-general/suggestions/6006233-system-hooks-for-project-transfer-and-repository-r)


See merge request !611
2016-01-04 15:39:52 +00:00
Jacob Schatz 6180560318 rempves tests for "you have master access" text 2016-01-04 10:36:53 -05:00
Valery Sizov 8b18449125 remove public field from namespace and refactoring 2016-01-04 16:00:29 +02:00
Steve Norman 79ec7f2897 Added system hooks messages for renaming and transferring a project 2016-01-04 13:48:00 +00:00
Yorick Peterse 8de491a68f Fix Rubocop styling in AR subscriber specs 2016-01-04 14:21:39 +01:00
Douglas Barbosa Alexandre 567dc62b6d Show 'All' tab by default in the builds page 2016-01-04 10:21:10 -02:00
Yorick Peterse 2ee8f55599 Automatically prefix transaction series names
This ensures Rails and Sidekiq transactions are split into the series
"rails_transactions" and "sidekiq_transactions" respectively.
2016-01-04 13:17:02 +01:00
Yorick Peterse 2ea464bb27 Use separate series for Rails/Sidekiq sample stats
This removes the need for any tags to differentiate between Sidekiq and
Rails statistics while still being able to separate the two.
2016-01-04 12:45:31 +01:00
Yorick Peterse 825b46f8a3 Track total method call times per transaction
This makes it easier to see where time is spent without having to
aggregate all the individual points in the method_calls series.
2016-01-04 12:19:45 +01:00
Yorick Peterse 66a997a914 Track total query/view timings in transactions 2016-01-04 12:14:36 +01:00
Yorick Peterse 96075be6f4 Ability to increment custom transaction values
This will be used to store/increment the total query/view rendering
timings on a per transaction basis. This in turn can greatly reduce the
amount of metrics stored.
2016-01-04 11:37:46 +01:00
Stan Hu 086cfc8685 Fix API project lookups when querying with a namespace with dots
Attempting to use the /projects/:id API by specifying :id in
"namespace/project" format would always result in a 404 if the namespace
contained a dot.

The reason? From http://guides.rubyonrails.org/routing.html#specifying-constraints:

"By default the :id parameter doesn't accept dots - this is because the dot is
used as a separator for formatted routes. If you need to use a dot within an
:id add a constraint which overrides this - for example id: /[^\/]+/ allows
anything except a slash."

Closes https://github.com/gitlabhq/gitlabhq/issues/9573
2016-01-03 15:08:44 -08:00
Robert Speicher fd178c1e7d Prevent duplicate "username has already been taken" validation message
Closes #201 - two-year-old bug, woo! 💥 🎉
2016-01-02 20:03:28 -05: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 571df5f44b Use `execute` in Asana specs 2015-12-31 18:29:00 -04:00
Mike Wyatt 90029a5caa Actually test the posted comment in Asana service 2015-12-31 18:27:34 -04:00
Tomasz Maczukin 937567b767 Add create feature to variables API 2015-12-31 22:30:07 +01:00
Yorick Peterse cafc784ee1 Removed tracking of hostnames for metrics
This isn't hugely useful and mostly wastes InfluxDB space. We can re-add
this whenever needed (but only once we really need it).
2015-12-31 17:55:10 +01:00
Yorick Peterse bd9f86bb8a Use separate series for Rails/Sidekiq transactions
This removes the need for tagging all metrics with a "process_type" tag.
2015-12-31 17:52:51 +01:00
Yorick Peterse 55ed6e1c96 Cache InfluxDB settings after the first use
This ensures we don't need to load anything from either PostgreSQL or
the Rails cache whenever creating new InfluxDB connections.
2015-12-31 17:47:07 +01:00
Yorick Peterse a6c60127e3 Removed tracking of raw SQL queries
This particular setup had 3 problems:

1. Storing SQL queries as tags is very inefficient as InfluxDB ends up
   indexing every query (and they can get pretty large). Storing these
   as values instead means we can't always display the SQL as easily.
2. We already instrument ActiveRecord query methods, thus we already
   have timing information about database queries.
3. SQL obfuscation is difficult to get right and I'd rather not expose
   sensitive data by accident.
2015-12-31 17:14:02 +01:00
Tomasz Maczukin c5177dd5e2 Add missing 'not_found' checks in variables API 2015-12-31 17:03:11 +01:00
Tomasz Maczukin 0d014feb1d Add delete feature to variables API 2015-12-31 16:56:03 +01:00
Tomasz Maczukin a692ce1c07 Add update feature for variables API 2015-12-31 16:26:55 +01:00
Tomasz Maczukin ea4777ff50 Add features for list and show details of variables in API 2015-12-31 16:26:54 +01:00
Yorick Peterse 054df415f9 Optimize CSS expressions produced by Nokogiri
Nokogiri produces inefficient XPath expressions when given CSS
expressions such as "a.gfm". Luckily these expressions can be optimized
quite easily while still achieving the same results.

In the two cases where this optimization is applied the run time has
been reduced from around 170 ms to around 15 ms.
2015-12-31 15:46:47 +01:00
Yorick Peterse c936e4e3c8 Removed various default metrics tags
While it's useful to keep track of the different versions (Ruby, GitLab,
etc) doing so for every point wastes disk space and possibly also RAM
(which InfluxDB is all to eager to gobble up). If we want to see the
performance differences between different GitLab versions simply looking
at the performance since the last release date should suffice.
2015-12-31 11:26:04 +01:00
Rubén Dávila 795ecb498c Fix broken spec. #3945 2015-12-31 01:46:52 -05:00
Rubén Dávila 3fbcf52ec8 Apply syntax highlighting when expanding diff plus some refactor. #3945 2015-12-31 01:05:52 -05:00
Rubén Dávila fd100e1ef1 Don't modify "match" diff lines. #3945 2015-12-30 21:44:12 -05:00
Rubén Dávila 8b079315d9 A bit of refactoring. #3945 2015-12-30 21:23:50 -05:00
Rubén Dávila d83275620a Add specs for Gitlab::Diff::Highlight. #3945 2015-12-30 20:18:40 -05:00
Rubén Dávila 7de90f4b53 Fix broken spec and small refactor. #3945 2015-12-30 18:42:11 -05:00
Robert Speicher d9d2e8a3e8 Support a single directory traversal in RelativeLinkFilter
Prior, if we were viewing a blob at
`https://example.com/namespace/project/blob/master/doc/some-file.md` and
it contained a relative link such as `[README](../README.md)`, the
resulting link when viewing the blob would be:
`https://example.com/namespace/project/blob/README.md` which omits the
`master` ref, resulting in a 404.
2015-12-30 15:36:59 -05:00
Tomasz Maczukin 44dd4782f0 Merge branch 'master' into ci/api-builds
* master: (108 commits)
  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.
  Handle missing settings table for metrics
  Fix broken link in permissions page [ci skip]
  reCAPTCHA is configurable through Admin Settings, no reload needed.
  Fixed syntax in gitlab.yml.example
  Move InfluxDB settings to ApplicationSetting
  Fix spelling mistake, thanks Connor.
  Restart settings are moved too.
  Hotfix for builds trace data integrity
  add issue weight to contributing
  Added host option for InfluxDB
  Fixed styling of MetricsWorker specs
  ...
2015-12-30 17:09:26 +01:00
Tomasz Maczukin a17bf380cb Add cancel/retry features to builds API 2015-12-30 16:37:47 +01:00
Tomasz Maczukin 593d87ea54 Add specs for build details/traces features in builds API 2015-12-30 15:12:07 +01:00
Rubén Dávila bb96d63153 New implementation for highlighting diff files. #3945
* It is more performant given now we process all the diff file instead
  of processing line by line.
* Multiline comments are highlighted correctly.
2015-12-30 00:52:50 -05:00
Mike Wyatt d67f697d9e Merge remote-tracking branch 'origin/master' into better-asana-refs
* origin/master:
  Use lazy reference extractor to get issue's MRs
  Banzai::XFilter -> Banzai::Filter::XFilter
  Move Markdown/reference logic from Gitlab::Markdown to Banzai
2015-12-30 00:33:15 -04:00
Tomasz Maczukin d2601211a0 Add specs for build listings in API 2015-12-29 23:12:36 +01:00
Mike Wyatt 4c1f1c2c91 Update Asana specs 2015-12-29 15:40:50 -04:00
Valery Sizov eeba266e3d Merge branch 'upvote_count_to_api' into 'master'
Revert upvotes and downvotes params back to MR API

issue https://gitlab.com/gitlab-org/gitlab-ce/issues/3672

See merge request !2212
2015-12-29 16:07:12 +00:00
Yorick Peterse 620e7bb3d6 Write to InfluxDB directly via UDP
This removes the need for Sidekiq and any overhead/problems introduced
by TCP. There are a few things to take into account:

1. When writing data to InfluxDB you may still get an error if the
   server becomes unavailable during the write. Because of this we're
   catching all exceptions and just ignore them (for now).
2. Writing via UDP apparently requires the timestamp to be in
   nanoseconds. Without this data either isn't written properly.
3. Due to the restrictions on UDP buffer sizes we're writing metrics one
   by one, instead of writing all of them at once.
2015-12-29 14:53:45 +01:00
Yorick Peterse 03478e6d5b Strip newlines from obfuscated SQL
Newlines aren't really needed and they may mess with InfluxDB's line
protocol.
2015-12-29 13:40:08 +01:00
Robert Speicher f0ecd69be5 Merge branch 'fix-spelling-mistake' into 'master'
Fix spelling mistake, thanks Connor.

[ci skip]

See merge request !2227
2015-12-29 00:13:16 +00:00
Rubén Dávila 34657b821a Add syntax highlighting to diff view. #3945 2015-12-28 18:31:27 -05:00
Jacob Schatz d985d08a19 adds proper `it` for multi line. adds `find` with correct id for button. 2015-12-28 17:37:03 -05:00
Jacob Schatz c6c96708b5 Merge branch 'master' into improved-leave-project 2015-12-28 17:08:12 -05:00
Yorick Peterse ed214a11ca Handle missing settings table for metrics
This ensures we can still boot, even when the "application_settings"
table doesn't exist.
2015-12-28 22:38:34 +01:00
Jacob Schatz 8ee6abaaf4 fixes tests failing 2015-12-28 14:45:23 -05:00
Sytse Sijbrandij 4465e2eca0 Fix spelling mistake, thanks Connor. 2015-12-28 17:08:15 +01:00
Dmitriy Zaporozhets 540eb0a9af Merge branch 'influxdb' into 'master'
Storing of application metrics in InfluxDB

This adds support for tracking metrics in InfluxDB, which in turn can be visualized using Grafana. For more information see #2936.

See merge request !2042
2015-12-28 13:42:15 +00:00
Yorick Peterse db7bbadf95 Fixed styling of MetricsWorker specs 2015-12-28 11:34:11 +01:00
Valery Sizov 83d42c1518 Revert upvotes and downvotes params to MR API 2015-12-28 11:41:16 +02:00
Robert Speicher dcca64a523 Use `assign` instead of `instance_variable_set` 2015-12-27 19:58:44 -05:00
Robert Speicher a7756a4b51 Add specs for page_image using a Group's avatar 2015-12-27 19:49:48 -05:00
Robert Speicher a97a2d2720 Merge branch 'mention-all' into 'master'
Only allow group/project members to mention `@all`

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

See merge request !2205
2015-12-27 21:09:16 +00:00
Robert Speicher 98f77d2edc Merge branch 'close-open-ajax-issue' into 'master'
open and close issue via ajax request. With tests

Close and Reopen issues with ajax request.

See merge request !2164
2015-12-25 21:00:16 +00:00
Dmitriy Zaporozhets fd231ff9fb Merge branch 'revert_votes_back' into 'master'
Revert vote buttons back to issue and MR pages

https://gitlab.com/gitlab-org/gitlab-ce/issues/3672



/cc @dzaporozhets @JobV 


![joxi_screenshot_1450809309400](/uploads/379a75505e0d5f24e743aa0a6a6684e2/joxi_screenshot_1450809309400.png)


See merge request !2206
2015-12-25 15:52:06 +00:00
Valery Sizov c79ffa01b4 satisfy rubocop 2015-12-25 15:46:01 +02:00
Douwe Maan 7d5b51f387 Merge branch 'rs-opengraph' into 'master'
Add Open Graph meta tags



See merge request !2192
2015-12-25 13:41:55 +00:00
Douwe Maan 6438c288a8 Satisfy Rubocop 2015-12-25 13:22:32 +01:00
Douwe Maan 9a0e16f454 Fix spec 2015-12-25 13:20:20 +01:00
Douwe Maan 7dedd997b9 Merge branch 'master' into milestone-ref 2015-12-25 13:16:33 +01:00
Valery Sizov 195dc3a746 add sorting of awards 2015-12-25 14:11:19 +02:00
Valery Sizov a1b63e1252 revert back vote buttons to issue and MR pages 2015-12-25 14:11:19 +02:00
Dmitriy Zaporozhets 92bc703847 Merge branch 'support-api-lookup-by-username' into 'master'
Add API support for looking up a user by username

Needed to support Huboard

See merge request !2089
2015-12-25 11:23:29 +00:00
Robert Speicher ab3d855c0e Add support for `twitter:label` meta tags 2015-12-24 17:11:08 -05:00