Commit Graph
2758 Commits
Author SHA1 Message Date
Dmitriy Zaporozhets 3f6bb7bc86 Merge branch 'issue_5546' into 'master'
Save list sort in a cookie

Closes #5546 

See merge request !2537
2016-01-28 16:21:04 +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
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
Yorick Peterse 128a6411d2 Don't pluck project IDs for events
By instead using a sub-query we save ourselves the overhead of loading
any data into memory only to pass it on to another query.
2016-01-26 10:51:53 +01:00
Douglas Barbosa Alexandre 1aa82dc459 Prioritize previewable over plain README files 2016-01-25 11:27:07 -02: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
Dmitriy Zaporozhets dc78ee4e8b Merge branch 'ignore-binary-files-in-git-grep' into 'master'
Ignore binary files in code search to prevent Error 500

Leaving out the -I option in "git grep" would cause an Error 500 because the
resulting line would include "Binary file X matches", which would cause the project search results to crash with the following error:

```
ActionView::Template::Error (wrong argument type nil (expected Regexp)):
    1: - blob = @project.repository.parse_search_result(blob)
    2: .blob-result
    3:   .file-holder
    4:     .file-title
  app/models/repository.rb:742:in `sub'
  app/models/repository.rb:742:in `block in parse_search_result_from_grep'
  app/models/repository.rb:741:in `each_line'
  app/models/repository.rb:741:in `parse_search_result_from_grep'
  app/models/repository.rb:682:in `parse_search_result'
  app/views/search/results/_blob.html.haml:1:in `_app_views_search_results__blob_html_haml__1959871337755590783_162450160'
  app/views/search/_results.html.haml:20:in `_app_views_search__results_html_haml__2198486911700532411_58329920'
  app/views/search/show.html.haml:7:in `_app_views_search_show_html_haml___1698304427272645201_62235300'
```

See merge request !2565
2016-01-23 18:11:08 +00:00
Rubén Dávila 9ef468922c Merge branch 'master' into issue_5546 2016-01-22 17:54:37 -05:00
Rubén Dávila 7c520c7803 Make sorting preference reusable for all projects. 2016-01-22 17:00:35 -05:00
Stan Hu 5972dedfcf Ignore binary files in code search to prevent Error 500
Leaving out the -I option in "git grep" would cause an Error 500 because the
resulting line would include "Binary file X matches"
2016-01-22 08:17:54 -08:00
Valery Sizov be7bc9d9b0 Backport some changes from EE 2016-01-22 11:24:44 +02:00
Robert Speicher 9a5f83a30a Merge branch 'unescaped-diffs' into 'master'
Make sure non-highlighted diffs are still escaped

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

See merge request !2544
2016-01-22 01:35:39 +00:00
Douwe Maan 150b4f66e6 Make sure non-highlighted diffs are still escaped 2016-01-22 01:47:17 +01: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
Douwe Maan 21facf5353 Use consistent markup and styling for highlighting across blobs, diffs, blame and snippets 2016-01-21 14:23:53 +01:00
Robert Speicher 4d84259df8 Merge branch 'fix-project-creation' into 'master'
Creator should be added as a master of the project on creation

Fixes #4222 

This also enable a project creator to add themselves as a master of the
project for existing repositories that were created in the meanwhile
that they don't appear as members.

See merge request !2520
2016-01-20 23:03:59 +00:00
Rubén Dávila 4d345bc400 Remember last sort option used. 2016-01-20 17:29:53 -05:00
Douglas Barbosa Alexandre 096485ef65 Creator should be added as a master of the project on creation
This also enable a project creator to add themselves as a master of the
project.
2016-01-20 20:06:28 -02:00
Kamil Trzcinski 9b0f57781e Add method that calculates total size for artifacts subfolder 2016-01-20 21:55:13 +01:00
Rubén Dávila 985297d82a Merge branch 'master' into issue_3945 2016-01-20 15:07:00 -05:00
Robert Speicher 1553c560e0 Merge branch 'feature/check-against-rbl-only' into 'master'
Split from !2455

References #9092

See merge request !2515
2016-01-20 14:24:20 -05:00
Douwe Maan 7d347ae564 Merge branch 'master' into issue_3945 2016-01-20 20:04:15 +01:00
Robert Speicher e3c43ca7d0 Merge branch 'sentry-integration' into 'master'
Add sentry integration

Sentry is an event logging platform primarily focused on capturing and
aggregating exceptions. With this MR it will be possible to log and
track exceptions from GitLab to Sentry.

https://gitlab.com/gitlab-com/operations/issues/39

See merge request !2485
2016-01-20 19:00:35 +00:00
Douwe Maan 577f2fb47a Save and use actual diff base commit for MR diff highlighting 2016-01-20 18:44:27 +01:00
Douwe Maan b4faa59728 Merge branch 'issue_3749' into 'master'
Update Issues/MRs updated_at field when notes are generated

Closes #3749 and #9130

See merge request !2493
2016-01-20 15:06:49 +00:00
Douwe Maan 987e3d94b0 Fix MR diff_refs 2016-01-20 15:40:49 +01:00
Tomasz Maczukin 8536e083f7 Add IP blocking against DNSBL at sign-up 2016-01-20 15:28:19 +01:00
Douwe Maan c23ca0b0b5 Merge branch 'master' into issue_3945 2016-01-20 14:53:41 +01:00
Jeroen Nijhof 7658a64469 Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into sentry-integration
Conflicts:
	db/schema.rb
2016-01-20 09:07:10 +01:00
Rubén Dávila 35a776754c Update Issue/MR everytime a Note is saved/destroyed. 2016-01-19 15:02:26 -05:00
Robert Speicher b9fca47854 Merge branch 'user-ldap-email' into 'master'
Allow LDAP users to change their email if it was not set by the LDAP
server

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

See merge request !2502
2016-01-19 19:15:23 +00:00
Dmitriy Zaporozhets 20cc4bc475 Merge branch 'add-public-param-to-project-api' into 'master'
Add public params to GET /projects api. Closes #3788



See merge request !2409
2016-01-19 18:51:38 +00:00
Douwe Maan 4f44455626 Merge branch 'master' into user-ldap-email
# Conflicts:
#	db/schema.rb
2016-01-19 18:30:59 +01:00
Rubén Dávila c7264d2a76 Check if MR is not broken. 2016-01-19 11:40:43 -05:00
Douwe Maan 98e1a5b634 Allow LDAP users to change their email if it was not set by the LDAP server 2016-01-19 16:25:38 +01:00
Josh Frye ae6080c791 Add specs. Adjust filter. 2016-01-19 09:57:00 -05:00
Josh Frye 11797df1af Change 'public' flag to more robust 'visibility' query. 2016-01-19 09:57:00 -05: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
Jeroen Nijhof 85e0fce9ee Add sentry integration 2016-01-18 17:15:10 +01:00
Dmitriy Zaporozhets 513b45686e Merge branch 'hook_url_limit' into 'master'
Raise hook url limit

1. Up varchar url limit to 2000 chars instead 255
2. Maybe migration?
3. 255 characters - it is not enough
4. nil
5. nil

See merge request !1940
2016-01-18 00:36:31 +00: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
Douwe Maan c19795dff5 Merge branch 'ci/build_dependencies' into 'master'
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. It will happen automatically, and always, as long as artifacts are enabled.

## The changes:

This MR exposes list of prior builds in CI::API::Builds.

**The API response when asking for builds**

```json
{
  "id": 48584,
  "ref": "0.1.1",
  "tag": true,
  "sha": "d63117656af6ff57d99e50cc270f854691f335ad",
  "status": "success",
  "name": "pages",
  "token": "9dd60b4f1a439d1765357446c1084c",
  "stage": "test",
  "project_id": 479,
  "project_name": "test",
  "commands": "echo commands",
  "repo_url": "http://gitlab-ci-token:token@gitlab.example/group/test.git",
  "before_sha": "0000000000000000000000000000000000000000",
  "allow_git_fetch": false,
  "options": {
    "image": "docker:image",
    "artifacts": {
      "paths": [
        "public"
      ]
    },
    "cache": {
      "paths": [
        "vendor"
      ]
    }
  },
  "timeout": 3600,
  "variables": [
    {
      "key": "CI_BUILD_TAG",
      "value": "0.1.1",
      "public": true
    }
  ],
  "dependencies": {
    "builds": [
      {
        "id": 48584,
        "ref": "0.1.1",
        "tag": true,
        "sha": "d63117656af6ff57d99e50cc270f854691f335ad",
        "status": "success",
        "name": "build",
        "token": "9dd60b4f1a439d1765357446c1084c",
        "stage": "build",
        "project_id": 479,
        "project_name": "test",
        "artifacts_file": {
          "filename": "artifacts.zip",
          "size": 0
        }
      }
    ]
  }
}
```

## How it will work?

**Example:**
```
build:
  type: build
  script:
  - echo TEST > test_file
  artifacts:
    untracked: true

rspec:
  type: test
  script:
  - test-my-project

staging:
  type: deploy
  script:
  - scp test_file root@server.com:
```

**The flow:**
1. We run `build`. The `build` creates a file `test_file`. This file gets archived and send us build artifacts.
2. We run `rspec`. The `rspec` downloads build artifacts from `build`. Uses the `test_file`.
3. We run `staging`. The `staging` downloads build artifacts from `build` and `rspec`, but since the `rspec` doesn't have build artifacts we skip that build. Deploys the `test_file`.

This partially implements the https://gitlab.com/gitlab-org/gitlab-ce/issues/3423.

In the next release we will introduce option to configure what artifacts are received.

/cc @grzesiek @DouweM @sytse @rspeicher


See merge request !2437
2016-01-15 15:54:35 +00:00
Andrew JohnsonandGrzegorz Bizon f66f9e95bf Give reporters the ability to download artifacts.
Also fix a few places where page_404 should be render_404.
2016-01-15 12:01:19 +01:00
Rubén Dávila c8db25c37c Merge branch 'master' into issue_3945 2016-01-14 17:28:44 -05:00
Rubén Dávila 6b9c730e91 More refactoring from last code review. #3945
* Use commit objects instead of IDs when generating diffs
* Use proper references when generating MR's source and target
* Update broken specs
2016-01-14 16:47:55 -05:00
Kirilll Zaycev e80113593c Raise hook url limit 2016-01-15 00:35:12 +03:00
Tomasz Maczukin 768721dc58 Merge branch 'master' into ci/api-triggers
* master: (150 commits)
  fixes margin and padding
  Update mailroom/postfix documentation [ci skip]
  Fix css mess around git clone panel. Align it properly
  Fix missing padding for user/group pages
  Fix parse_gollum_tags matcher
  Update documentation on Banzai::Filter::GollumTagsFilter
  Add tests for the wiki pipeline
  Refactoring Banzai::Filter::GollumTagsFilter
  Make sure the .git is at the end on Gitlab::GithubImport::WikiFormatter
  Remove GollumTagsPipeline
  Refactoring Gitlab::GithubImport::Importer
  Remove unnecessary brackets on WIKI_SLUG_ID route constraints
  Move js function to removing accents to vendor/assets/javascripts
  Update CHANGELOG
  Use the WikiPipeline when rendering the wiki markdown content
  Add Banzai::Filter::GollumTagsFilter for parsing Gollum's tags in HTML
  Relax constraints for wiki slug
  Import GitHub wiki into GitLab
  Move Ci::Build#available_statuses to AVAILABLE_STATUSES constant in CommitStatus
  Revert changes to how the notes are paginated in the API
  ...

Conflicts:
	doc/api/README.md
	lib/api/entities.rb
2016-01-14 21:58:17 +01: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