Commit Graph

1292 Commits

Author SHA1 Message Date
James Lopez 37fbb15a29 refactored some stuff and added new models / attributes after rebase 2016-09-09 14:56:10 +02:00
James Lopez 0f15e971fc more spec refactoring based on feedback 2016-09-09 14:56:10 +02:00
James Lopez 1631ceff19 fix attributes missing in spec after rebase with master 2016-09-09 14:56:10 +02:00
James Lopez e2827250c3 remove extra line 2016-09-09 14:56:10 +02:00
James Lopez 668ebfcaae fix wording 2016-09-09 14:56:10 +02:00
James Lopez 621b4eaf22 fixing a couple of bugs and lots of refactoring of the export file spec 2016-09-09 14:56:10 +02:00
James Lopez 13a977475a add model configuration spec to check for new models. Also refactored attribute_configuration spec 2016-09-09 14:56:10 +02:00
James Lopez 8ca963bd96 more refactoring of the specs 2016-09-09 14:56:10 +02:00
James Lopez 7323d30f44 refactored specs based on feedback 2016-09-09 14:56:10 +02:00
James Lopez c71ed62910 fixed failing spec 2016-09-09 14:56:10 +02:00
James Lopez ad14944be7 fix specs so they work in EE straight away 2016-09-09 14:56:10 +02:00
James Lopez ff1d6477da Export integration test and attribute change spec - squashed
Export file integration test that checks for sensitive info.
Also added spec to check new added attributes to models that
can be exported.
2016-09-09 14:56:10 +02:00
Jacob Vosmaer (GitLab) b7e6da5a4b Merge branch 'gitlab-workhorse-safeties' into 'master'
Security and safety improvements for gitlab-workhorse integration

Companion to https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/60

- Use a custom content type when sending data to gitlab-workhorse
- Verify (using JWT and a shared secret on disk) that internal API requests came from gitlab-workhorse

This will allow us to build features in gitlab-workhorse that require
more trust, and protect us against programming mistakes in the future.

This is designed so that no action is required for installations from
source. For omnibus-gitlab we need to add code that manages the shared
secret.

See merge request !5907
2016-09-09 11:33:08 +00:00
Rémy Coutable eb2d20665f Merge branch 'smart-pipeline-duration' into 'master'
Smartly calculate real running time and pending time

## What does this MR do?

Try to smartly calculate the running time and pending time for pipelines, instead of just use wall clock time from start to end. The algorithm is based on:

> Suppose we have A, B, and C jobs:

> * A: from 1 to 3
> * B: from 2 to 4
> * C: from 6 to 7

> The processing time should be accumulated from 1 to 4, and 6 to 7, totally 4, excluding retires, and calculate on `%w[success failed running canceled]` jobs (if a job is not finished yet, assume it's `Time.now`)

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

I would actually like to test `Gitlab::Ci::PipelineDuration#process_segments`, but it's a private method right now and it's not very convenient to test it. Is there a way to test it without changing the original code too much? Note that I would like to avoid saving merged segments because it's not used and should be garbage collected.

## Screenshots:

![Screen_Shot_2016-09-05_at_6.45.32_PM](/uploads/a82bfaf316661091e383b743a2f11334/Screen_Shot_2016-09-05_at_6.45.32_PM.png)

## 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)
- Tests
  - [x] Added for this feature/bug

## What are the relevant issue numbers?

Closes #18260, #19804

See merge request !6084
2016-09-08 17:38:20 +00:00
Dmitriy Zaporozhets 535ce11829 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2016-09-08 16:59:06 +03:00
Andrew Smith 4a788f8a0c
Only add the original author if there isn't a linked GitLab account 2016-09-08 20:48:35 +10:00
Rémy Coutable 4ce348c7f9 Merge branch 'refactor/ci-config-add-logical-validation' into 'master'
Pass dependencies to CI configuration nodes

## What does this MR do?

This MR makes it possible to pass dependencies to CI configuration nodes.

## What are the relevant issue numbers?

See #15060

## Does this MR meet the acceptance criteria?

- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing

See merge request !6009
2016-09-07 16:14:37 +00:00
Sean McGivern 24424d932f Fix merge conflict size limit 2016-09-07 16:00:26 +01:00
Jacob Vosmaer 8e97323d49 Constants in specs 2016-09-06 17:26:16 +02:00
Lin Jen-Shin 7351c269de Sort by database, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14991226
and
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14994233
2016-09-06 19:36:07 +08:00
Lin Jen-Shin 3a68c98973 Just use module because there's nothing to save, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14992064
2016-09-06 19:14:28 +08:00
Valery Sizov 03bed0fbd3 Clean up search result classes 2016-09-06 10:12:55 +03:00
James Lopez 3111d6a9cc Fixed gitlab.com importer missing confidential attribute 2016-09-05 17:41:48 +02:00
Jacob Vosmaer c87540ed46 Verify JWT messages from gitlab-workhorse 2016-09-05 15:05:31 +02:00
Grzegorz Bizon 2436631dea Merge branch 'master' into refactor/ci-config-add-logical-validation
* master: (414 commits)
  Remove suggested colors hover underline
  Fix markdown anchor icon interaction
  Fix expiration date picker after update
  Refactored code to rely less on IDs that could change
  Move CHANGELOG entry for !5858 from 8.11 to 8.12
  Hides merge request section in edit project when disabled
  Fix a typo
  Change minimum Unicorns required to two
  Update memory requirements
  Added `.term-bold` declaration.
  Change the inline code to codeblocks for the new features doc guideline
  Fix GitLab import button
  Rename behaviour to behavior in bug issue template for consistency
  Convert datetime coffeescript spec to ES6
  Align add button on repository view
  Update CHANGELOG with 8.11.4 entries.
  removed null return - renamed 'placeTop' to 'placeProfileAvatarsToTop'
  Refactor Ci::Build#raw_trace
  Move CHANGELOG entry to a proper version
  Change widths of content in MR pipeline tab
  ...

Conflicts:
	lib/gitlab/ci/config/node/jobs.rb
2016-09-03 09:35:21 +02:00
Grzegorz Bizon b3cd41b401 Use double instead of spy in job config node specs 2016-09-03 09:31:02 +02:00
Lin Jen-Shin 245103e888 Merge remote-tracking branch 'upstream/master' into smart-pipeline-duration
* upstream/master: (289 commits)
  Fix a typo
  Change minimum Unicorns required to two
  Update memory requirements
  Change the inline code to codeblocks for the new features doc guideline
  Update CHANGELOG with 8.11.4 entries.
  removed null return - renamed 'placeTop' to 'placeProfileAvatarsToTop'
  Change widths of content in MR pipeline tab
  Add curve to generic commit status pipeline
  Rubocop syntax 2.3
  Some minor updates for upgrade guides for 8.12.
  Remove inconsistent font weight for sidebar's labels
  Replace play icon font with svg
  Project tools visibility level
  Added todo filter tests
  Fixed project filtering
  Review changes, simplified dropdown init
  Removed select2 from todos feature spec
  Removed inline JS and improved dropdown labels
  Added type and action dropdowns, need to finalize by removing all inline and polishing off the selected dropdown states
  Completed project filter dropdown, still need to move it from inline to ProjectSelect.js (or different)
  ...
2016-09-02 19:33:19 +08:00
Lin Jen-Shin 39c090fecb Calculate real queueing time to exclude gaps from:
retries and probably also manual actions!

Feedback:

* https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14735478
* https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14737804
2016-09-02 19:15:42 +08:00
Jacob Vosmaer a93a610bac Use 'git update-ref' for safer web commits 2016-09-02 11:49:40 +02:00
Douwe Maan d308a3f433 Merge branch 'issue_19734' into 'master'
Project tools visibility level

## part of #19734   

![project_features_access_level](/uploads/81ec7185d4e61d7578652020209af925/project_features_access_level.png)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support 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 !5606
2016-09-01 15:28:14 +00:00
Felipe Artur 892dea6771 Project tools visibility level 2016-09-01 11:47:59 -03:00
Douglas Barbosa Alexandre 9b376e772e GitHub importer use default project visibility for non-private projects 2016-08-31 18:27:42 -03:00
Douglas Barbosa Alexandre 52daddc0b7 Use updated_at as the last updated date when importing from GitHub 2016-08-31 13:20:28 -03:00
Lin Jen-Shin 7dcc244607 It's renamed to periods 2016-08-31 00:49:10 +08:00
Lin Jen-Shin 4789adc565 Add test cases from:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14709761
2016-08-30 23:12:55 +08:00
Lin Jen-Shin 1f6efa352c Rename to periods since it's easier to understand 2016-08-30 23:06:29 +08:00
Lin Jen-Shin ace0a005b8 Smartly calculate real running time and pending time 2016-08-29 20:24:48 +08:00
Grzegorz Bizon 1255205d89 Add method that returns commands for ci job entry 2016-08-29 13:11:35 +02:00
Grzegorz Bizon 62f704c5ad Make it possible to inherit global ci config nodes 2016-08-29 13:10:20 +02:00
Grzegorz Bizon 2991f93f2f Rename CI config hidden job entry to hidden entry 2016-08-29 09:30:48 +02:00
Grzegorz Bizon b125006517 Do not enforce using a hash with hidden ci key 2016-08-29 09:20:53 +02:00
Robert Speicher 75ed0e27d9 Merge branch '21247-mergerequestscontroller-conflicts-may-fail-with-iso-8859-data' into 'master'
Handle non-UTF-8 conflicts gracefully

## What does this MR do?

If a conflict file isn't in a UTF-8-compatible encoding, we can't resolve it in the UI.

## What are the relevant issue numbers?

Closes #21247. 

See merge request !5961
2016-08-25 19:08:38 +00:00
Douwe Maan 4c17e1b3db Merge branch 'zj-remove-gitorious' into 'master'
Remove gitorious

## What does this MR do?

Remove gitorious as import source

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

Did I remove everything?

## Why was this MR needed?

This button yielded a 404

## What are the relevant issue numbers?

Closes #17062 

/cc @JobV 

See merge request !5866
2016-08-25 18:02:39 +00:00
Paco Guzman a5079f68e6 Adds response mime type to transaction metric action when it's not HTML 2016-08-25 16:33:41 +02:00
Grzegorz Bizon 30f58cf392 Add [] method for accessing ci entry dependencies 2016-08-25 14:31:06 +02:00
Grzegorz Bizon 4f837f6690 Remove temporary stub method from ci config nodes 2016-08-25 13:58:46 +02:00
Grzegorz Bizon 700078e8e4 Rename unspecified and undefined CI config nodes 2016-08-25 11:37:45 +02:00
Z.J. van de Weg 4c8e9a8d27 Remove gitorious 2016-08-25 10:10:10 +01:00
Sean McGivern 44eb3197a9 Handle non-UTF-8 conflicts gracefully
These can't be resolved in the UI because if they aren't in a UTF-8
compatible encoding, they can't be rendered as JSON. Even if they could,
we would be implicitly changing the file encoding anyway, which seems
like a bad idea.
2016-08-25 08:27:08 +01:00
Douglas Barbosa Alexandre 2986de7c8c Add readable error message when remote data could not be fully imported 2016-08-24 12:17:13 -03:00
Douglas Barbosa Alexandre 3c09000e18 Does not halt the GitHub import process when an error occurs 2016-08-24 12:16:42 -03:00
Yorick Peterse 94cfd4adb2 Merge branch 'metrics-typo' into 'master'
Fix typo in gitlab-workhorse header

See merge request !5891
2016-08-22 13:15:15 +00:00
Douwe Maan 97dddf39cd Disable “issue by email” feature until it uses a different token 2016-08-19 19:49:12 -05:00
Douwe Maan cd10271667 Merge branch '20895-inline-comments-for-first-commit' into 'master'
Fix line commenting for the initial commit

## What does this MR do?

Support line positions on the initial commit, where we can't compare because there's no parent commit.

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

I chose to use the blank SHA to represent the initial commit, but it could as easily be the same SHA. I just thought this was clearer.

## Why was this MR needed?

People couldn't add line comments to the initial commit!

## What are the relevant issue numbers?

Closes #20895.

## Screenshots (if relevant)

![Comment_on_initial_commit](/uploads/1164448462ff55d133f3ff51c98044df/Comment_on_initial_commit.gif)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added (N/A, regression)
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) (N/A)
- [x] API support added (N/A)
- 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 !5900
2016-08-19 16:40:45 +00:00
Sean McGivern 4a4c1765be Fix line commenting for the initial commit
The initial commit doesn't have a parent, so explicitly pass the blank
SHA and handle that when calculating the position.
2016-08-19 16:35:44 +01:00
Douwe Maan d2f4c3ca5d Merge branch 'fix/improve-test-coverage-badge-pipelines' into 'master'
Render coverage badge using latest successful pipeline

## What does this MR do?

This MR make test coverage badge to report value for the latest successful pipeline, instead of the latest one, regardless the status.

Latest pipeline is often running, which makes coverage report inaccurate. Latest pipeline can be also the failed one, which may mean that not all stages got processed, therefore coverage report can be inaccurate as well.

This also improves coverage badge performance because it is not necessary to touch repository to get recent SHA on the branch.

## Why was this MR needed?

See #21013

## What are the relevant issue numbers?

Closes #21013

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- 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 !5862
2016-08-19 15:22:54 +00:00
Jacob Vosmaer 2bd0ed4a5c Fix typo in gitlab-workhorse header 2016-08-19 12:25:52 +02:00
Robert Speicher 717366d28d Merge branch '4273-slash-commands' into 'master'
Support slash commands in issues / MR description & comments

See merge request !5021
2016-08-18 16:41:16 -05:00
Douwe Maan 2703330a19 Fix behavior around commands with optional arguments 2016-08-18 14:29:49 -05:00
Douwe Maan 9aa3edc615 Remove unneeded aliases 2016-08-18 14:29:48 -05:00
Grzegorz Bizon 42496ecef7 Render coverage badge for latest successful pipeline 2016-08-18 16:30:43 +02:00
Douwe Maan 8b8a4626c6 Fix specs and implement fixes based on failing specs 2016-08-17 17:54:24 -05:00
Douwe Maan 20d46393a2 Merge branch 'custom-events-tracking' into 'master'
Tracking of custom events

## What does this MR do?

This MR adds the ability to track custom events such as the number of Git pushes.

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

The usual stuff.

## Why was this MR needed?

We want to track more business level data such as the number of Git pushes, how many repositories are imported (and from where), etc.

## What are the relevant issue numbers?

gitlab-org/gitlab-ce#13720

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] ~~API support 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)

cc @pcarranza 

See merge request !5830
2016-08-17 17:30:45 +00:00
Sean McGivern e6f3461c0b Merge remote-tracking branch 'origin/master' into mc-ui 2016-08-17 16:55:28 +01:00
Yorick Peterse fa0624fc64
Better formatting for downtime check messages
This removes excessive whitespace from the messages (e.g. leading
whitespace) and ensures the message is more clearly visible.
2016-08-17 12:15:20 +02:00
Yorick Peterse 88a0c984fc
Fixed downtime check label colouring
The colours were incorrect: offline was green and online was red,
instead of the opposite.
2016-08-17 11:50:30 +02:00
Yorick Peterse d345591fc8
Tracking of custom events
GitLab Performance Monitoring is now able to track custom events not
directly related to application performance. These events include the
number of tags pushed, repositories created, builds registered, etc.

The use of these events is to get a better overview of how a GitLab
instance is used and how that may affect performance. For example, a
large number of Git pushes may have a negative impact on the underlying
storage engine.

Events are stored in the "events" measurement and are not prefixed with
"rails_" or "sidekiq_", this makes it easier to query events with the
same name triggered from different parts of the application. All events
being stored in the same measurement also makes it easier to downsample
data.

Currently the following events are tracked:

* Creating repositories
* Removing repositories
* Changing the default branch of a repository
* Pushing a new tag
* Removing an existing tag
* Pushing a commit (along with the branch being pushed to)
* Pushing a new branch
* Removing an existing branch
* Importing a repository (along with the URL we're importing)
* Forking a repository (along with the source/target path)
* CI builds registered (and when no build could be found)
* CI builds being updated
* Rails and Sidekiq exceptions

Fixes gitlab-org/gitlab-ce#13720
2016-08-17 10:04:04 +02:00
Douwe Maan e07c27fee4 Merge branch 'master' into 4273-slash-commands
# Conflicts:
#	app/services/issues/create_service.rb
2016-08-16 17:49:53 -05:00
Douwe Maan 029b7d2e92 Fixed specs and fixes based on failing specs 2016-08-16 17:42:34 -05:00
Kamil Trzcinski 45953a4c59 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into pipeline-hooks-without-slack 2016-08-16 21:17:15 +01:00
Felipe Artur 2872672945 Load issues and merge requests templates from repository 2016-08-16 15:50:17 -03:00
Ruben Davila 7f853e2245 Merge remote-tracking branch 'dev/master' 2016-08-16 12:24:03 -05:00
Robert Speicher 7fef2f7b75 Merge branch 'akismet-submittable' into 'master'
Submit to Akismet Part 1 (Issues)

Related to #5932 #5573 gitlab-com/infrastructure#14

See merge request !5538
2016-08-15 22:59:47 +00:00
Douwe Maan 1ba2ef4fda Merge branch 'master' into mc-ui 2016-08-15 17:20:56 -05:00
Kamil Trzcinski 8de2f5b103 Merge branch 'fix-failing-tests' into pipeline-hooks-without-slack 2016-08-15 23:29:07 +02:00
Douwe Maan 9ef8de2fb7 Merge branch 'fix/export-att-inclusion' into 'master'
Fix attribute inclusion import/export config ignored in some cases

In the `import_export.yml` file we define the inclusion of some of the attributes. For some reason, this isn't working in certain cases - very unfortunate this includes `user`. This has been introduced in 8.10.3.

Related https://gitlab.com/gitlab-org/gitlab-ce/issues/20802

See merge request !1982
2016-08-15 19:55:02 +00:00
Kamil Trzcinski d626c1d372 Merge remote-tracking branch 'origin/master' into pipeline-hooks-without-slack 2016-08-15 20:36:06 +02:00
Patricio Cano 43e756d4ea Refactored AkismetHelper into AkismetService and cleaned up `Spammable`
- Refactored SpamCheckService into SpamService
2016-08-15 13:18:15 -05:00
Patricio Cano 64ab2b3d9f Refactored spam related code even further
- Removed unnecessary column from `SpamLog`
- Moved creation of SpamLogs out of its own service and into SpamCheckService
- Simplified code in SpamCheckService.
- Moved move spam related code into Spammable concern
2016-08-15 13:18:15 -05:00
Grzegorz Bizon b13e1d795a Add small corrections to test coverage report badge 2016-08-15 14:39:46 +02:00
Grzegorz Bizon 3e481f154f Add metadata and template methods for coverage badge 2016-08-15 14:39:46 +02:00
Grzegorz Bizon 796efcc704 Add template class for coverage report badge 2016-08-15 14:39:46 +02:00
Grzegorz Bizon cc244160c5 Extract the abstract base class of badge metadata 2016-08-15 14:39:46 +02:00
Grzegorz Bizon 7b840c8483 Add coverage report badge metadata class 2016-08-15 14:39:46 +02:00
Grzegorz Bizon cdb0caaf32 Extract common badge metadata test examples 2016-08-15 14:39:46 +02:00
Grzegorz Bizon f0ff1bfdcc Implement the main class of test coverage badge 2016-08-15 14:39:46 +02:00
Grzegorz Bizon f3de46e6b0 Refactor badge template and metadata classes 2016-08-15 14:39:46 +02:00
Grzegorz Bizon 9f0b46c05a Move badges to separate modules and add base class 2016-08-15 14:39:46 +02:00
Grzegorz Bizon 6f0b5800a9 Add empty test coverage badge class and specs 2016-08-15 14:39:46 +02:00
Douwe Maan 5a07b760df Refactor slash command definition 2016-08-12 20:17:18 -05:00
Rémy Coutable f393f2dde0
Simplify the slash commands DSL to store action blocks instead of creating methods
Other improvements:
- Ensure slash commands autocomplete doesn't break when noteable_type is not given
- Slash commands: improve autocomplete behavior and /due command
- We don't display slash commands for note edit forms.
- Add tests for reply by email with slash commands
- Be sure to execute slash commands after the note creation in Notes::CreateService

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:36:47 +02:00
Alejandro Rodríguez 2f06027dc3 Change the order of the access rules to check simpler first, and add specs 2016-08-12 18:27:42 -04:00
Rémy Coutable aadc5062eb New TodoService#todo_exists? method
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable 42e30a5012 Accept blocks for `.desc` and `.condition` slash commands DSL
Also, pass options as instance variables, making the DSL more
user-friendly / natural.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable 65349c2212 Make slash commands contextual
- Return only slash commands that make sense for the current noteable
- Allow slash commands decription to be dynamic

Other improvements:

- Add permission checks in slash commands definition
- Use IssuesFinder and MergeRequestsFinder
- Use next if instead of a unless block, and use splat operator instead of flatten

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable 23db644954 Add support for no-op slash commands that appear in autocomplete
The first one is /cc

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable e021604454 Don't extract slash commands inside blockcode, blockquote or HTML tags
Improve slash command descriptions, support /due tomorrow

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable 39f7f63fe9 Add the /title slash command
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:12 +02:00
Rémy Coutable 0eea8c8857 Support slash commands in noteable description and notes
Some important things to note:

- commands are removed from noteable.description / note.note
- commands are translated to params so that they are treated as normal
  params in noteable Creation services
- the logic is not in the models but in the Creation services, which is
  the right place for advanced logic that has nothing to do with what
  models should be responsible of!
- UI/JS needs to be updated to handle notes which consist of commands
  only
- the `/merge` command is not handled yet

Other improvements:

- Don't process commands in commit notes and display a flash is note is only commands
- Add autocomplete for slash commands
- Add description and params to slash command DSL methods
- Ensure replying by email with a commands-only note works
- Use :subscription_event instead of calling noteable.subscribe
- Support :todo_event in IssuableBaseService

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:05:57 +02:00
Sean McGivern 4952a24f58 Find match line headers by backtracking
This is more efficient for large files than performing a regex match on
every single line.
2016-08-12 23:24:48 +03:00
Sean McGivern ce7eb4e492 Add more tests for conflicts 2016-08-12 23:24:48 +03:00
Sean McGivern ac9229a31b Clarify Conflict::File#sections method 2016-08-12 23:24:48 +03:00
Sean McGivern 52eb523c9b Add blob_icon to conflict file JSON 2016-08-12 23:24:47 +03:00
Sean McGivern e50e88b85c Add blob_path to conflict file JSON 2016-08-12 23:24:47 +03:00
Sean McGivern 3b84cfdc74 Use same resolution format on FE and BE 2016-08-12 23:24:46 +03:00
Sean McGivern 261d47bce9 Fix specs
- Add match line header to expected result for `File#sections`.
- Lowercase CSS colours.
- Remove unused `diff_refs` keyword argument.
- Rename `parent` -> `parent_file`, to be more explicit.
- Skip an iteration when highlighting.
2016-08-12 23:24:46 +03:00
Sean McGivern 18398152fa Raise errors for large and binary files 2016-08-12 23:24:44 +03:00
Sean McGivern 7af277f683 Auto-highlight conflict when rich_text is called 2016-08-12 23:24:43 +03:00
Sean McGivern 14a4b17d1c Allow resolving conflicts in MR controller 2016-08-12 23:24:43 +03:00
Sean McGivern a1c7961217 Handle multiple merge conflict files in collection 2016-08-12 23:24:43 +03:00
Sean McGivern df2ed097b7 Add backend for merge conflicts reading 2016-08-12 23:24:43 +03:00
Kamil Trzcinski ca162699eb Merge branch 'improve-pipeline-processing' into pipeline-hooks-without-slack
# Conflicts:
#	app/models/ci/pipeline.rb
#	app/models/commit_status.rb
#	app/services/ci/create_pipeline_service.rb
#	spec/models/ci/pipeline_spec.rb
2016-08-12 12:03:30 +02:00
Lin Jen-Shin d5264e8804 Simplify the name for data builder, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5620#note_13671791
2016-08-12 16:09:29 +08:00
Lin Jen-Shin ce4a669d03 Prefer described_class, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5620#note_13810811
And other similar places.
2016-08-12 15:16:31 +08:00
Scott Le 6109daf480 api for generating new merge request
DRY code + fix rubocop

Add more test cases

Append to changelog

DRY changes list

find_url service for merge_requests

use GET for getting merge request links

remove files

rename to get_url_service

reduce loop

add test case for cross project

refactor tiny thing

update changelog
2016-08-11 23:37:00 +07:00
Kamil Trzcinski 99928aca75 Enhance a pipeline event tests to analyse number of returned builds 2016-08-11 17:23:35 +02:00
Kamil Trzcinski 0b0a53ee5e Merge remote-tracking branch 'origin/master' into pipeline-hooks-without-slack
# Conflicts:
#	app/models/ci/pipeline.rb
#	app/services/ci/create_pipeline_service.rb
#	spec/models/project_services/hipchat_service_spec.rb
2016-08-11 17:10:28 +02:00
Kamil Trzcinski 39203f1adf Pre-create all builds for Pipeline when a trigger is received
This change simplifies a Pipeline processing by introducing a special new status: created.
This status is used for all builds that are created for a pipeline.
We are then processing next stages and queueing some of the builds (created -> pending) or skipping them (created -> skipped).
This makes it possible to simplify and solve a few ordering problems with how previously builds were scheduled.
This also allows us to visualise a full pipeline (with created builds).

This also removes an after_touch used for updating a pipeline state parameters.
Right now in various places we explicitly call a reload_status! on pipeline to force it to be updated and saved.
2016-08-11 15:22:35 +02:00
James Lopez efab1677a7 Fix attribute inclusion in import/export config ignored in some cases 2016-08-11 12:49:07 +02:00
Lin Jen-Shin 0b52517049 Merge remote-tracking branch 'upstream/master' into pipeline-hooks-without-slack
* upstream/master: (233 commits)
  Fix awardable button mutuality loading spinners
  Update CHANGELOG for 8.10.5
  Clean up project destruction
  Small refactor of doc/development/README.md
  Avoid commit lookup on diff_helper
  Removed extra newline from redis_spec.rb
  Used cached value of project count to reduce DB load
  Remove duplicate link_to statements
  Mention add_column_with_default in downtime guide
  Add missing space to generic badge template
  Rename `run` task helper method to prevent conflict with StateMachine
  Add a method in Project to return a cached value of total count of projects
  spellcheck
  Add svg guidelines to ui guide
  Add Changelog entry for Grape upgrade [ci skip]
  Fix Grape tests.
  Retain old behavior
  Update Grape from 0.13.0 to 0.15.0.
  adds second batch of tests changed to active tense
  fixes part1 of files to start using active tense
  ...
2016-08-11 13:35:35 +08:00
Douwe Maan ae63f152c3 Merge branch 'feature/svg-badge-template' into 'master'
Use badge image template instead of using separate images

## What does this MR do?

Makes it possible to use template for badge instead of having multiple files.

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

We also have a deprecated badge in `controllers/ci/projects_controller.rb`.  We decided to leave it until 9.0, so we still have images in `public/ci/` until 9.0.

## Why was this MR needed?

We are going to implement build coverage badge, and we do not want to store 101 SVG images for each percentage value.

## What are the relevant issue numbers?

#3714

## Screenshots (if relevant)

![new_build_badge](/uploads/f1d4ed5e34278eb01f48994b5b0579f1/new_build_badge.png)

## Does this MR meet the acceptance criteria?

- [ ] ~~[CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added~~ (refactoring)
- [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- [ ] ~~API support 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)
- [ ] ~~[Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)~~ (refactoring)

See merge request !5520
2016-08-10 16:52:56 +00:00
Yorick Peterse 023d481258
Removed extra newline from redis_spec.rb 2016-08-10 13:05:41 +02:00
Douwe Maan c363629691 Merge branch 'gh-pull-requests' into 'master'
Check out GH pull requests locally where the source/target branch had been deleted

## What does this MR do?

Check out GitHub pull requests where source/target branches that had been deleted locally rather than temporarily restoring them on GitHub using their References API. This helps us to not get rate limited, and allow us to import cross-repository pull requests (those from forks).

## What are the relevant issue numbers?

Fixes #15528

Fixes #17766

Fixes #19310

Fixes #19439

Fixes #19998

Fixes #20153

Fixes #20552

Fixes https://gitlab.com/gitlab-com/support-forum/issues/801

#20385

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [X] ~~API support 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 !5630
2016-08-09 23:26:15 +00:00
Douwe Maan ee721e12ab Merge branch 'brodock/gitlab-ce-feature/redis-sentinel'
# Conflicts:
#	lib/gitlab/redis.rb
2016-08-09 18:22:26 -05:00
Robert Speicher d31ff28c69 Merge branch 'fix/import-mr-source' into 'master'
Fix importing with an invalid MR source project

Source project shouldn't be -1 when both source and target are the same in the original export.

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

See merge request !5679
2016-08-09 19:45:12 +00:00
Stan Hu b8130d42c2 Merge branch 'fix/improve-ci-node-validatable-to-prevent-memory-leak' into 'master'
Memoize CI config node validator to prevent leaks

## What does this MR do?

This MR memoizes CI configuration node validator, to prevent possible memory leak described in #20698.

## Why was this MR needed?

See #20698

## What are the relevant issue numbers?

Closes #20698

## Does this MR meet the acceptance criteria?

- [ ] ~~[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
  - [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 !5733
2016-08-09 16:38:06 +00:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Grzegorz Bizon 57df84d2fc Extend build badge specs to cover multiple pipelines 2016-08-09 13:33:19 +02:00
Grzegorz Bizon 57451f52cd Memoize CI config node validator to prevent leaks 2016-08-09 11:29:32 +02:00
Grzegorz Bizon d98566dcbc Merge branch 'master' into feature/svg-badge-template
* master: (52 commits)
  remove offending empty line
  Namespace EnableDeployKeyService under Projects
  Update version_sorter and use new interface for faster tag sorting
  Avoid to show the original password field when password is automatically seted
  Support pending invitation project members importing projects
  Added concern for a faster "cache_key" method
  Update templates
  "This file is managed by gitlab-ctl. Manual changes will be erased!"
  Remove legacy Ci::StaticModel we do not use anymore
  Revert "Defend against 'Host' header injection"
  Simplify feature introduction note
  Add migration-related tips to the "Merge Request Guidelines" doc
  Enable Style/SpaceAroundEqualsInParameterDefault cop
  Enable Style/EmptyLinesAroundClassBody cop
  Enable Style/EmptyLinesAroundModuleBody cop
  Ensure we are looking for the right dropdown inside the form wrapper
  Set for for labels and ID for dropdowns on create form
  Fix .panel-title style
  Refine selector for form submit button
  Fix spelling. `braches` to `branches`
  ...
2016-08-09 11:22:23 +02:00
James Lopez f8e8547980 fix MR source project assignment 2016-08-09 11:03:02 +02:00
Robert Speicher 900c67bfb9 Merge branch 'rubocop/enable-more-cops-for-empty-lines' into 'master'
Enable some Rubocop cops related to new lines

## What does this MR do?

This MR enabled two additional Rubocop cops:

Keeps track of empty lines around block bodies.  
`Style/EmptyLinesAroundBlockBody`

Keeps track of empty lines around method bodies.  
` Style/EmptyLinesAroundMethodBody`

See merge request !5637
2016-08-08 23:31:00 +00:00
Douglas Barbosa Alexandre 0a1535a9f4 Prefixes removed branches name with PR number when importing PR from GH 2016-08-08 20:24:40 -03:00
Douglas Barbosa Alexandre 167a0c7f0b Remove SHA suffix for removed branches name when importing PR from GH 2016-08-08 19:39:59 -03:00
Robert Speicher 86c081f71f Merge branch 'git-http-push-check' into 'master'
Stop 'git push' over HTTP early

Before this change we always let users push Git data over HTTP before
deciding whether to accept to push. This was different from pushing
over SSH where we terminate a 'git push' early if we already know the
user is not allowed to push.

This change let Git over HTTP follow the same behavior as Git over
SSH. We also distinguish between HTTP 404 and 403 responses when
denying Git requests, depending on whether the user is allowed to know
the project exists.


See merge request !5639
2016-08-08 19:23:31 +00:00
Rémy Coutable 59ce1af53b Merge branch 'fix/import-pending-user' into 'master'
Support pending invitation project members importing projects

Adds support for pending invitation project members on Import/Export - previously the import would fail.

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

- [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 !5683
2016-08-08 16:38:50 +00:00
James Lopez f04e9dad47 Support pending invitation project members importing projects 2016-08-08 17:25:17 +02:00
Grzegorz Bizon bc17996227 Improve builds badge specs, remove legacy methods 2016-08-08 12:38:36 +02:00
Grzegorz Bizon 8ae222092d Merge branch 'master' into feature/svg-badge-template
* master: (363 commits)
  Added changelog item for issuable form dropdowns
  Add 'run tests' docs from GDK
  Bump gitlab_git to lazy load compare commits
  Add examples to repository files API (!5465)
  Ignore URLs starting with // (!5677)
  Add failing test for #7032
  Update timeago to shorter representation
  Add missing DOWNTIME constant to the AddTimestampsToMembersAgain migration
  Added guide about migrations and downtime
  Update CHANGELOG for 8.10.4
  Add a data migration to fix some missing timestamps in the members table (again)
  Move abilities by subject class to a dedicated method
  Remove unnecessary empty line after css var
  Set consistency in list text height css
  Add description to text/plain emails
  Fix Rename `add_users_into_project` and `projects_ids`
  fix spec
  Underscore variable to camelCase
  using shared path for project import uploads and refactored gitlab remove export worker
  Structure the development documentation
  ...
2016-08-08 10:14:21 +02:00
Gabriel Mazetto ed0a7c254a Small refactor in Redis class and improved specs 2016-08-06 04:15:16 +02:00
Douwe Maan 71dec8b1b6 Merge branch '14898-protected-branches-developer-can-not-push-without-permission' into 'master'
Developer cannot push to protected branch when project is empty or he has not been granted permission to do so

This MR was created following !1979 and !1978

Closes #14898

See merge request !1980
2016-08-05 00:50:32 +00:00
Douglas Barbosa Alexandre 1e736fb527 Allow users to import cross-repository pull requests from GitHub 2016-08-04 17:16:50 -03:00
Douglas Barbosa Alexandre 51cf14b37c Does not need to disable GitHub webhooks since PRs are check out locally 2016-08-04 17:16:50 -03:00
tiagonbotelho 482d7802cc changes default_branch_protection to allow devs_can_merge protection option aswell 2016-08-04 21:15:26 +01:00
Gabriel Mazetto 6f31879508 Fixed specs for Gitlab::Redis and code for Redis Sentinel support 2016-08-04 18:55:37 +02:00
Gabriel Mazetto ef6043880e Specs for RedisConfig
Make sure :url is not present on RedisConfig.params after parsing
2016-08-04 18:55:37 +02:00
Lin Jen-Shin 984367f957 Move those builders to their own namespace, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5620#note_13540099
2016-08-04 23:44:27 +08:00
Jacob Vosmaer e55e224cd9 Fix ArgumentError in GitAccess specs 2016-08-04 15:22:34 +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
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
James Lopez f87eb25020 Fix Import/Export error checking versions 2016-08-03 13:00:34 +02:00
Grzegorz Bizon c7b31e4029 Enable some Rubocop cops related to new lines 2016-08-03 12:02:41 +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
Lin Jen-Shin 020ea32e76 Implement pipeline hooks, extracted from !5525
Closes #20115
2016-08-02 18:22:24 +08:00
tiagonbotelho edc5f4018e developer cannot push to protected branch when project is empty or he has not been granted permission to do so 2016-08-02 04:17:32 +01:00
Rémy Coutable fe25d1d5cf Fix specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-01 13:24:06 +02:00
Stan Hu 3fe18525dd Trim extra displayed carriage returns in diffs and files with CRLFs
Closes #20440
2016-08-01 13:24: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
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 a72d449190 Remove duplicate specs from `git_access_spec`
- Likely introduced during an improper conflict resolution.
2016-07-29 15:20:39 +05:30
Timothy Andrew cc1cebdcc5 Admins count as masters too.
1. In the context of protected branches.

2. Test this behaviour.
2016-07-29 15:20:39 +05:30
Timothy Andrew c647540c10 Fix all specs related to changes in !5081.
1. Remove `Project#developers_can_push_to_protected_branch?` since it
   isn't used anymore.

2. Remove `Project#developers_can_merge_to_protected_branch?` since it
   isn't used anymore.
2016-07-29 15:20:39 +05:30
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
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
Grzegorz Bizon 503c44ee2a Add badge template class to use with SVG ERB template 2016-07-28 15:30:05 +02:00
Grzegorz Bizon 0c4fa8619c Calculate build status only in build badge class 2016-07-28 14:58:53 +02:00
Grzegorz Bizon 9ae1ecf876 Extract build status badge metadata to separate class 2016-07-28 14:35:02 +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
Patricio Cano f7807c5b68 Submit all issues on public projects to Akismet if enabled. 2016-07-26 15:17:52 -05: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
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
Rémy Coutable ed19b9cc43 Merge branch '4142-show-inline-video' into 'master'
Add support for inline videos in issue, MR and notes (on issue, commit, MR, and MR diff)

## What does this MR do?

It adds support for inline videos in issue, MR and notes (on issue, commit, MR, and MR diff). Most of the work was done by @hayesr in !3508 but a few improvements were still missing.

## Why was this MR needed?

To be able to play uploaded videos in GitLab!

## What are the relevant issue numbers?

Closes #4142.

## Screenshots

### Video players

![Screen_Shot_2016-07-19_at_18.44.09](/uploads/e85e531b455a41c3e66b26b356abaafd/Screen_Shot_2016-07-19_at_18.44.09.png)

-----

![Screen_Shot_2016-07-19_at_18.44.29](/uploads/05f52a812760210d1eae86a7f8fc48bc/Screen_Shot_2016-07-19_at_18.44.29.png)

-----

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
  - [x] Test `VideoLinkFilter`
  - [x] Test in `spec/features/markdown_spec.rb`
  - [x] Improve `spec/uploaders/file_uploader_spec.rb`
  - [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 !5215
2016-07-21 07:29:38 +00:00
Douwe Maan 79214be727 Add Discussion model to represent MR/diff discussion 2016-07-20 16:18:18 -06: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 f83bccfe4f Add minor readability, style improvements in CI config 2016-07-20 14:02:09 +02:00
Yorick Peterse a8bfe20d0d
Added checks for migration downtime
These new checks can be used to check if migrations require downtime or
not (as tagged by their authors). In CI this compares the current branch
with master so migrations added by merge requests are automatically
verified.

To check the migrations added since a Git reference simply run:

    bundle exec rake gitlab:db:downtime_check[GIT_REF]
2016-07-20 12:41:56 +02:00
Sean McGivern 4f0780cc04 Ensure to_json methods take optional argument 2016-07-20 11:14:06 +01:00
Grzegorz Bizon 795c9f2241 Merge branch 'master' into refactor/ci-config-move-job-entries
* master: (321 commits)
  Fix the Sentry spam from CSP violations by disabling it.
  Limit git rev-list output count to one in forced push check
  Ensure Owners are included in the scope for authorized_projects
  Fix alignment of icons on project page
  Fix ci_status_helper_spec to look for new SVGs
  use 2.0.5, actually (2.0.4 was a bad release)
  upgrade rouge to 2.0.4
  Fix help page paths to make sure shortcuts and the UI help page work.
  fixes an issue cause by a bad merge
  Vertically align status icon within table
  Add new icons for every CI status
  Add global style for running icon
  Align running icon in merge request
  Add new running icon; add a bunch of styles to get svg to match existing fa icons
  Improve code design
  Fix broken builds_for_ref
  Move when tests before to make it no conflict with manual-actions
  Use value of `yaml_variables` and `when` from config_processor if undefined
  Add CHANGELOG entry
  CHANGELOG item
  ...

Conflicts:
	lib/ci/gitlab_ci_yaml_processor.rb
	spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
2016-07-20 10:44:01 +02:00
Rémy Coutable 356b2d2bd7 Get rid of `is_image` in FileUploader
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-19 18:51:09 +02:00
Rémy Coutable e953b8afd2 Merge branch 'allow-deploy-key-to-download-public-projects' into 'master'
Allow to pull code with deploy key from public projects

## What does this MR do?
With deploy keys you can download any public projects stored in GitLab.

## What are the relevant issue numbers?
Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/1217

## Does this MR meet the acceptance criteria?

- [ ] [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
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5316
2016-07-19 15:21:29 +00:00
Rémy Coutable 0e9323bd4a Merge branch 'fix/import-export-project-avatar' into 'master'
Project avatar import/export functionality

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

Adds logic to export and import a project avatar

- [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)~~
- 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 !5273
2016-07-19 14:32:40 +00:00
Kamil Trzcinski 41fa516bb6 Use value of `yaml_variables` and `when` from config_processor if undefined 2016-07-19 14:53:35 +02:00
James Lopez f85b78c1e9 fix spec 2016-07-19 14:31:22 +02:00
James Lopez 76771c2946 squashed - added avatar saver/restorer and specs
added spec for avatar saver

avatar saver!

added avatar restorer spec

fix spec

added avatar restorer class

fix export service

fix warnings, added changelog

fix spec

some refactoring based on feedback

fixed a few issues after testing i/e avatar
2016-07-19 13:06:06 +02:00
Kamil Trzcinski 2532ec9edc Allow to pull code with deploy key from public projects 2016-07-19 12:23:41 +02:00
James Lopez bf1ea8c6fe Squashed - fix encoding issue
WIP - trying to replicate UTF-8 error

fix spec

fixing encoding issue and another spec, to do with MR diffs

fix issue and spec failure

Add changelog and bumped up I/E version

fix spec based on feedback - omitted target project
2016-07-19 09:59:54 +02:00
Douwe Maan f0b446e555 Merge branch '19820-safer-diffs' into 'master'
Collapsed diffs lines/size don't accumulate to overflow diffs.

## What does this MR do?

Reduce the number of lines that we highlight on big diffs to try to reduce the degradation introduced by  !4990 as you can see on the issue description #19820 .

We collapse any files after the diff is over the number of safe files (100), or over the safe lines (500) or over the safe number of bytes (5KB x 100 files).

We still need to bump the gitlab_git and point this branch to the new gitlab_git version.

## What are the relevant issue numbers?

Closes #19820 
Closes #19885

## 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
  - [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 !5306
2016-07-18 21:28:24 +00:00
Paco Guzman a404ab380d Collapsed diffs lines/size don't accumulate to overflow diffs. 2016-07-18 14:43:28 -06:00
Grzegorz Bizon 6d466733a2 Validate allowed keys only in new CI config 2016-07-18 16:26:38 +02:00
Grzegorz Bizon 7cef4f1908 Improve valid keys validation for CI config nodes 2016-07-18 15:38:06 +02:00
Grzegorz Bizon 24b686ebb6 Move job artifacts configuration new CI config code 2016-07-18 15:21:53 +02:00
Grzegorz Bizon 1bf9e34713 Move except and only job nodes to new CI config 2016-07-18 12:37:42 +02:00
Rémy Coutable 2cf7f09b1e
Revert "Revert "Merge branch '18193-developers-can-merge' into 'master' ""
This reverts commit 530f5158e2.

See !4892.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-18 10:16:56 +02:00
Rémy Coutable 31a5a03c6c Merge branch 'fix-lfs-ci-fetch' into 'master'
Fix LFS CI fetch

## What does this MR do?
Fixes LFS fetching for CI objects that were kind of broken.

## Why was this MR needed?
This also refactors LFS tests to be a blackbox tests instead of whitebox tests. Actually testing GrackAuth instead of LFSRouter.

## Related isssues
Resolves: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1199

- [ ] [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
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)


See merge request !5270
2016-07-18 07:52:06 +00:00