Commit Graph

1292 Commits

Author SHA1 Message Date
Robert Speicher 0a9f9c10e4 Merge branch '22229-use-base-sha-when-downloading-merge-requests' into 'master'
Use base SHA for patches and diffs

## What does this MR do?

Switch from using 'start SHA' to 'base SHA' for patches and diffs

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

## Why was this MR needed?

Makes the downloaded patches and diffs on the merge request page match the frontend-rendered "changes" in these scenarios:

* Unpatched gitlab-workhorse, downloading patchsets of open MRs (https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/68)
* Unpatched gitlab-workhorse, downloading diffs of open and merged MRs
* Patched gitlab-workhorse, downloading patchsets of merged merge requests

## What are the relevant issue numbers?

Closes #22229

See merge request !6435
2016-09-25 10:30:37 +00:00
Nick Thomas a8829f25d3 Use base SHA for patches and diffs
This commit changes the revisions used for diffs. The current behaviour is
to show all changes between current tip of master and tip of the MR, rather
than matching the output of the web frontend (which just shows the changes
in the MR). Switching from start_sha to base_sha fixes this.
2016-09-22 18:49:31 +01:00
Jacob Vosmaer b228b86b3e Make Gitlab::Redis.params safe for mutation 2016-09-22 15:58:40 +02:00
James Lopez ad62a25e0f fix import/export security specs after merge 2016-09-21 15:47:11 -05:00
James Lopez ce48a595b0 fixing security specs after merge 2016-09-21 14:36:28 +02:00
Rémy Coutable a25ac8a89b Merge branch 'add_spec_for_committer_hash' into 'master'
Add spec covering 'committer_hash'

Adds a missing spec from changes added in !5822

See merge request !6433
2016-09-21 10:15:00 +00:00
Dmitriy Zaporozhets c2a7e7b8ac Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2016-09-21 12:22:02 +03:00
Lin Jen-Shin 637a41400c Merge remote-tracking branch 'upstream/master' into pipeline-emails
* upstream/master: (206 commits)
  Implement fourth round of comments from @DouweM.
  Fix `CreateDeploymentService` spec.
  Reload issues in spec to ensure label<->issue mapping properly loaded
  Fix build.
  Remove unnecessary #{} in cycle analytics template.
  Update cycle analytics icon and fix color of the dismiss button.
  Use triple dashes for the empty value in cycle analytics.
  Fix typo on cycle analytics copy.
  Add page title and fix sub menu width in Cycle Analytics page.
  Update Cycle Analytics Read more link URL.
  Display the cycle analytics navbar based on the `:read_cycle_analytics` ability.
  Improve indentation in `Gitlab::Database::Median`
  Add a spec for merge request metric caching while refreshing a merge request from a forked project.
  Use the `IssuableBaseService` lifecycle hooks to cache `MergeRequestsClosingIssues`
  Implement a second round of review comments from @DouweM.
  Add docs on Cycle Analytics
  Test if issue authors can access private projects
  Update .pkgr.yml with Ubuntu 16.04 dependencies
  fix issues mr counter
  Move JSON generation (cycle analytics) into a controller method.
  ...
2016-09-21 16:19:07 +08:00
Lin Jen-Shin 63e03dada7 Make various trace methods take last_lines argument:
So that we could read last few lines rather than read
the entire file which could be huge.
2016-09-21 16:12:32 +08:00
Dan Dunckel 02d69091bc Add spec covering 'committer_hash' 2016-09-20 10:15:43 -07:00
Kamil Trzcinski 0672c5a92e Post-merge improve of CI permissions 2016-09-20 15:41:41 +02:00
Rémy Coutable fb4d2f9e5a Merge branch 'feature/github-edit-path' into 'master'
Lets the user choose a namespace and name on Github imports

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

See merge request !5728
2016-09-20 12:23:14 +00:00
Douwe Maan 667d235091 Merge branch 'lfs-support-for-ssh-enabled' into 'master'
LFS support for ssh enabled

## What does this MR do?
This is follow-up after https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043 which is falsely shown as merged due to: https://gitlab.com/gitlab-org/gitlab-ce/issues/22334

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

## Why was this MR needed?

## Screenshots (if relevant)

## 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 [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] 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)

## What are the relevant issue numbers?

See merge request !6413
2016-09-20 10:10:45 +00:00
James Lopez 0c65112da7 modify github import JS and controller so we can now specify a namespace and/or name for a project.
- Fixed and added specs.
- Added different namespace options depending on user privilages
- Updated docs.
2016-09-20 10:14:39 +02:00
Robert Speicher 4722c45ea2 Merge branch 'strip-key-comments-for-gitlab-shell' into 'master'
Strip comments before sending keys to gitlab-shell

## Why was this MR needed?

https://gitlab.com/gitlab-org/gitlab-ce/issues/22167 encoding issues in comment text.

## What are the relevant issue numbers?

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

See merge request !6381
2016-09-20 05:42:03 +00:00
Douwe Maan 8799103037 Merge branch 'feature/import-export-security-specs' into 'master'
Import/Export security specs

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

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

See merge request !1987
2016-09-20 04:44:54 +00:00
Kamil Trzcinski dba227da88 Fix test failure 2016-09-19 20:22:10 +02:00
Kamil Trzcinski 3c1bb3432b Revert "Revert all changes introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043"
This reverts commit 6d43c95b70.
2016-09-19 16:34:32 +02:00
Rémy Coutable fe084819b4 Merge branch 'per-build-token-without-lfs' into 'master'
Make CI to use the permission of the user who is trigger the build

This is continuation of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5735, but with removed all LFS code that is added by: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043.

This also incorporates most of LFS code added in !6043 to simplify further merge.

See merge request !6409
2016-09-19 13:36:54 +00:00
Rémy Coutable 1e72de6690 Merge branch 'fix/import-export-db-errors' into 'master'
Fix import/export database errors

Fixes protected branches errors when importing a project including them

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

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

See merge request !6099
2016-09-19 13:02:49 +00:00
Kamil Trzcinski 6d43c95b70 Revert all changes introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043 2016-09-19 13:45:28 +02:00
Kamil Trzcinski 967eb8fb55 Merge branch 'master' into per-build-token 2016-09-19 13:31:42 +02:00
Kamil Trzcinski 748dd35c65 Fix spec failures 2016-09-19 13:29:48 +02:00
Kamil Trzcinski 08272ec151 Add validation of URL and validation of name 2016-09-19 10:07:12 +02:00
Grzegorz Bizon ba5bd3d1d6 Add new CI configuration entry for the environment 2016-09-19 10:07:12 +02:00
James Lopez e74b7d665b squashed - Fix DB exceptions raised importing some specific projects.
Better import of labels, milestones and protected branches. Updated relevant specs.
Loose pipeline validation on importing, so it does not fail when there are missing fields, which are not validated at DB level. Also, updated spec with relevant test.
2016-09-19 09:18:37 +02:00
Kamil Trzcinski b0195d5c55 Fix specs for available statuses 2016-09-16 13:47:54 +02:00
Jacob Vosmaer 67ec96e3e0 Strip comments before sending keys to gitlab-shell
Avoid issues with text encoding by not sending out non-7-bit ASCII
text.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/22167
2016-09-16 11:49:11 +02:00
Kamil Trzcinski a387ff7ba8 Fix specs after renaming authentication_capabilities 2016-09-16 11:12:22 +02:00
Kamil Trzcinski e941365f3b Rename capabilities to authentication_abilities 2016-09-16 11:12:21 +02:00
Drew Blessing 1f399fe437 fix 2016-09-15 21:59:59 -05:00
Drew Blessing e000f02bd3 Add support for column limits in add_column_with_default 2016-09-15 21:59:58 -05:00
Kamil Trzcinski 5f45ddc545 Fix specs after merging LFS changes 2016-09-15 22:23:43 +02:00
Kamil Trzcinski 83b643a014 Merge remote-tracking branch 'origin/lfs-support-for-ssh' into per-build-token
# Conflicts:
#	app/controllers/projects/git_http_client_controller.rb
#	app/helpers/lfs_helper.rb
#	lib/gitlab/auth.rb
#	spec/requests/lfs_http_spec.rb
2016-09-15 21:16:38 +02:00
Patricio Cano be09bcf074 Refactored authentication code to make it a bit clearer, added test for wrong SSH key. 2016-09-15 12:21:00 -05:00
Patricio Cano 71aff7f6a3 Use special characters for `lfs+deploy-key` to prevent a someone from creating a user with this username, and method name refactoring. 2016-09-15 12:21:00 -05:00
Patricio Cano c25630ee2c Refactored handling of the `LfsToken` and added functionality to it to simplify external code. 2016-09-15 12:21:00 -05:00
Patricio Cano 48f1a61fd5 Refactored LFS auth logic when using SSH to use its own API endpoint `/lfs_authenticate` and added tests. 2016-09-15 12:21:00 -05:00
Patricio Cano cb85cf1f0a Refactor LFS token logic to use a Redis key instead of a DB field, making it a 1 use only token. 2016-09-15 12:21:00 -05:00
Patricio Cano e40e3fdc82 Added LFS support to SSH
- Required on the GitLab Rails side is mostly authentication and API related.
2016-09-15 12:21:00 -05:00
Kamil Trzcinski 548169cfb5 Fix most of specs 2016-09-15 15:40:53 +02:00
Kamil Trzcinski 9d1ccd2ad3 Fix existing authorization specs 2016-09-15 13:49:11 +02:00
Kamil Trzcinski 50076ab974 Merge remote-tracking branch 'origin/master' into per-build-token
# Conflicts:
#	db/schema.rb
2016-09-15 13:19:53 +02:00
Kamil Trzcinski 11f87700e8 Add access specs 2016-09-15 11:57:09 +02:00
Jacob Vosmaer 11f54caada Allow trailing newline in secret base64 data 2016-09-13 19:45:02 +02:00
Andrew Smith 05b52e0f5e
Import GitHub release notes
# Conflicts:
#	lib/gitlab/github_import/importer.rb
2016-09-13 14:01:22 +10:00
Robert Speicher c87235a24d Merge branch '21569-dont-add-created-by-for-matched-users' into 'master'
Only add original author tag line when importing from GitHub if there isn't a linked GitLab account

## What does this MR do?
If there we've found a linked GitLab user for a creator of an issue or comment don't add the 'Created By:' line.

## What are the relevant issue numbers?

Closes #21569

See merge request !6081
2016-09-12 20:08:33 +00:00
Robert Speicher 0b2a34108d Merge branch 'restrict_ldap_return_attributes' into 'master'
Restrict ldap return attributes

## What does this MR do?

Fixes the CE part of #13821. We really only ever need uid, dn, cn, and mail attributes, and in some cases, even less. This merge request strips the request down to those four attributes by default, and allows the caller to specify others, if needed. 

## Why was this MR needed?

This will improve performance especially in cases where the connection is slow between GitLab and LDAP, or when the LDAP object has lots of attributes we don't care about.

See merge request !6187
2016-09-09 18:59:33 +00:00
Drew Blessing bf8a48e179 Request only the LDAP attributes we need 2016-09-09 13:14:57 -05:00
Douglas Barbosa Alexandre 02761638f1 Avoid conflict with admin labels when importing GitHub labels 2016-09-09 11:22:38 -03:00
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