Commit Graph

901 Commits

Author SHA1 Message Date
Douglas Barbosa Alexandre aa30088f6e Fix old version warning when viewing wiki latest version via version_id 2016-01-29 14:17:00 -02:00
Marin Jankovski 9d0065f054 Merge branch 'hotfix/ruby-21-broken-update' into 'master'
fix syntax error on 2.1 and rubocop on 2.2

Background:

Hashes `{:'key': 'value'}` are not valid in 2.1 but are recommended by Rubocop on 2.2. We only use those when we have a key such as `weird-key`, `weird.key`, etc... 

We could disable Rubocop but it wouldn't warn us about the recommended syntax since `Ruby 1.9`: `{key: 'value'}`, which is valid for `Ruby 1.9+`.

Workaround 1 could be disabling `Style/HashSyntax:` in `rubocop.yml`. 

Workaround 2 (tried in this MR) is to trick Rubocop using `.to_sym` which is effectively the same as adding the `:`. This would allow to keep the warning in place.

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

See merge request !2637
2016-01-29 08:12:18 +00:00
Douwe Maan b7ec476205 Merge branch 'master' into mr-merge-base 2016-01-28 15:12:24 +01:00
Douwe Maan 30b0d06e9f Fix specs 2016-01-28 15:10:48 +01:00
James Lopez 902baa2e1c trick rubocop and temporarily add ruby 2.1 images for any branch 2016-01-28 11:41:58 +01:00
Douwe Maan f025f80d5c Merge branch 'update-ruby-2.2.4' into 'master'
Update Ruby version to 2.2.4 (latest previous stable) and update docs

Tests and issues added to https://github.com/gitlabhq/gitlabhq/issues/8696 were all fine after the upgrade. 

Main issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/3340

See merge request !2534
2016-01-27 21:39:08 +00:00
Robert Speicher bba7e786a6 Merge branch 'events-performance' into 'master'
Improve performance of retrieving last update times for events

See 75195eefcca4cb3961986c90c8e837da02f30134 and
https://gitlab.com/gitlab-org/gitlab-ce/issues/12415#note_3387317
for the juicy details.

Related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/12415

See merge request !2613
2016-01-27 21:20:16 +00:00
James Lopez 683770f35d Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into update-ruby-2.2.4 2016-01-27 15:42:35 +01:00
Yorick Peterse de7c9c7ab1 Use Atom update times of the first event
By simply loading the first event from the already sorted set we save
ourselves extra (slow) queries just to get the latest update timestamp.
This removes the need for Event.latest_update_time and significantly
reduces the time needed to build an Atom feed.

Fixes gitlab-org/gitlab-ce#12415
2016-01-27 10:33:33 +01:00
Blake Hitchcock 4be65c3231 Update ExternalIssue regex for JIRA integration
The pattern in the `::reference_pattern` class method in the
ExternalIssue model does not match all valid forms of JIRA project
names. I have updated the regex to match JIRA project names with numbers
and underscores. More information on valid JIRA project names can be
found here:
https://confluence.atlassian.com/jira/changing-the-project-key-format-192534.html

* The first character must be a letter,
* All letters used in the project key must be from the Modern Roman Alphabet and upper case, and
* Only letters, numbers or the underscore character can be used.
2016-01-26 15:55:40 -05:00
Douglas Barbosa Alexandre 1aa82dc459 Prioritize previewable over plain README files 2016-01-25 11:27:07 -02:00
James Lopez ee209cc936 fix rubocop new 2.2 syntax issues 2016-01-25 11:44:25 +01:00
Douwe Maan 0f2a906211 Merge branch 'update-gitlab-git' into 'master'
Update gitlab_git & use new method for counting branches

Corresponding gitlab_git merge request detailing some of the rationale behind this: https://gitlab.com/gitlab-org/gitlab_git/merge_requests/62

Fixes #12418 

See merge request !2535
2016-01-25 09:35:54 +00:00
Robert Speicher 3f5e6c6cf6 Merge branch 'ci/recursive-artifacts-entries' into 'master'
Add method to calculate total size of artifacts in subpath

See merge request !2500
2016-01-21 23:23:02 +00:00
Yorick Peterse 0689663487 Use branch_count in Repository#has_visible_content?
Gitlab::Git::Repository#branch_count is a tad faster than the previous
setup. See gitlab-org/gitlab_git!62 for more information.
2016-01-21 18:19:18 +01:00
Kamil Trzcinski 9b0f57781e Add method that calculates total size for artifacts subfolder 2016-01-20 21:55:13 +01:00
Jeroen Nijhof 85e0fce9ee Add sentry integration 2016-01-18 17:15:10 +01:00
Robert Speicher d633755350 Use a more sensible message for the AbuseReport uniqueness validation
Previously it was "user has already been taken", when really we were
saying the user has already been reported.
2016-01-16 16:50:43 -05:00
Kamil Trzcinski ac652d82f1 Let the CI runner know about builds that this build depends on
This allows us to implement artifacts passing: runner will download artifacts from all prior builds
2016-01-14 19:45:55 +01:00
Douglas Barbosa Alexandre a6a5990ee5 Add Banzai::Filter::GollumTagsFilter for parsing Gollum's tags in HTML 2016-01-14 12:09:31 -02:00
Grzegorz Bizon f80d7a868e Update build model specs 2016-01-14 12:48:16 +01:00
Grzegorz Bizon cfffc9eff2 Update build specs for artifacts browser support 2016-01-14 12:48:15 +01:00
Grzegorz Bizon 5ff7ec42dc Add method that checks if artifacts browser is supported
This is needed because of backward compatibility. Previously artifacts
archive had `.tar.gz` format, but artifacts browser requires ZIP format
now.
2016-01-14 12:48:14 +01:00
Grzegorz Bizon 8eeed761a9 Update specs for CI Build, add `artifacts?` method
`artifacts?` method checks if artifacts archive is available.
2016-01-14 12:48:14 +01:00
Grzegorz Bizon 9e0e9342a4 Rename method that returns url to CI build artifacts download 2016-01-14 12:48:14 +01:00
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
Rémy Coutable e918493f55 Fix specs and rubocop warnings 2016-01-14 10:04:48 +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 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 6ae39c2cd1 Remove alert_type attribute from BroadcastMessage 2016-01-13 11:34:57 -05: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
Gabriel Mazetto ac6a10f3e8 Codestyle changes 2016-01-12 12:29:10 -02: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
Gabriel Mazetto ec67e9be1d Repair ldap_blocked state when no ldap identity exist anymore 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
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
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
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
Stan Hu 79c0e7212a Annotate models 2016-01-06 13:09:55 +00:00
Douwe Maan 18b17072c6 Add regression test. 2016-01-06 13:33:47 +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 0bab4788ef Satisfy Rubocop 2016-01-05 16:31:05 +01:00
Robert Speicher 46a220ae3c Add `AbuseReport#notify`
Tell, Don't Ask.
2016-01-04 18:59:42 -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
Valery Sizov 8b18449125 remove public field from namespace and refactoring 2016-01-04 16:00:29 +02:00