Commit Graph

2494 Commits

Author SHA1 Message Date
Gabriel Mazetto c9aa19881c Enable Style/SpaceAroundEqualsInParameterDefault cop 2016-08-06 04:03:01 +02:00
Rémy Coutable d3c1e93d55 Merge branch '20527-fork-commits-have-impact-on-original-project' into 'master'
Don’t close issues on original project

Closes #20527 -> https://gitlab.com/gitlab-org/gitlab-ce/issues/20527

See merge request !1981
2016-08-04 13:06:38 +00:00
Rémy Coutable b2d142c4a0 Merge branch 'fix/ha-mode-import-issue' into 'master'
Fix Import/Export not working in HA mode

Use a shared path instead of `Tempfile` default `/tmp` so the import file is accessible by any GitLab instance.

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

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5618
2016-08-04 12:21:53 +00:00
James Lopez 6a0bbb5aa5 using shared path for project import uploads and refactored gitlab remove export worker 2016-08-04 12:51:55 +02:00
Paco Guzman fa54a8e984 Don’t close issues on original project from a fork
Signed-off-by: Paco Guzman <pacoguzmanp@gmail.com>
2016-08-04 12:38:08 +02:00
Rémy Coutable ae83801cd5 Merge branch 'fix/import-error' into 'master'
Fix Import/Export error checking versions

Fixes small bug preventing the correct error message about Import/Export version being displayed.

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

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5638
2016-08-04 10:09:18 +00:00
Douwe Maan c008a1a967 Make Compare#diffs diff_options a regular argument 2016-08-03 09:32:01 -07:00
James Lopez f87eb25020 Fix Import/Export error checking versions 2016-08-03 13:00:34 +02:00
Paco Guzman c86c1905b5 switch from diff_file_collection to diffs
So we have raw_diffs too
2016-08-03 07:00:20 +02:00
Paco Guzman 1d0c7b7492 Introduce Compare model in the codebase.
This object will manage Gitlab::Git::Compare instances
2016-08-03 07:00:20 +02:00
Paco Guzman 8f359ea917 Move to Gitlab::Diff::FileCollection
Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
2016-08-03 07:00:20 +02:00
Paco Guzman cd7c2cb6dd Cache highlighted diff lines for merge requests
Introducing the concept of SafeDiffs which relates 
diffs with UI highlighting.
2016-08-03 07:00:19 +02:00
James Lopez f611b7b357 fix TODO comment [ci skip] 2016-08-02 12:05:05 +02:00
Ahmad Sherif 0720b9ce00 Catch what warden might throw when profiling requests to re-throw it
Closes #20488
2016-08-01 22:10:04 +02:00
Douwe Maan 0819461e84 Merge branch 'fix/request-profiler-middleware-error-on-reload' into 'master'
Fix RequestProfiler::Middleware error when code is reloaded in development

## What does this MR do?
It explicitly requires `Gitlab::RequestProfiler::Middleware` before inserting it in the stack instead of autoloading it.

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

## Why was this MR needed?
It fixes #20452

## What are the relevant issue numbers?
#20452 

## Screenshots (if relevant)
N/A

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- [ ] ~~API support added~~
- ~~Tests~~
  - [ ] ~~Added for this feature/bug~~
  - [ ] ~~All builds are passing~~
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5593
2016-08-01 20:05:10 +00:00
Rémy Coutable ab3dd9a106 Merge branch 'fix/importing-io-timing-issue' into 'master'
Fix timing problems running imports on production

Fixes https://gitlab.com/gitlab-com/infrastructure/issues/151

I've found out that in staging, the imported file is not copied fully by the time sidekiq runs the job, this should hopefully fix it. (Tested against staging).

See merge request !5523
2016-08-01 13:18:39 +00:00
Ahmad Sherif 2e06800bfd Fix RequestProfiler::Middleware error when code is reloaded in development
Closes #20452
2016-08-01 14:26:11 +02:00
Paco Guzman 2dcfaa1983 Gitlab::Metrics.current_transaction needs to be public for RailsQueueDuration 2016-08-01 14:13:04 +02:00
James Lopez 81495528f9 refactored wait_for_archived_file method 2016-08-01 11:07:06 +02:00
James Lopez aad0ae7162 squashed - fixed label and milestone association problems, updated specs and refactored reader class a bit 2016-08-01 09:57:40 +02:00
James Lopez dad1d0b864 fix return value and spec 2016-08-01 09:15:11 +02:00
James Lopez 52bb564812 squashed - fix timing issues in prod importing projects
added changelog

fix specs

refactored code based on feedback

fix rubocop warning
2016-08-01 09:15:11 +02:00
Douwe Maan 6ad514d066 Merge branch 'fix/import-project-hooks' into 'master'
fix repo hooks missing on import

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

Repo hooks are missing from imported projects

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5549
2016-07-29 17:00:13 +00:00
Robert Speicher 34c083a184 Merge branch 'rubocop/enable-access-modifiers-cops' into 'master'
Enable Rubocop cops that check access modifiers

## What does this MR do?

This MR enables Rubocop cops that detect methods that should be restricted but are the part of public API because of access modifiers used improperly.

This also fixes existing offenses.

## Why was this MR needed?

Some method in our codebase are public instead of being private because it is sometimes difficult to get it right without static analysis.

## What are the relevant issue numbers?

See #17478  
Closes #17372 

See merge request !5014
2016-07-29 15:58:09 +00:00
Rémy Coutable 4284724de4 Merge branch 'refactor/ci-config-move-job-entries' into 'master'
Move CI job config entries from legacy to new config

## What does this MR do?

This MR extracts jobs configuration logic from legacy CI config processor to the new code.

## What are the relevant issue numbers?

#15060

## Does this MR meet the acceptance criteria?

- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)

See merge request !5087
2016-07-29 13:53:35 +00:00
Grzegorz Bizon a42cce1b96 Improve code, remove unused validator, improve names 2016-07-29 14:09:35 +02:00
Timothy Andrew 828f6eb6e5 Enforce "No One Can Push" during git operations.
1. The crux of this change is in `UserAccess`, which looks through all
   the access levels, asking each if the user has access to push/merge
   for the current project.

2. Update the `protected_branches` factory to create access levels as
   necessary.

3. Fix and augment `user_access` and `git_access` specs.
2016-07-29 15:20:39 +05:30
Douwe Maan 4a2320a7b0 Merge branch 'new-issue-by-email' into 'master'
Implement #3243 New Issue by email

So we extend Gitlab::Email::Receiver for this new behaviour,
however we might want to split it into another class for better
testing it.

Another issue is that, currently it's using this to parse project
identifier:

    Gitlab::IncomingEmail.key_from_address

Which is using:

    Gitlab.config.incoming_email.address

for the receiver name. This is probably `reply` because it's used
for replying to a specific issue. We might want to introduce another
config for this, or just use `reply` instead of `incoming`.

I'll prefer to introduce a new config for this, or just change
`reply` to `incoming` because it would make sense for replying to
there, too.

The email template used in tests were copied and modified from:
`emails/valid_reply.eml` which I hope is ok.

/cc @DouweM #3243

See merge request !3363
2016-07-28 16:46:23 +00:00
James Lopez 32d8aa6d5e fix repo hooks missing on import
fix spec and added changelog
2016-07-28 17:41:17 +02:00
Yorick Peterse 905f8d763a
Reduce instrumentation overhead
This reduces the overhead of the method instrumentation code primarily
by reducing the number of method calls. There are also some other small
optimisations such as not casting timing values to Floats (there's no
particular need for this), using Symbols for method call metric names,
and reducing the number of Hash lookups for instrumented methods.

The exact impact depends on the code being executed. For example, for a
method that's only called once the difference won't be very noticeable.
However, for methods that are called many times the difference can be
more significant.

For example, the loading time of a large commit
(nrclark/dummy_project@81ebdea5df)
was reduced from around 19 seconds to around 15 seconds using these
changes.
2016-07-28 16:56:17 +02:00
Lin Jen-Shin 9370bb231b Merge remote-tracking branch 'upstream/master' into new-issue-by-email
* upstream/master: (45 commits)
  Replace reject_blocked with reject_blocked! in callbacks.
  Fix Project#to_param to keep invalid project suitable for use in URLs
  Update CHANGELOG
  Add feature specs for edit project settings
  Fix renaming repository when name contains invalid chars under settings
  Change requests_profiles resource constraint to catch virtually any file
  Allow skipping users in autocomplete
  Fix typo in CHANGELOG
  Update CHANGELOG
  Respective cache is now expired when creating a new branch
  Update CHANGELOG
  Unify HTML format in static error pages
  Make error pages responsive design
  Move color-logic into HipchatService#HipchatService
  Depened on exact version of SimpleCov when patched
  Refactor spam validation to a concern that can be easily reused and improve legibility in `SpamCheckService`
  Refactor `SpamCheckService` to make it cleaner and clearer.
  Submit all issues on public projects to Akismet if enabled.
  Submit new issues created via the WebUI by non project members to Akismet for spam check.
  Upgrade Bullet from 5.0.0 to 5.2.0.
  ...
2016-07-28 14:08:45 +08:00
Douwe Maan f6063baed4 Merge branch 'akismet-ui-check' into 'master'
Submit new issues created via the WebUI or API to Akismet for spam check on public projects.

## What does this MR do?

Submit new issues created via the WebUI by non project members to Akismet for spam check.

## Why was this MR needed?

Support for Akismet was added only to the API with !2266. This MR builds on that functionality to also check issues submitted via the WebUI for spam.

## What are the relevant issue numbers?

Related to:

- #5573 
- #5932 
- gitlab-com/infrastructure#14
- gitlab-com/support#61
- !2266

cc @stanhu @MrChrisW 

See merge request !5333
2016-07-27 19:36:43 +00:00
Lin Jen-Shin a1f08a76b5 Merge remote-tracking branch 'upstream/master' into new-issue-by-email
* upstream/master: (38 commits)
  Remove useless new route
  Update gitlab-shell version to 3.2.1 in the 8.9->8.10 update guide
  Fix typo in Elixir CI template
  Add a spec for access_for_user_ids
  Fix typo in comment
  Rubocop offenses
  Optimize the invited group link access level check
  Incorporate review comments
  Optimize maximum user access level lookup in loading of notes
  Fix missing schema update for 20160722221922
  Whitelist 'Simplified BSD' license
  Fix a bug where forking a project from a repository storage to another would fail
  Remove inline scripts from import pages.
  Make branches sortable without push permission (!5462)
  Profile requests when a header is passed
  Upgrade database_cleaner from 1.4.1 to 1.5.3.
  Show release notes in tag list
  Fix expand all diffs button in compare view
  Add route for Import::GithubController#new
  Update CHANGELOG
  ...
2016-07-27 18:11:50 +08:00
Patricio Cano f01fce7f46 Refactor spam validation to a concern that can be easily reused and improve legibility in `SpamCheckService` 2016-07-26 19:29:16 -05:00
Stan Hu d1ea2bca61 Optimize maximum user access level lookup in loading of notes
NotesHelper#note_editable? and ProjectTeam#human_max_access currently
take about 16% of the load time of an issue page. This MR preloads
the maximum access level of users for all notes in issues and merge
requests with several queries instead of one per user and caches
the result in RequestStore.
2016-07-26 15:33:05 -07:00
Douwe Maan 95efb6f116 Merge branch 'feature/profile-requests-conditionally' into 'master'
Return request profiling info when a header is passed

## What does this MR do?
It allows returning profiling info (instead of actual content) when a certain header is passed

## Why was this MR needed?
To facilitate having a performance overview of certain requests.

## What are the relevant issue numbers?
https://gitlab.com/gitlab-com/infrastructure/issues/211

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- [ ] ~~API support added~~
- ~~Tests~~
  - [ ] ~~Added for this feature/bug~~
  - [ ] ~~All builds are passing~~
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5281
2016-07-26 22:07:15 +00:00
Alejandro Rodríguez 1dcfb1d3a7 Fix a bug where forking a project from a repository storage to another would fail 2016-07-26 17:22:13 -04:00
Patricio Cano f7807c5b68 Submit all issues on public projects to Akismet if enabled. 2016-07-26 15:17:52 -05:00
Patricio Cano 9c34fafb8b Submit new issues created via the WebUI by non project members to Akismet for spam check. 2016-07-26 15:17:41 -05:00
Ahmad Sherif 345cd22f21 Profile requests when a header is passed 2016-07-26 20:06:09 +02:00
Lin Jen-Shin b04f95a2ed Merge remote-tracking branch 'upstream/master' into new-issue-by-email
* upstream/master: (620 commits)
  Added '*.js.es6 gitlab-language=javascript' to .gitattributes
  Fix CI status icon link underline
  Update CHANGELOG after 8.10.1
  Add CHANGELOG
  Add es6 gem
  Instrument Nokogiri parsing methods
  Fix backup restore
  Use project ID in repository cache to prevent stale data from persisting across projects
  Add iid to MR API response
  `WikiPage` should have a slug even when not persisted.
  ES6ify all the things!
  Make fork counter always clickable (!5463)
  Revert "Merge branch '17073-tagscontroller-index-is-terrible-response-time-goes-up-to-5-…"
  Fix CHANGELOG
  Add spec for dashes in paths
  Fix Error 500 when creating Wiki pages with hyphens or spaces
  Add links to the real markdown.md file for all GFM examples
  Remove magic comments from Ruby files (!5456)
  Ignore invalid trusted proxies in X-Forwarded-For header
  remove search_id for label dropdown filter
  ...
2016-07-26 14:51:52 +08:00
Stan Hu f4aac77389 Add support for using RequestStore within Sidekiq tasks via SIDEKIQ_REQUEST_STORE env variable
This significantly reduces the DB churn in the PostReceive task when it
performs reference extraction.

See #18663
2016-07-25 17:59:09 -07:00
Katarzyna Kobierska ab419b08ce If version file is unavailable unknown status 2016-07-23 06:56:32 +02:00
Katarzyna Kobierska 10d9df28ec Add gitlab-workhorse version to admin dashboard
Test for showing GitLab Workhorse version on Admin Dashboard

Refactoring
2016-07-23 06:56:32 +02:00
Grzegorz Bizon 69dad9677c Merge branch 'master' into refactor/ci-config-move-job-entries
* master: (183 commits)
  Add a spec for #20079.
  Skip repository storage path valitaions on test environment
  Use Pathname to make the repository storage path validations more robust
  Update to gitlab_git 10.4.1 and take advantage of preserved Ref objects
  Change nav link snippet controller
  Reduce min width of pipeline table
  Retrieve rendered HTML from cache in one request
  Explain CI_PROJECT_NAMESPACE better
  Bump vmstat version to fix issues reporting on FreeBSD
  Fix sha icon positioning on safari
  Don't drop in DropAndReaddHasExternalWikiInProjects
  Mobile view for commit status
  Fix ci icons getting cut off
  Update CHANGELOG
  Extract helper methods to clean up RepositoryArchiveCleanUpService spec
  Use Dir.mktmpdir instead of FileUtils.mkdir_p in the spec
  Fix firefox rendering of SVGs
  Fix icons on commits page and builds page
  Add new fork SVG to fix weird styling of other SVGs
  Bug fixes
  ...
2016-07-22 10:37:35 +02:00
Robert Speicher 8929255129 Merge branch 'discussion-model' into 'master'
Add Discussion model to represent MR/diff discussion

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/10325.

See merge request !5376
2016-07-21 17:56:23 +00:00
Douwe Maan 79214be727 Add Discussion model to represent MR/diff discussion 2016-07-20 16:18:18 -06:00
Robert Speicher 22c8e21bf4 Merge branch 'email-domain-blacklist' into 'master'
Added the ability to block sign ups using a domain blacklist.

As part of this MR, I restructured the Application Settings form to separate **Sign up** related settings from **Sign in** related settings and make everything cleaner and easier to read.

Fixes #19749 

Related to #5573

See merge request !5259
2016-07-20 20:26:00 +00:00
Robert Speicher cf6de7dae9 Merge branch 'migration-downtime-tags' into 'master'
Added checks for migration downtime

This adds a set of checks that check/list which migrations require downtime (or not). It also comes with a CI task that fails should a migration not be tagged properly.

Fixes #14545

See merge request !4911
2016-07-20 17:03:04 +00:00
Grzegorz Bizon dff10976da Move job dependencies entry to the new CI config 2016-07-20 14:15:18 +02:00