Commit Graph

1292 Commits

Author SHA1 Message Date
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
Grzegorz Bizon bbda05863f Merge branch 'master' into refactor/ci-config-move-job-entries
* master: (522 commits)
  Fix CI yaml example
  Align cancel and retry buttons
  Remove deploy to production button
  Fix a bug where the project's repository path was returned instead of the wiki path
  Don't fail to highlight when Rouge doesn't have a lexer
  Revert "Merge branch 'gl-dropdown-issuable-form' into 'master'"
  Update tests
  Don't fail when Ci::Pipeline doesn't have a project
  Don't fail when a LegacyDiffNote didn't store the right diff
  Update CHANGELOG
  Use cattr_accessor instead duplicating code on NoteOnDiff concern
  Fix mentioned users list on diff notes
  Don't ask Heather to review documentation MR's
  add project name and namespace to filename on project export
  navbar_icon was renamed to custom_icon in:
  use %(...) and %[...] in favor of %<...>
  Fix spec Don't attempt to disable statement timeout on a MySQL DB
  Disable statement timeout outside of transaction and during adding concurrent index
  Disable PostgreSQL statement timeout during migrations
  Add visibility icon
  ...
2016-07-18 09:37:51 +02:00
Stan Hu 328da189d2 Fix spec to set import_url before attempting to create import_data 2016-07-17 20:57:11 -07:00
Grzegorz Bizon 17084d42aa Simplify abstract class for CI config entry nodes 2016-07-15 22:49:18 +02:00
Robert Speicher fbd75c35fd Merge branch 'feature.rouge-20' into 'master'
Upgrade to Rouge 2.0

## What does this MR do?

This MR is a refactor of the HTMLGitlab formatter. The original was copy-pasted from the legacy HTML formatter and adapted to suit our needs. In particular, this MR:

* Strips dead code and unused options
* Factors out the "wrapping" into the places that care about it - Bonzai and the view helpers
* Uses the Rouge 2.0 `token_lines` method to split tokens into lines, removing the custom code we used to do the same
* Uses the now-public `span` method instead of re-implementing it ourselves
* Removes options to not split into lines - the places where this feature wasn't being used are now using the plain `Formatters::HTML` instead of this class

See merge request !4691
2016-07-15 20:15:30 +00:00
Grzegorz Bizon 4bb60b0789 Simplify CI config and remove logical validation 2016-07-15 21:39:26 +02:00
Douwe Maan 686381f7e6 Merge branch 'fix/project-export-filename' into 'master'
add project name and namespace to filename on project export

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

 Export filename now includes project and namespace path

- [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 !5268
2016-07-15 19:21:35 +00:00
Douwe Maan 4859770e26 Merge branch 'fix/ee-to-ce-import' 2016-07-15 14:18:31 -05:00
Grzegorz Bizon 41bcbdd8c2 Add metadata to new CI config and expose job name 2016-07-15 21:07:51 +02:00
Lin Jen-Shin bd44f14197 Merge remote-tracking branch 'upstream/master' into new-issue-by-email
* upstream/master:
  navbar_icon was renamed to custom_icon in:
  Fix spec Don't attempt to disable statement timeout on a MySQL DB
  Disable statement timeout outside of transaction and during adding concurrent index
  Disable PostgreSQL statement timeout during migrations
  Add visibility icon
  Remove previously introduced CSS that will not be used anymore
  Make admin/groups view consistent with dashboard/groups
  Fix New Group button spacing on mobile
  Make CSS consistent again
  Rename .group-controls to .controls
  Remove unnecesary CSS class
  Change bg color of collapsed diff to blue on hover
  Reduce padding on collapsed diff message
  updated changelog
  fixed similar issue with gitlab.com importer because why not!
  fix updated_at not preserved after import - for GitLab projects
  Update permissons links to new page
  CHANGELOG
  Changed collapsed assignee tooltip to users name Fixes tooltip when updating the assignee
  Refresh branch cache after `git gc`
2016-07-15 23:41:58 +08:00
James Lopez 9b86006ca1 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/project-export-filename 2016-07-15 17:05:05 +02:00
Robert Speicher 8b7932c219 Merge branch 'disable-statement-timeout' into 'master'
Disable PostgreSQL statement timeout during migrations

Long-running migrations may take more than the timeout allowed by the database. Disable the session's statement timeout to ensure migrations don't get killed prematurely.

See merge request !5263
2016-07-15 14:51:20 +00:00
Kamil Trzcinski 86f39fece2 Refactor LFS specs to use requests instead of LfsRouter 2016-07-15 14:04:24 +02:00
James Lopez 65549a5866 add project name and namespace to filename on project export
added changelog
2016-07-15 12:55:28 +02:00
Lin Jen-Shin 0f7851b7be Merge remote-tracking branch 'upstream/master' into new-issue-by-email
* upstream/master: (1547 commits)
  Add margin between buttons if both retry and cancel are present
  Add margin between labels; remove underline hover style on status button
  udpated JS based on feedback
  Use default cursor for table header of project files (!5165)
  Fix duplicated entry in changelog [ci skip]
  Improves left static sidebar behaviour
  Include default callback URL (OAuth)
  Cleanup feature proposal template
  Simplify regex for string-based multi-word label surrounded in quotes
  Revert "Merge branch '18193-developers-can-merge' into 'master'
"
  Upgrade Rails from 4.2.6 to 4.2.7.
  some JS magic to fix empty URL bug
  formats my test properly
  Update CHANGELOG
  Doesn't match empty label references surrounded in quotes
  Fix markdown rendering for label references that contains `.`
  Fix markdown rendering for label references that begin with a digit
  Fix markdown rendering for consecutive label references
  Stub omniauth provider for GitLab
  Update CHANGELOG
  ...
2016-07-15 15:30:26 +08:00
Stan Hu 3fd304c1a5 Fix spec Don't attempt to disable statement timeout on a MySQL DB 2016-07-14 20:55:33 -07:00
http://jneen.net/ e9f191907c apparently this gets encoded now? 2016-07-14 10:08:15 -07:00
http://jneen.net/ ff7e679bca we no longer encode double-quotes 2016-07-14 10:08:15 -07:00
James Lopez b1ab079fae fix updated_at not preserved after import - for GitLab projects 2016-07-14 16:03:00 +02:00
Grzegorz Bizon 5923741fe6 Remove references to global entry in new CI config 2016-07-14 15:45:29 +02:00
Grzegorz Bizon 3e16b015b9 Revert logical validation in CI job stage entry 2016-07-14 15:45:07 +02:00
Grzegorz Bizon f7c80e9f31 Revert references to global node in CI job entry 2016-07-14 15:07:38 +02:00
Grzegorz Bizon 56ae9f6ba9 Improve CI job entry validations in new config 2016-07-14 13:14:09 +02:00
James Lopez 097706b458 fix EE => CE project import, and updated JSON spec 2016-07-14 12:07:54 +02:00
Robert Speicher 530f5158e2 Revert "Merge branch '18193-developers-can-merge' into 'master' "
This reverts commit 9ca633eb4c, reversing
changes made to fb229bbf79.
2016-07-13 13:57:30 -05:00
Douglas Barbosa Alexandre 6d5fd7d9b7 Stub omniauth provider for GitLab 2016-07-13 11:35:38 -03:00
Douglas Barbosa Alexandre d9564ed733 Add spec for GitLab.com importer 2016-07-13 11:35:38 -03:00
Grzegorz Bizon 036e297ca3 Expose CI job commands and use in legacy processor 2016-07-13 15:04:12 +02:00
Grzegorz Bizon 6920390aad Add before script and commands to CI job entry 2016-07-13 14:38:10 +02:00
Grzegorz Bizon de4c9a2738 Improve CI stage configuration entry validations 2016-07-13 12:22:33 +02:00
Timothy Andrew bb81f2afc1 Implement last round of review comments from !4892.
1. Fix typos, minor styling errors.

2. Use single quotes rather than double quotes in `user_access_spec`.

3. Test formatting.
2016-07-13 14:18:05 +05:30
Timothy Andrew 4d00ed21eb Appease rubocop. 2016-07-13 13:24:56 +05:30
Timothy Andrew 60245bbe22 Refactor `Gitlab::GitAccess`
1. Don't use case statements for dispatch anymore. This leads to a lot
   of duplication, and makes the logic harder to follow.

2. Remove duplicated logic.

    - For example, the `can_push_to_branch?` exists, but we also have a
      different way of checking the same condition within `change_access_check`.

    - This kind of duplication is removed, and the `can_push_to_branch?`
      method is used in both places.

3. Move checks returning true/false to `UserAccess`.

    - All public methods in `GitAccess` now return an instance of
      `GitAccessStatus`. Previously, some methods would return
      true/false as well, which was confusing.

    - It makes sense for these kinds of checks to be at the level of a
      user, so the `UserAccess` class was repurposed for this. The prior
      `UserAccess.allowed?` classmethod is converted into an instance
      method.

    - All external uses of these checks have been migrated to use the
      `UserAccess` class

4. Move the "change_access_check" into a separate class.

    - Create the `GitAccess::ChangeAccessCheck` class to run these
      checks, which are quite substantial.

    - `ChangeAccessCheck` returns an instance of `GitAccessStatus` as
      well.

5. Break out the boolean logic in `ChangeAccessCheck` into `if/else`
   chains - this seems more readable.

6. I can understand that this might look like overkill for !4892, but I
   think this is a good opportunity to clean it up.

    - http://martinfowler.com/bliki/OpportunisticRefactoring.html
2016-07-13 13:24:56 +05:30
Timothy Andrew 495db09653 Enforce "developers can merge" during `pre-receive`.
1. When a merge request is being merged, save the merge commit SHA in
   the `in_progress_merge_commit_sha` database column.

2. The `pre-receive` hook looks for any locked (in progress) merge
   request with `in_progress_merge_commit_sha` matching the `newrev` it
   is passed.

3. If it finds a matching MR, the merge is legitimate.

4. Update `git_access_spec` to test the behaviour we added here. Also
   refactored this spec a bit to make it easier to add more contexts / conditions.
2016-07-13 13:24:56 +05:30
Mathias Vestergaard f0577d8385 Added "developers can merge" setting to protected branches
- Cherry-picked from `mvestergaard:branch-protection-dev-merge`
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4220
2016-07-13 13:24:26 +05:30
Douwe Maan 5fea640e90 Merge branch 'multi-line-inline-diff' into 'master'
Render inline diffs for multiple changed lines following eachother

Before:

![Screen_Shot_2016-07-11_at_00.08.27](/uploads/b14664211e0f5cef6e77a78eadfcbcdf/Screen_Shot_2016-07-11_at_00.08.27.png)

After:

![Screen_Shot_2016-07-11_at_00.07.34](/uploads/567be631869a4867a2edf6ff7eda6369/Screen_Shot_2016-07-11_at_00.07.34.png)

See merge request !5174
2016-07-13 05:29:49 +00:00
Robert Speicher 1d958b035d Merge branch 'rs-describe-symbols' into 'master'
Avoid `describe`-ing symbols in specs

See merge request !5195
2016-07-12 20:01:29 +00:00
Robert Speicher adc6ec4a9c Avoid `describe`-ing symbols in specs 2016-07-12 10:27:58 -05:00
Douglas Barbosa Alexandre 3ddcd0d699 Remove unnecessary context from GitHub client spec 2016-07-12 12:14:17 -03:00
Douglas Barbosa Alexandre 38a58978aa Fix GItHub client requests when rate limit is disabled 2016-07-12 12:14:17 -03:00
Grzegorz Bizon b228787f5a Do not raise when getting value of invalid CI node 2016-07-12 14:58:48 +02:00
Grzegorz Bizon 06641a3fee Simplify undefined node definition in CI config 2016-07-12 14:28:50 +02:00
Grzegorz Bizon d41d330147 Add CI config node that is unspecified null entry 2016-07-12 13:03:19 +02:00
Douwe Maan f5cc3f63a8 Render inline diffs for multiple changed lines following eachother 2016-07-11 18:58:15 -05:00
James Lopez feecb4afde Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/import-event-error 2016-07-11 18:00:19 +02:00
James Lopez 0e5f0276ea squashed - refactor to cope with sub sub N relations probably using the sub_relations method recursively. 2016-07-11 17:21:22 +02:00
Rémy Coutable 11ba19e3d2 Merge branch 'fix/remove-import-url-migration' into 'master'
Remove slow migration and add fix to sanitize errors

Getting rid of the slow migration and preventing the Error to occur

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

See merge request !5176
2016-07-11 07:53:13 +00:00
James Lopez 99f7b6d246 spec and fix for sanitize method 2016-07-11 09:01:09 +02:00
Grzegorz Bizon 80587064eb Require parent when using node factory in CI config 2016-07-10 20:59:18 +02:00
Grzegorz Bizon 8f7c98ee2a Rename CI config job script entry node to commands 2016-07-10 20:26:37 +02:00
Grzegorz Bizon 500b61e14f Move after script CI job confg to new processor 2016-07-10 14:41:14 +02:00
Grzegorz Bizon 489e9be4e8 Add CI job script node in new config processor 2016-07-10 14:35:53 +02:00
Grzegorz Bizon 3c5b1da2a1 Add before_script node to CI job entry config 2016-07-10 13:54:39 +02:00
Grzegorz Bizon 2480701436 Extend CI job entries fabrication and validation 2016-07-09 18:43:26 +02:00
Grzegorz Bizon 9edced40dd Use node factory to assemble global CI config entry 2016-07-09 16:51:26 +02:00
Grzegorz Bizon ccbdb4022a Integrate CI job stage entry into CI configuration 2016-07-09 14:56:41 +02:00
Rémy Coutable 8bdb5b6aec Merge branch '1548-average-commits-per-day' into 'master'
Fix: Infinity Bug in Commit Statistics

## What does this MR do?

It fixes a logic bug in the commits statistics: The code assumed that the amount of days involved in a commit range is equal to the difference between the first and last date. This is not true, though, as (from a human standpoint), a commit yesterday and a commit today involve two days, not one. Similarly, a fresh project with only commits made today already 'used' one day.

Since the number of involved days used to be zero for new projects, the result for commits per day quite often amounted to `Infinity`…

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

The test file. I hope it is up to the standards of GitLab.

## Why was this MR needed?

The bug occurres especially for new users with their first project while exploring GitLab.

## What are the relevant issue numbers?

This bug was reported as #1548.

## Screenshots (if relevant)

See merge request !4231
2016-07-08 15:20:22 +00:00
Grzegorz Bizon d9142f2c97 Add CI config known stage validation for job stage 2016-07-08 13:31:41 +02:00
Grzegorz Bizon 1ac62de2c1 Extract CI entry node validator and improve naming 2016-07-08 12:51:47 +02:00
Grzegorz Bizon 8baee987be Extract internal attributes validator for CI entry 2016-07-08 11:27:36 +02:00
Douwe Maan bf89e06a45 Merge branch '18627-wildcard-branch-protection' into 'master'
Allow specifying protected branches using wildcards

Closes #18627 

# Tasks

- [ ]  #18627 !4665 Allow specifying protected branches using wildcards
    - [x]  Find existing usages of protected branches
        - Protecting branches
            - `ProtectedBranchesController` is used to mark a branch protected/unprotected
            - `API::Branches` can be used to mark a branch protected/unprotected
        - Enforcing branch protection
            - `Gitlab::GitAccess` has helpers (`can_push_to_branch?`, `check`) that are used to deny pushes if a branch is protected
            - Over SSH: `gitlab-shell` receives a push, and calls `/allowed` on the GitLab API, which calls `GitAccess.check`
            - Over HTTP: 
                - `gitlab-workhorse` receives the request, and forwards it to rails
                - Rails (in the `GitHttpController#git-recieve-pack`) runs basic checks (is the user logged in, not protected branch checks) and returns ok with `GL_ID` and `RepoPath`
                - `gitlab-workhorse` looks at the response, and calls the relevant `gitlab-shell` action from `git-http/handlePostRPC`
                - Rest of this flow is the same as the SSH flow above
    - [x]  Implementation
        - [x]  Backend
            - [x]  Change `project#protected_branch?` to look at wildcard protected branches
            - [x]  Change `project#developers_can_push_to_protected_branch?`
            - [x]  Change `project#open_branches`
            - [x]  Better error message when creating a disallowed branch from the Web UI
        - [x]  Frontend
            - [x]  Protected branches page should allow typing out a wildcard pattern
            - [x]  Add help text explaining the use of wildcards
            - [x]  Show matching branches for each protected branch
                - [x]  ~~On the index page~~
                - [x]  On a show page
                - [x]  Index?
            - [x]  Can't have the "last commit" column for wildcard protected branches
    - [x]  Fix / write tests
    - [x]  What happens if a hook is missing in dev?
    - [x]  Refactor
    - [x]  Test workflows
        - Create a branch matching a wildcard pattern
        - Push to a branch matching a wildcard pattern
        - Force push to a branch matching a wildcard pattern
        - Delete a branch matching a wildcard pattern
        - [x]  Test using Web UI
        - [x]  Test over SSH
        - [x]  Test over HTTP
        - [x]  Test as developer and master
    - [x]  Investigate performance
        - [x]  Test with a large number of protected branches / branches
        - [x]  Paginate list of protected branches
        - [x]  ~~Possibly rewrite `open_branches`~~
    - [x]  Add `iid`s to existing `ProtectedBranch`es
    - [x]  Add documentation
    - [x]  Add CHANGELOG entry
    - [x]  Add screenshots
    - [x]  Make sure [build](2f753e3ed2/builds) passes
    - [x]  Assign to endboss for review
    - [x]  Address @DouweM's comments
        - [x]  `protected_branch_params`
        - [x]  `exact_match` instead of `explicit_match`
        - [x]  When would self.name be blank?
        - [x]  Move `protected_branches.each` to a partial
        - [x]  Move `matching_branches.each` to a partial
        - [x]  If the branch is in @matching_branches, it's not been removed
        - [x]  move this regex to a method and memoize it
        - [x]  `commit_sha` directly for exact matches
        - [x]  Number of matches for wildcard matches, with a link
    - [x]  Wait for [build](43f9ce0e88/builds) to pass
    - [x]  Respond to @DouweM's comments
        - [x]  Don't use iid
        - [x]  Controller should use `@project.protected_branches.new`
        - [x]  move the memoization to `def wildcard_regex`
        - [x]  render with `collection: @protected_branches`
    - [x]  Wait for [build](f7beedf122/builds) to pass
    - [x]  Wait for @DouweM's review
    - [x]  Wait for @jschatz1's review
    - [x]  Respond to @jschatz1's comments
        - [x]  Use the new dropdown style
        - [x]  description should be moved to the description section without the styling
        - [x]  Protect button should be disabled when no branch is selected
    - [x]  Update screenshots
    - [x]  Merge conflicts
    - [x]  Make sure [build](20f3cfe8d5/builds) passes
    - [ ]  Revisit performance, possibly with staging/production data
        - [ ]  Get a dump of staging / run against staging live
            - [ ]  Get SSH access to staging
    - [ ]  Wait for review/merge






# Screenshots

## Creating wildcard protected branches

![1](/uploads/9446afccfdf6fa381e00c800dd2cc82e/1.png)
![2](/uploads/0b154503b297a818d3577488c575d845/2.png)
![3](/uploads/36217f79df9e41cc1550601f02627fe8/3.png)
![4](/uploads/041ca9bd529bcfa5373fca67e917cbcb/4.png)

### Using the `GLDropdown` component

![2016-06-30_14-16-15](/uploads/508afc2a5e2463c2954641409a560d88/2016-06-30_14-16-15.gif)

## Enforcing wildcard protected branches

### From the Web UI

![Screen_Shot_2016-06-20_at_1.21.18_PM](/uploads/8b5d4b1911e9152698a0488daf1880bc/Screen_Shot_2016-06-20_at_1.21.18_PM.png)

### Over SSH

![SSH](/uploads/7365989d7e4c406ef37b6ae5106442c9/SSH.gif)

### Over HTTPS

![HTTPS](/uploads/a7c0f56ae58efcffc75e6700fa2f4ac0/HTTPS.gif)

## Listing matching branches

![Screen_Shot_2016-06-20_at_1.33.44_PM](/uploads/d054113022f5d7ec64c0e57e501ac104/Screen_Shot_2016-06-20_at_1.33.44_PM.png)

See merge request !4665
2016-07-07 22:37:30 +00:00
Grzegorz Bizon 3da57c800b Require reference to CI config for some entries 2016-07-07 15:15:44 +02:00
Grzegorz Bizon a7ac2f7494 Simplify CI config entry node factory, use attribs 2016-07-07 15:00:35 +02:00
Grzegorz Bizon 9410aecca8 Add scaffold of CI config for the job stage entry 2016-07-07 13:40:01 +02:00
Grzegorz Bizon fea7762485 Delegate methods to default CI entry if undefined 2016-07-07 12:55:10 +02:00
Grzegorz Bizon b0ae0d730f Use only node factory to create CI config entries 2016-07-07 10:23:47 +02:00
Douwe Maan e0ecfe5bd1 Add tests for Position 2016-07-06 18:51:01 -04:00
Douwe Maan ebb5f591e3 Add tests for PositionTracer 2016-07-06 18:51:00 -04:00
Douwe Maan 2f30d00432 Add DiffNote model 2016-07-06 18:50:59 -04:00
Douwe Maan e9e06ca627 Add Gitlab::Diff::LineMapper 2016-07-06 18:50:59 -04:00
Douwe Maan a9fa45f09e Represent DiffRefs as proper class instead of tuple array 2016-07-06 18:50:58 -04:00
Douwe Maan 6ce25e7b4c Rename MergeRequest methods that return commits or shas to be more clear and consistent 2016-07-06 18:50:58 -04:00
Douglas Barbosa Alexandre 5f86a084f2 Consider that a GH exists only if both `ref`, and `sha` exist 2016-07-06 13:08:12 -03:00
Grzegorz Bizon 4491bf28e1 Move CI job config validations to new classes 2016-07-06 14:08:19 +02:00
Grzegorz Bizon b1b0c18b8c Add hidden job in new CI config that is irrelevant 2016-07-06 12:58:43 +02:00
Patricio Cano be221a30ac Revert back to not defining a default Git access protocol. 2016-07-05 16:54:22 -05:00
Patricio Cano 29c50c5315 Default Git access protocol to `web` 2016-07-05 16:54:22 -05:00
Patricio Cano fbaabb3911 Rename `enabled_git_access_protocols` to singular. 2016-07-05 16:54:22 -05:00
Patricio Cano 42fb2516d9 Add more tests to the allowed protocols feature 2016-07-05 16:54:22 -05:00
Patricio Cano 8b14d1d2c2 Rename ENV['PROTOCOL'] to ENV['GL_PROTOCOL'] to conform to what GitLab Shell expects and make the `protocol` param in `GitAccess` mandatory. 2016-07-05 16:54:22 -05:00
Grzegorz Bizon dbab56a951 Create composite job entries in new CI config 2016-07-05 14:48:17 +02:00
Grzegorz Bizon 6ae80732bb Add ability to define nodes in new CI config entry 2016-07-05 14:17:09 +02:00
Grzegorz Bizon e00ae9a877 Add new CI config entry for single job in pipeline 2016-07-05 14:05:07 +02:00
Grzegorz Bizon 5b7f211cbb Add new CI config entry that holds jobs definition 2016-07-05 13:35:50 +02:00
Grzegorz Bizon cf53d79873 Extract jobs config to separate key in config hash 2016-07-05 13:07:03 +02:00
Paco Guzman 330de255b7 RailsCache metrics now includes fetch_hit/fetch_miss and read_hit/read_miss info. 2016-07-05 12:28:06 +02:00
Rémy Coutable 06c7d6f3a8 Merge branch 'refactor/ci-config-move-global-entries' into 'master'
Move global ci entries handling from legacy to new config

## What does this MR do?

This MR moves responsibility of handling global CI config entries (like `image`, `services`), from legacy `GitlabCiYamlProcessor` to new CI Config

## Why was this MR needed?

This is the next iteration of CI configuration refactoring

## 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 !4820
2016-07-05 08:37:16 +00:00
Timothy Andrew eb16e1e3c2 Improve the error message displayed when branch creation fails.
Note: This feature was developed independently on master while this was
in review. I've removed the conflicting bits and left the relevant
additions, mainly a test for `Gitlab::Git::Hook`. The original commit
message follows:

1. `gitlab-shell` outputs errors to `stderr`, but we weren't using this
   information, prior to this commit. Now we capture the `stderr`, and
   display it in the flash message when branch creation fails.

2. This can be used to display better errors for other git operation
   failures with small tweaks.

3. The return value of `Gitlab::Git::Hook#trigger` is changed from a
   simple `true`/`false` to a tuple of `[status, errors]`. All usages
   and tests have been updated to reflect this change.

4. This is only relevant to branch creation _from the Web UI_, since SSH
   and HTTP pushes access `gitlab-shell` either directly or through
   `gitlab-workhorse`.

5. A few minor changes need to be made on the `gitlab-shell` end. Right
   now, the `stderr` message it outputs is prefixed by "GitLab: ", which
   shows up in our flash message. This is better removed.
2016-07-05 11:05:16 +05:30
Grzegorz Bizon bfad4c61f1 Add minor improvements in readability in CI config 2016-07-04 18:36:06 +02:00
Tomasz Maczukin f1a85747ca
Merge branch 'master' into dev-master
* master: (98 commits)
  Enable Style/EmptyLines cop, remove redundant ones
  Update CHANGELOG
  Cache results from jQuery selectors to retrieve namespace name
  Fix import button when import fail due the namespace already been taken
  Fix snippets comments not displayed
  Fix emoji paths in relative root configurations
  Exclude requesters from Project#members, Group#members and User#members
  Upgrade Thin from 1.6.1 to 1.7.0.
  Many squashed commits
  Cache autocomplete results
  Upgrade Sidekiq from 4.1.2 to 4.1.4.
  Upgrade seed-fu from 2.3.5 to 2.3.6
  use has_many relationship with events
  Support creating a todo on issuables via API
  Expose target, filter by state as string
  Add todos API documentation and changelog
  Improve the request / withdraw access button
  Metrics for Rouge::Plugins::Redcarpet and Rouge::Formatters::HTMLGitlab
  Groundwork for Kerberos SPNEGO (EE feature)
  Update CHANGELOG 8.9.5 for runners related fixes
  ...
2016-07-02 22:58:21 +02:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Stan Hu 88dbc4d110 Merge branch 'fix-relative-root-emoji-support' into 'master'
Fix emoji paths in relative root configurations

## What does this MR do?

If a site specifies a relative URL root, emoji files would omit the path from the URL, leading to lots of 404s.

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

At first, I tried to use `ActionView::Helpers::AssetUrlHelper.asset_url` since this is what it's intended to do. But this helper function is extremely slow, and it took minutes to generate the URLs for the hundreds of links needed for each emoji.

## Why was this MR needed?

Because emojis were broken in relative URL installations

## What are the relevant issue numbers?

#15642

## Does this MR meet the acceptance criteria?

- [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 !5027
2016-07-01 16:51:03 +00:00
Stan Hu 4bfe10d5f9 Fix emoji paths in relative root configurations
If a site specifies a relative URL root, emoji files would omit the path from
the URL, leading to lots of 404s.

Closes #15642
2016-07-01 09:10:12 -07:00
James Lopez f29c30475e use has_many relationship with events 2016-07-01 15:34:10 +02:00
James Lopez d6d0a35598 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/import-export-events 2016-07-01 14:52:38 +02:00
Eric K Idema 12aa1f898d Import from Github using Personal Access Tokens.
This stands as an alternative to using OAuth to access a user's Github
repositories.  This is setup in such a way that it can be used without OAuth
configuration.

From a UI perspective, the how to import modal has been replaced by a full
page, which includes a form for posting a personal access token back to the
Import::GithubController.

If the user has logged in via GitHub, skip the Personal Access Token and go
directly to Github for an access token via OAuth.
2016-06-30 18:48:17 +02:00
Robert Speicher 443d584253 Merge branch 'rubocop/enable-unneeded-capital-w-cop' into 'master'
Enable Style/UnneededCapitalW Rubocop cop

## What does this MR do?

This MR enables Rubocop cop that checks if `%W[]`, which supports interpolation, is needed.

## What are the relevant issue numbers?

#17478 

See merge request !5010
2016-06-30 15:21:53 +00:00
Grzegorz Bizon efd70c1878 Enable Style/UnneededCapitalW Rubocop cop 2016-06-30 13:31:52 +02:00
Grzegorz Bizon b4f03e8b1e Improve description of CI types node and in specs 2016-06-30 12:59:17 +02:00
Alejandro Rodríguez 20b9bb2029 Create (if necessary) and link the gitlab-shell secret file on the rake install task 2016-06-29 22:30:33 -04:00
Alejandro Rodríguez 86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00
Stan Hu d10642a4b8 Handle case when Redis cache returns an empty setting 2016-06-29 14:28:41 -07:00
Stan Hu c600cf8348 Fix database migrations when Redis is not running
If Redis were not running or USE_DB were set to false, the
application settings retrieval would fail completely. This
change only attempts to use the cache if the system actually
wants to connect to the DB and rescues any failures in talking to
Redis.

Closes #17557
2016-06-29 14:04:59 -07:00
Patricio Cano 10444f61f8 Fixed privilege escalation issue where manually set external users would be reverted back to internal users if they logged in via OAuth and that provider was not in the `external_providers` list. 2016-06-29 10:37:54 -05:00
Grzegorz Bizon 28bafd5354 Enable Style/SpaceAfterComma Rubocop cop 2016-06-29 15:23:44 +02:00
Grzegorz Bizon 9798ac77ed Enable Style/SpaceAfterColon Rubocop cops 2016-06-29 15:16:04 +02:00
James Lopez a65cf77ed9 fixes and refactored JSON spec 2016-06-29 13:11:26 +02:00
James Lopez 3d2a736679 fixing events for import/export 2016-06-29 10:35:26 +02:00
Grzegorz Bizon f4421817de Add global cache config entry to new CI config 2016-06-29 09:48:52 +02:00
Grzegorz Bizon 92312786f1 Add CI config entry location info to error message
This CI config entry location in configuration Hash.
2016-06-29 09:17:42 +02:00
Grzegorz Bizon 7c511c2f55 Make it possible to set parent in CI config node 2016-06-29 09:05:14 +02:00
Yorick Peterse d7b4f36a3c
Use clock_gettime for all performance timestamps
Process.clock_gettime allows getting the real time in nanoseconds as
well as allowing one to get a monotonic timestamp. This offers greater
accuracy without the overhead of having to allocate a Time instance. In
general using Time.now/Time.new is about 2x slower than using
Process.clock_gettime(). For example:

    require 'benchmark/ips'

    Benchmark.ips do |bench|
      bench.report 'Time.now' do
        Time.now.to_f
      end

      bench.report 'clock_gettime' do
        Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
      end

      bench.compare!
    end

Running this benchmark gives:

    Calculating -------------------------------------
                Time.now   108.052k i/100ms
           clock_gettime   125.984k i/100ms
    -------------------------------------------------
                Time.now      2.343M (± 7.1%) i/s -     11.670M
           clock_gettime      4.979M (± 0.8%) i/s -     24.945M

    Comparison:
           clock_gettime:  4979393.8 i/s
                Time.now:  2342986.8 i/s - 2.13x slower

Another benefit of using Process.clock_gettime() is that we can simplify
the code a bit since it can give timestamps in nanoseconds out of the
box.
2016-06-28 17:51:25 +02:00
Grzegorz Bizon 2846f95d2a Merge branch 'master' into refactor/ci-config-move-global-entries
* master: (352 commits)
  Display last commit of deleted branch in push events (!4699)
  add changelog
  add missing attribute to attr_encrypted so it is fully backwards-compatible
  Add "GitLab team members only" to diagram link
  doc: note that .gitattributes uses default branch
  use the conf lexer so we have highlighted comments
  first draft of docs
  support cgi style options, such as erb?parent=json
  move the path alias to a more appropriate location
  make #custom_language private
  appease rubocop
  add an alias for Snippet#path
  appease rubocop
  check the tag so that an instance will pass too
  fix the spec, using project.change_head
  Revert "bump the master sha for gitlab-test!9"
  bump the master sha for gitlab-test!9
  add custom highlighting via .gitattributes
  Rename Licenses API to License Templates API
  Check for conflict with wiki projects when creating a new project.
  ...
2016-06-28 14:38:05 +02:00
http://jneen.net/ 66b37149eb support cgi style options, such as erb?parent=json 2016-06-27 14:17:49 -07:00
http://jneen.net/ 9fc53864dd appease rubocop 2016-06-27 14:17:49 -07:00
http://jneen.net/ 5415c67424 check the tag so that an instance will pass too 2016-06-27 14:17:49 -07:00
http://jneen.net/ cd9bea770b fix the spec, using project.change_head 2016-06-27 14:17:49 -07:00
http://jneen.net/ f8b80f7fae add custom highlighting via .gitattributes
paired with @stanhu
2016-06-27 14:17:49 -07:00
Grzegorz Bizon c019585cb8 Validate interface only with CI node validator 2016-06-27 14:16:57 +02:00
Grzegorz Bizon 56e88b8c28 Add new ci config entry that handles cache config 2016-06-27 14:01:12 +02:00
Rémy Coutable a9dbd394a6 Merge branch 'refactor/ci-config-add-entry-error' into 'master'
Improve validations and error handling in new CI config entries

## What does this MR do?

This MR improves validation in new CI config.

## Why was this MR needed?

With that it will be easier to handle errors during validation and post-processing.

## What are the relevant issue numbers?

This is a continuation of #15060

See merge request !4560
2016-06-27 08:24:17 +00:00
Grzegorz Bizon ce4478ed86 Add ci config entry that represents array of paths 2016-06-24 09:54:52 +02:00
Grzegorz Bizon e017e1b629 Add ci config class that represents a boolean value 2016-06-24 09:49:54 +02:00
Grzegorz Bizon 04ece6664a Add ci config class that represents a key value 2016-06-24 08:58:09 +02:00
Rémy Coutable 6f6dcc366b Merge branch 'fix/import-export-gitlab-errors' into 'master'
Fix errors found on importing GitLab CE repo

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

See merge request !4855
2016-06-23 14:13:17 +00:00
Grzegorz Bizon 1f320edb77 Minor refactorings in new CI configuration classes 2016-06-23 13:51:34 +02:00
Grzegorz Bizon 29b96d92c1 Move CI stages configuration to new CI config 2016-06-23 13:51:07 +02:00
Paco Guzman 9101915cb7 Add Sidekiq queue duration to transaction metrics. 2016-06-23 13:09:52 +02:00
James Lopez f854f6cd02 fixed pipeline notes issue 2016-06-23 12:29:11 +02:00
Grzegorz Bizon 2240807c1a Assume that unspecified CI config is undefined
We assume that when someone adds a key for the configuration entry, but
does not provide a valid value, which causes entry to be `nil`, then
entry should be considered as the undefined one. We also assume this is
semantically correct, this is also backwards compatible with legacy CI
config processor.

See issue #18775 for more details.
2016-06-23 10:22:41 +02:00
Robert Speicher cef021917f Merge branch 'fix_saml_signin' into 'master'
Fix subsequent SAML sign ins

Fixes a bug when `auto_link_ldap_user` is `true` that causes SAML users to be unable to sign in a second time.

Fix the problem for https://gitlab.zendesk.com/agent/tickets/22546

See merge request !4718
2016-06-22 22:12:09 +00:00
Drew Blessing 938f2b9979 Fix subsequent SAML sign ins 2016-06-22 16:10:55 -05:00
Grzegorz Bizon bc2348f2e4 Return default config value when entry is undefined 2016-06-22 14:26:33 +02:00
Grzegorz Bizon 05ce8a1187 Handle CI environment variables in a new CI config 2016-06-22 11:22:53 +02:00
Grzegorz Bizon 04ecfca386 Rename CI config null node entry to undefined node 2016-06-22 10:44:33 +02:00
Rémy Coutable ed519c161b Merge branch 'ci-lfs-fetch' into 'master'
Allow to fetch LFS from CI

## What does this MR do?

This adds support for fetching LFS object from CI jobs (mostly it's made for supporting GitLab CI).

## What is left?

- [x] Write tests covering a new authorization mechanism

cc @grzesiek @marin

See merge request !4465
2016-06-21 13:05:35 +00:00
Grzegorz Bizon d399128955 Handle after script CI config in new classes
This also makes Script to return an array of commands instead of
concatented command, which is our current direction.
2016-06-21 13:02:14 +02:00
Grzegorz Bizon fc00c545b2 Handle CI services config in new CI config classes 2016-06-21 12:40:52 +02:00
Grzegorz Bizon cd6a2afbbb Move CI image configuration entry to new CI config 2016-06-21 12:10:13 +02:00
Grzegorz Bizon 8b550db33e Add image configuration entry to new ci config 2016-06-21 11:47:05 +02:00
Grzegorz Bizon c91298d554 Use generic type validator in new ci configuration 2016-06-21 11:43:32 +02:00
Kamil Trzcinski 6bc22d95b8 Add test coverage to LFS fetching 2016-06-21 11:26:44 +02:00
Kamil Trzcinski 2f545a15c0 Merge remote-tracking branch 'origin/master' into ci-lfs-fetch 2016-06-21 10:11:14 +02:00
ZJ van de Weg 27bf7ae59e Refactor Gitlab::Gitignores 2016-06-20 14:48:28 -05:00
Lin Jen-Shin 176fa21cb7 raise UnknownIncomingEmail when there's no mail_key:
So that we don't have to pretend that CreateNoteHandler
could handle a nil mail_key. Also, since NilClass#=~ would
just return nil for any regular expression, we could just
match it without checking nilness.

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3363#note_12566407
2016-06-20 19:15:54 +08:00
Grzegorz Bizon 9510d31b4d Merge branch 'master' into refactor/ci-config-add-entry-error
* master: (345 commits)
  use rails root join
  fixed a couple of errors spotted in production
  Fix RangeError exceptions when referring to issues or merge requests outside of max database values
  Fix bug in `WikiLinkFilter`.
  Small frontend code fixes and restore 8a2d88f commit
  Warn about admin privilege to disable GitHub Webhooks
  Listing GH Webhooks doesn't stop import process for non GH admin users
  fixup! updated docs for api endpoint award emoji
  Update CHANGELOG
  Ensure Todos counters doesn't count Todos for projects pending delete
  Add endpoints for award emoji on notes
  Sort API endpoints and implement feedback
  Add endpoints for Award Emoji
  Fixed issue with assignee dropdown not selecting correctly
  Removed update method Re-structured controller spec Renamed issuable param to issuable_id
  Fix clibpoard buttons on "Check out branch" modal.
  Track method call times/counts as a single metric
  Cache todo counters (pending/done)
  Fix a 'wrong number of arguments' error
  Added missing mount point for Sidekiq Metrics API, after it got lost on rebase.
  ...
2016-06-20 10:38:46 +02:00
Yorick Peterse be3b878443 Track method call times/counts as a single metric
Previously we'd create a separate Metric instance for every method call
that would exceed the method call threshold. This is problematic because
it doesn't provide us with information to accurately get the _total_
execution time of a particular method. For example, if the method
"Foo#bar" was called 4 times with a runtime of ~10 milliseconds we'd end
up with 4 different Metric instances. If we were to then get the
average/95th percentile/etc of the timings this would be roughly 10
milliseconds. However, the _actual_ total time spent in this method
would be around 40 milliseconds.

To solve this problem we now create a single Metric instance per method.
This Metric instance contains the _total_ real/CPU time and the call
count for every instrumented method.
2016-06-17 13:09:55 -04:00
Yorick Peterse ed5f17cc73 Merge branch 'secure-request-uris' into 'master'
Filter out sensitive parameters of metrics data

See merge request !4748
2016-06-17 16:43:14 +00:00
Robert Speicher 8dccfb4a9c Merge branch 'update-column-in-batches-where' into 'master'
Allow customising of queries used for `update_column_in_batches`

This MR makes two changes to `add_column_with_default` and `update_column_in_batches`:

1. `add_column_with_default` no longer wraps the entire set of updates in a single transaction, preventing any locks from sticking around for the duration of the entire transaction
2. `update_column_in_batches` now takes a block which can be used to customise the queries. This uses Arel as messing with raw SQL strings is a total pain

In !4381 there's a need for updating existing rows/columns in a table in batches using a custom `WHERE` condition. Without the changes in this MR this would not be possible.

See merge request !4680
2016-06-17 16:36:22 +00:00
Paco Guzman 2e552c6bf0 Filter out sensitive parameters of metrics data 2016-06-17 18:14:25 +02:00
Douwe Maan 9b7fd74805 Merge branch 'feature/project-export' into 'master'
Export project functionality

This is a MR for the export functionality of https://gitlab.com/gitlab-org/gitlab-ce/issues/3050, which adds the ability to export single projects.

- [x] members
- DB data
  - [x] issues
  - [x] issue comments
  - [x] merge requests
  - [x] merge request diff
  - [x] merge request comments
  - [x] labels
  - [x] milestones
  - [x] snippets
  - [x] releases
  - [x] events
  - [x] commit statuses
  - [x] CI builds
- File system data
  - [x] Git repository
  - [x] wiki
  - [x] uploads
  - [ ] ~~CI build traces~~
  - [ ] ~~CI build artifacts~~
  - [ ] ~~LFS objects~~
- DB configuration
  - [x] services
  - [x] web hooks
  - [x] protected branches
  - [x] deploy keys
  - [x] CI variables
  - [x] CI triggers

See merge request !3114
2016-06-17 15:35:27 +00:00
Grzegorz Bizon 44b00a1ebb Extract CI entry config hash validation to validator 2016-06-17 15:02:39 +02:00
Grzegorz Bizon 2a87a55f87 Merge branch 'master' into refactor/ci-config-add-entry-error
* master: (189 commits)
  Update CHANGELOG for !4659
  Center the header logo for all Devise emails
  Add previews for all customized Devise emails
  Customize the Devise `unlock_instructions` email
  Customize the Devise `reset_password_instructions` email
  Customize the Devise `password_change` emails
  Use gitlab-git 10.2.0
  Use Git cached counters on project show page
  Fix indentation scss-lint errors
  Added title attribute to enties in tree view Closes #18353
  Banzai::Filter::ExternalLinkFilter use XPath
  Reduce queries in IssueReferenceFilter
  Use gitlab_git 10.1.4
  Fixed ordering in Project.find_with_namespace
  Fix images in emails
  Banzai::Filter::UploadLinkFilter use XPath
  Turn Group#owners into a has_many association
  Make project_id nullable
  ...
2016-06-17 12:25:43 +02:00
Grzegorz Bizon d9ca84015c Add first custom validator for new ci config
This follows a standard `ActiveModel` pattern of creating a custom
validators. We use `ActiveModel::EachValidator` here that reuses methods
provided by `LegacyValidationHelpers`.

We will remove `LegacyValidationHelpers` on some point in the future, at
the later stages of CI configuration refactoring. It may be possible
to rewrite custom validators to use format like:

`validates :config, array_of: String`
2016-06-17 12:06:48 +02:00
Grzegorz Bizon 002e6ed1f0 Improve CI config entries validations prototype 2016-06-17 11:23:16 +02:00
Grzegorz Bizon 95520dfc72 Add prototype of CI config node validator
This makes use of `ActiveModel::Validations` encapsulated in a separate
class that is accessible from a node object.
2016-06-16 15:46:03 +02:00
James Lopez b3a0a1c315 fixed merge conflicts on UI branch 2016-06-16 15:01:27 +02:00
James Lopez 2a747d386d fixed merge conflicts 2016-06-16 14:07:49 +02:00
James Lopez 778d72664f Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export
# Conflicts:
#	app/models/ci/pipeline.rb
2016-06-16 13:04:00 +02:00
James Lopez 452c076a34 Revert "squashed merge and fixed conflicts"
This reverts commit 13e37a3ee5.
2016-06-16 12:59:07 +02:00
James Lopez 13e37a3ee5 squashed merge and fixed conflicts 2016-06-16 12:12:28 +02:00
Ilan Shamir 94135e6275 Remove JiraIssue model and replace references with ExternalIssue 2016-06-16 01:25:18 +03:00
Yorick Peterse 816c453558
Don't update columns in batches in a transaction
This ensures that whatever locks are acquired aren't held onto until the
end of the transaction (= after _all_ rows have been updated). Timing
wise there's also no difference between using a transaction and not
using one.
2016-06-15 17:04:07 +02:00
Yorick Peterse 8966263e0c
Customizing of update_column_in_batches queries
By passing a block to update_column_in_batches() one can now customize
the queries executed. This in turn can be used to only update a specific
set of rows instead of simply all the rows in the table.
2016-06-15 16:44:44 +02:00
Grzegorz Bizon 76aea978c6 Add class that encapsulates error in new Ci config 2016-06-15 14:09:21 +02:00
James Lopez f6896f9381 fix annoying spec 2016-06-15 12:15:42 +02:00
Lin Jen-Shin 4befcc353d Add missing require in tests 2016-06-15 17:59:44 +08:00
James Lopez cbd0201fdb fixing specs and some code cleanup 2016-06-15 10:37:17 +02:00
Lin Jen-Shin e75391889e Merge branch 'master' into new-issue-by-email
* master: (1246 commits)
  Update CHANGELOG
  Update tests to make it work with Turbolinks approach
  Use Turbolink instead of ajax
  Reinitialize checkboxes to toggle event bindings
  Turn off handlers before binding events
  Removed console.log Uses outerWidth instead of width
  Revert "Added API endpoint for Sidekiq Metrics"
  Added API endpoint for Sidekiq Metrics
  Added CHANGELOG entry for allocations Gem/name fix
  Filter out classes without names in the sampler
  Update the allocations Gem to 1.0.5
  Put all sidebar icons in fixed width container
  Instrument private/protected methods
  Fix Ci::Build#artifacts_expire_in= when assigning invalid duration
  Fix grammar and syntax
  Update CI API docs
  UI and copywriting improvements
  Factorize members mails into a new Emails::Members module
  Factorize access request routes into a new :access_requestable route concern
  Factorize #request_access and #approve_access_request  into a new AccessRequestActions controller concern
  ...
2016-06-15 15:43:12 +08:00
Yorick Peterse ab91f1226f
Filter out classes without names in the sampler
We can't do a lot with classes without names as we can't filter by them,
have no idea where they come from, etc. As such it's best to just ignore
these.
2016-06-14 18:09:06 +02:00
Yorick Peterse 0ca7b3ba37 Merge branch '18449-instrument-grape-endpoints' into 'master'
Instrument Grape API endpoints

See merge request !4587
2016-06-14 14:29:55 +00:00
Paco Guzman dadc531353 Instrument private/protected methods
By default instrumentation will instrument public,
protected and private methods, because usually
heavy work is done on private method or at least
that’s what facts is showing
2016-06-14 15:17:51 +02:00
Yorick Peterse 4b964011cf Merge branch '18528-cpu-time-instrumentation' into 'master'
Measure CPU time for instrumented methods

See merge request !4640
2016-06-14 11:39:19 +00:00
Paco Guzman 509082bafb Instrument Grape Endpoint with Metrics::RackMiddleware
Generating the following tags

Grape#GET /projects/:id/archive

from Grape::Route objects like

{ :path => /:version/projects/:id/archive(.:format)
  :version => “v3”,
  :method => “GET” }

Use an instance variable to cache raw_path transformations.
This variable is only going to growth to the number of 
endpoints of the API, not with exact different requests

We can store this cache as an instance variable because 
middleware are initialised only once
2016-06-14 13:06:46 +02:00
Rémy Coutable 47cdb69921 Merge branch 'refactor/ci-config-add-global-entry' into 'master'
Add global entry with before script to new CI config

## What does this MR do?

This MR adds a new entries to a new CI config class. It is next refactoring step after !4462.

See #15060

See merge request !4482
2016-06-14 10:53:26 +00:00
Paco Guzman 120fbbd487 Measure CPU time for instrumented methods 2016-06-14 12:49:31 +02:00
Grzegorz Bizon 59eeec3ff8 Make method that composes ci config entry private 2016-06-14 10:48:51 +02:00
James Lopez 9be06bbbb4 fix indents 2016-06-14 10:23:00 +02:00
James Lopez 7779457907 fix merge 2016-06-14 10:20:47 +02:00
James Lopez 9ff1990422 Merge branches 'feature/project-export' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-import 2016-06-14 10:18:03 +02:00
James Lopez fde90c3e7f better coverage for Reader 2016-06-14 10:12:41 +02:00
Douglas Barbosa Alexandre b56c456750 Project members with guest role can't access confidential issues 2016-06-13 19:32:00 -03:00
James Lopez 4020b0f55f few changes based on MR feedback 2016-06-13 21:18:26 +02:00
Douwe Maan 1cbd5c6686 Merge branch 'gitlab-auth-method-names' into 'master'
Improve Gitlab::Auth method names

Auth.find was a very generic name for a very specific method.
Auth.find_in_gitlab_or_ldap was inaccurate in GitLab EE where it also
looks in Kerberos.


See merge request !4589
2016-06-13 18:05:53 +00:00
James Lopez 833dc3204d few more changes based on feedback 2016-06-13 16:55:51 +02:00
Jacob Vosmaer f73cf3e937 Also rename "find" in the specs 2016-06-13 15:38:25 +02:00
James Lopez b07dc938b9 fixed specs and refactored a few things due to recent model changes and merge conflicts 2016-06-13 13:34:36 +02:00
James Lopez ad68bc63b5 Merge branches 'feature/project-export' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-import
# Conflicts:
#	app/models/project.rb
#	db/schema.rb
#	lib/gitlab/import_export/import_export_reader.rb
2016-06-13 12:43:25 +02:00
Yorick Peterse b33b7be53e
Handle NULL migration errors in migration helpers
This ensures that whenever changing the NULL constraint of a column
fails we still drop the column.
2016-06-13 11:22:58 +02:00
Grzegorz Bizon ebe14437e9 Merge branch 'master' into refactor/ci-config-add-global-entry
* master: (59 commits)
  Improved SVG sanitizer specs to include smoke tests for clean.
  Refactored SVG sanitizer
  Added SVG sanitizer fix to the changelog
  Refactor SVG sanitizer and prevent `xlink:href` to refer to external resources
  Fix SVG whitelisting to allow namespaced attributes
  Fix Error 500 when using closes_issues API with an external issue tracker
  Center layout navigation and remove icons
  Fix preferences_spec test
  Add back sidebar counters and username
  Only create the backup directory if it is local
  Fix safari logo loading animation safari bug
  Revert side nav to full width; remove border under nav; remove tooltips on nav links; stop page content shifting with side nav; put project nav in container
  Update media queries
  Fix profile test
  Fix logo at all screen widths, update sidebar text
  Move tanuki icon to center of nav bar; keep nav closed by default; remove collapsed nav cookie
  Remove unused MergeRequest#gitlab_merge_status method
  Add CHANGELOG item for labels/milestones navigation change
  Render issues link on issues subnav unless you visit merge request controller
  Render only issues/mr in subnav depends on context
  ...
2016-06-13 11:14:38 +02:00
James Lopez 069bc26418 refactored loads of things due to commits to pipeline change 2016-06-13 10:55:54 +02:00
Grzegorz Bizon 11c0d02283 Simplify ci config node factory 2016-06-13 09:58:35 +02:00
James Lopez e2c95c07a4 Merge branches 'feature/project-export' and 'master' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export 2016-06-13 09:22:33 +02:00
Grzegorz Bizon 7c8f3b0cfc Duplicate CI config node factory on class level 2016-06-13 08:50:12 +02:00
Gabriel Mazetto 7c87dac5f1 Improved SVG sanitizer specs to include smoke tests for clean. 2016-06-12 21:05:58 -04:00
Gabriel Mazetto a9eaa20dcb Refactored SVG sanitizer 2016-06-12 21:05:58 -04:00
Gabriel Mazetto 13791c6704 Refactor SVG sanitizer and prevent `xlink:href` to refer to external resources 2016-06-12 21:05:58 -04:00
Gabriel Mazetto 02b882418a Fix SVG whitelisting to allow namespaced attributes 2016-06-12 21:05:57 -04:00
Kamil Trzcinski 95a10f4533 Merge remote-tracking branch 'origin/master' into ci-lfs-fetch 2016-06-10 22:27:06 +02:00
Jacob Vosmaer 0e896ffe4e Improve Gitlab::Auth method names
Auth.find was a very generic name for a very specific method.
Auth.find_in_gitlab_or_ldap was inaccurate in GitLab EE where it also
looks in Kerberos.
2016-06-10 14:51:16 +02:00
Grzegorz Bizon cc373a3550 Add factory for fabricating new ci config nodes 2016-06-10 14:01:07 +02:00
Douwe Maan 16bd4e5668 Merge branch 'master' into workhorse-helpers 2016-06-10 12:28:04 +02:00
Grzegorz Bizon 12080ba150 Simplify new ci config entry class interface 2016-06-10 11:26:03 +02:00
Grzegorz Bizon 51046dd226 Merge branch 'master' into refactor/ci-config-add-global-entry
* master: (147 commits)
  Minor MR comment fixes.
  Update CHANGELOG for 8.8.4 and 8.8.5
  Properly quote table name in Rake task for MySQL and PostgreSQL compatibility
  Checks based on whether data is loaded not undefined
  Checks for undefined when inserting autocomplete into textarea
  Ignore frequent emojis in search.
  Fixed tests
  CHANGELOG
  Improved the UX of issue & milestone date picker
  Change date format to be non zero padded in order to fix failing test
  Update method name for better understanding
  Add tests for dates on tooltips
  Fix local timeago on user dashboard
  Update CHANGELOG
  Toggling a task in a description with mentions doesn't creates a Todo
  Update CHANGELOG
  Fixed failing label subscribe test
  Tests update
  Updated subscribe icon
  Fixed failing tests
  ...
2016-06-10 10:49:07 +02:00
Grzegorz Bizon d7e1251161 Rename method that returns allowed nodes in Ci config 2016-06-09 14:59:59 +02:00
Douwe Maan 30ee4ea665 Merge branch 'saml-ldap-link-flow' into 'master'
Adjust the SAML control flow to allow LDAP identities to be added to an existing SAML user.

## What does this MR do?

It correctly lets an existing SAML user to add their LDAP identity automatically at login.

## Why was this MR needed?

A customer had issues with the `auto_link_ldap_user` feature. The flow was not working if there was an account with a SAML identity, but no LDAP identity. GitLab would pick up the correct LDAP person, but due to the order of the flow, that LDAP person was never associated with the user.

## What are the relevant issue numbers?

Fixes #17346 

/cc @dblessing @balameb @stanhu 

See merge request !4498
2016-06-09 10:48:31 +00:00
Grzegorz Bizon 6a319fd287 Make it possible configure Ci entry description 2016-06-09 10:53:56 +02:00
Grzegorz Bizon d9d5042fd9 Extract method that composes new Ci config entry 2016-06-09 10:28:44 +02:00
Patricio Cano 9282810fb7 Syntax fixes and better logging around the `ldap_person` method. 2016-06-08 18:09:43 -05:00
Kamil Trzcinski 13d941e185 Make Omniauth providers specs to not modify global configuration 2016-06-08 16:50:05 +02:00
Douwe Maan a9857f8c2f Add send_git_diff helper 2016-06-08 14:30:15 +02:00
Grzegorz Bizon 48a59c1a8b Rename BeforeScript to Script in new Ci config 2016-06-08 13:22:39 +02:00
Grzegorz Bizon 5065612a0a Add minor improvements in new Ci config design 2016-06-08 13:01:44 +02:00
Grzegorz Bizon 87fe50f2a0 Delegate Ci config entry value to single method 2016-06-08 12:32:56 +02:00
Grzegorz Bizon 2b48da22ca Merge branch 'master' into refactor/ci-config-add-global-entry
* master: (285 commits)
  Bump recaptcha gem to 3.0.0 to remove deprecated stoken support
  Load knapsack in Rakefile only when is bundled
  Add License Finder information to contribution acceptance criteria.
  Add LGPLv2 to license whiltelist
  Instrument `RepositoryCheck::SingleRepositoryWorker` manually
  Bump nokogiri to 1.6.8
  Fix alignment of wiki top area
  Update charcoal theme colors
  Update nav link font size and spacing; fix hamburger icon
  Fix control btn position
  Remove todos count tests in nav
  Test impersonation using img data attribute instead of username
  Implement compact side nav
  Fix knapsack for master
  Align links and tabs
  Add scrolling tabs to code subnav
  Finish styling sub nav
  Updated colors
  Fixed failing tests
  CHANGELOG item
  ...

Conflicts:
	lib/gitlab/ci/config.rb
	spec/lib/gitlab/ci/config_spec.rb
2016-06-08 11:38:56 +02:00
Jacob Vosmaer bebe110dff Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-http-controller
Conflicts:
	lib/gitlab/workhorse.rb
2016-06-08 10:31:33 +02:00
Patricio Cano c593154cb4 Moved `find_or_create_ldap_user` method to parent class and added logging. 2016-06-07 11:21:20 -05:00
Rémy Coutable be78a556d9 Merge branch 'refactor/ci-config-add-facade' into 'master'
Add new GitLab CI configuration facade class

## What does this MR do?

This MR is a first iteration of major CI configuration refactoring. See #17139 and #15060 for more details.

## What are the relevant issue numbers?

Closes #17139

See merge request !4462
2016-06-07 16:05:26 +00:00
Jacob Schatz 5b83abcc01 Merge branch 'issue_14189' into 'master'
Ability to prioritize labels

Closes #14189 

See merge request !4009
2016-06-07 15:15:07 +00:00
Douwe Maan 3368afd767 Merge branch 'rename-ci-commit-phase-2' into 'master'
Rename Ci::Commit in specs

This is second iteration of renaming Ci::Commit occurences, this time I try to rename all `let's` and `factories` to match what type of object is created:

1. Rename factories: `ci_[...]_commit_[...]` to `ci_[...]_pipeline_[...]`,
2. Rename all `let's(:[ci_]commit)` to `let(:pipeline)`,
3. Rename all occurrences of `[ci_]commit` to `pipeline` if Pipeline object is created

cc @grzesiek @DouweM 

See merge request !4463
2016-06-07 12:45:59 +00:00
Grzegorz Bizon 70bda3e89b Implement script in Ci config and use in legacy one 2016-06-07 14:23:47 +02:00
Grzegorz Bizon c2d6d61dac Add DSL for adding nodes in Ci config interface 2016-06-07 13:20:07 +02:00
Douwe Maan 8c5712a422 Merge branch 'gh-disable-webhooks' 2016-06-07 13:06:43 +02:00
Douwe Maan acef028d85 Merge branch 'gh-fix-comments-on-diff' 2016-06-07 13:04:32 +02:00
Grzegorz Bizon 5ef104df59 Improve Ci config loader by changing method signature 2016-06-07 12:53:46 +02:00
Grzegorz Bizon 6bd67f5212 Do not process new Ci config entry when invalid 2016-06-07 12:48:26 +02:00
Grzegorz Bizon e8f995ef26 Pass root Ci config entry to each subsequent entry 2016-06-07 12:13:22 +02:00
Grzegorz Bizon 69a3755c5a Add Ci config entry that implements Null Object 2016-06-07 11:58:02 +02:00
Grzegorz Bizon b95c60a071 Do not process Ci config node when node is a leaf 2016-06-07 11:26:39 +02:00
Grzegorz Bizon fa097c678c Remove duplicated exception in Ci config
This is a temporary refactoring stub, that is planned to be removed
after removing legacy config processor.
2016-06-07 10:26:38 +02:00
Kamil Trzcinski 6e64d1ac76 Merge remote-tracking branch 'origin/master' into rename-ci-commit-phase-2 2016-06-07 10:26:27 +02:00
Kamil Trzcinski dbf235f514 Fix tests failures 2016-06-07 10:25:57 +02:00
Patricio Cano 7038440e34 Adjust the SAML control flow to allow LDAP identities to be added to an existing SAML user. 2016-06-06 18:47:49 -05:00
Yorick Peterse 0ba21860c5 Merge branch 'issue_3359' into 'master'
Remove duplicated notification settings and add unique index

See merge request !4472
2016-06-06 19:14:01 +00:00
Grzegorz Bizon 940763e0e7 Use CI config errors from new processor in legacy one 2016-06-06 20:56:58 +02:00
Kamil Trzcinski 8562cb5f78 Merge branch 'rename-ci-commit' into rename-ci-commit-phase-2 2016-06-06 20:24:13 +02:00
Kamil Trzcinski e995e1f5cd Merge remote-tracking branch 'origin/master' into rename-ci-commit 2016-06-06 19:06:48 +02:00
Rémy Coutable 499bb9f305 Improve Issuable.order_labels_priority
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-06 11:59:49 -05:00
Felipe Artur 9264203103 change add_concurrent_index function arguments 2016-06-06 13:06:21 -03:00
Douglas Barbosa Alexandre 7c072c76fc Fix importer for GitHub comments on diff
Fix comments on diff after LegacyDiffNote was extracted from Note
2016-06-06 12:19:03 -03:00
Douglas Barbosa Alexandre 659d5d4830 Disable Webhooks before proceeding with the GitHub import 2016-06-06 12:07:45 -03:00
Rémy Coutable ac4e3e8cf0 Merge branch 'tests/extend-specs-for-build-badge' into 'master'
Extend specs for builds badge

## What does this MR do?

This MR extends specs for builds badge.

## Why was this MR needed?

We added an edge case to specs, while trying to reproduce problem described in #17549

## What are the relevant issue numbers?

#17549

See merge request !4401
2016-06-06 14:59:26 +00:00
Douwe Maan 8c3ba8d6c9 Add workhorse controller and API helpers 2016-06-06 13:16:30 +02:00
Grzegorz Bizon a3c0745514 Collect errors from all nodes in new CI config 2016-06-06 11:59:25 +02:00
Grzegorz Bizon 6dbd1c86a8 Validate new before script CI configuration entry 2016-06-06 11:33:45 +02:00
Kamil Trzcinski 842f0a3401 Merge branch 'rename-ci-commit' into rename-ci-commit-phase-2
# Conflicts:
#	features/steps/shared/builds.rb
#	spec/requests/ci/api/builds_spec.rb
2016-06-06 11:21:39 +02:00
Kamil Trzcinski 7ad7e10fee Merge remote-tracking branch 'origin/master' into rename-ci-commit 2016-06-06 11:20:17 +02:00
Grzegorz Bizon 8048dcc8e6 Implement CI configuration nodes tree processing 2016-06-06 10:43:11 +02:00
Grzegorz Bizon 7f2f683eeb Rename ci config module that holds nodes to Node 2016-06-06 09:24:16 +02:00
Grzegorz Bizon 6609589b93 Add ci config global and before_script entries 2016-06-06 09:05:00 +02:00
Grzegorz Bizon 23030439c2 Rename class that loads CI configuration to Loader 2016-06-06 08:20:55 +02:00
Grzegorz Bizon d2b708ac43 Extract CI config YAML parser to a separate class
With this approach it would be easier to add different sources of
configuration, that we do not necessairly have to be in YAML format.
2016-06-03 21:10:50 +02:00
James Lopez 8476f91a4e WIP - added missing notes, trying to fix specs 2016-06-03 17:28:08 +02:00
Kamil Trzcinski 20c7144ed2 Rename all `[ci_]commit` to `[ci_]pipeline` in specs and features 2016-06-03 16:22:26 +02:00
Z.J. van de Weg 9d491712cf Merge branch 'master' into awardables 2016-06-03 15:20:11 +02:00
Jacob Vosmaer 3ffa494ffe Changes after more review from Rémy 2016-06-03 14:57:34 +02:00
Grzegorz Bizon d501850e05 Add gitlab ci configuration class that holds hash
As for now, we keep this class inside a oryginal config processor class.
We will move implementation to this class and delegate to it from
current config processor.

After original gitlab ci yaml processor not longer has relevant
impelemntation we will replace it with new configuration class.
2016-06-03 14:20:34 +02:00
Kamil Trzcinski 17c6bec79d WIP 2016-06-03 13:57:40 +02:00
James Lopez 9d0038f2d7 started refactoring a bunch of stuff based on feedback 2016-06-03 12:56:29 +02:00
Kamil Trzcinski 717fdd6d42 Rename Ci::Build commit to pipeline 2016-06-03 12:29:00 +02:00
James Lopez 398f0071a6 merge hell 2016-06-03 11:17:46 +02:00
James Lopez 721014c927 Revert "Fix merge conflicts - squashed commit"
This reverts commit 3e99123095.
2016-06-03 11:10:17 +02:00
James Lopez 3e99123095 Fix merge conflicts - squashed commit
# Conflicts:
#	app/models/project.rb
2016-06-03 10:57:49 +02:00
Grzegorz Bizon a63ea487f7 Extend specs for builds badge
Related to #17549
2016-06-03 10:15:41 +02:00
Jacob Vosmaer fea591e5c5 Rename finder to find_in_gitlab_or_ldap 2016-06-02 13:42:18 +02:00
Jacob Vosmaer 8299fc277d Merge branch 'master' into git-http-controller
Conflicts:
	config/routes.rb
2016-06-02 13:31:11 +02:00
Douwe Maan 2d084dd848 Merge branch 'separate-banzai-references' into 'master'
Separate reference gathering from rendering

This is a required step to allow batch processing when gathering references. This in turn would allow grabbing (for example) all mentioned users of an issue/merge request using a single query.

cc @rspeicher @DouweM 

See merge request !3969
2016-06-01 15:51:59 +00:00
Douwe Maan 4a50e1f051 Merge branch 'current-settings-use-request-store-during-request' 2016-06-01 12:55:00 +02:00
ZJ van de Weg cbd7801b3d Merge branch 'master' into awardables 2016-05-30 18:54:08 +02:00
Grzegorz Bizon dbba60029c Improve note factory 2016-05-29 15:03:00 -04:00
Grzegorz Bizon e558edd1ce Update specs to carry out changes in note factory 2016-05-29 15:03:00 -04:00
DJ Mountney 7d57b11093 Update tests for the current_application_settings request store changes 2016-05-27 19:05:52 -07:00
Yorick Peterse 9bdfc98242 Merge branch 'measure-proxy-timing' into 'master'
Measure proxy flight time

See merge request !4278
2016-05-26 17:05:26 +00:00
Jacob Vosmaer 5771114f9b Rename metric to 'rails queue duration' 2016-05-26 17:53:21 +02:00
Yorick Peterse 94d5416db6
Added Gitlab::Lazy
This class can be used to lazy-evaluate blocks of code the first time
they're called. This can be useful when a method performs a certain
heavy operation (e.g. a SQL query) that you only want to perform
whenever the result is used for the first time.
2016-05-26 13:58:01 +02:00
Jacob Vosmaer 6ec2730fb3 Test ProxyFlightTime middleware 2016-05-25 16:37:18 +02:00
ZJ van de Weg 7ae536002a Merge branch 'master' into awardables 2016-05-25 14:41:25 +02:00
Robert Speicher 75739e54be Enable RSpec/NotToNot cop and auto-correct offenses
Also removes the note from the development/testing.md guide
2016-05-24 15:40:29 -04:00
Lin Jen-Shin 8c0b619d40 Split tests into their own classes 2016-05-24 17:30:36 +08:00
Lin Jen-Shin 1f5d55907a Merge the places where exceptions could be raised 2016-05-24 01:23:07 +08:00
Grzegorz Bizon 9e92b0eead Add specs for migration helpers and boolean values 2016-05-22 22:41:14 +02:00
Grzegorz Bizon 13bf612600 Test migration helpers using a migration class 2016-05-22 22:40:43 +02:00
Lin Jen-Shin 32eae15f2f It's for Message-ID so it should be message_id 2016-05-20 18:23:04 -05:00
Lin Jen-Shin c2bc15a766 Use the authentication_token for finding the user 2016-05-20 17:38:08 -05:00
Zeger-Jan van de Weg 79620c501d Update API and fetching task 2016-05-20 15:58:36 -05:00
Zeger-Jan van de Weg e166a8022a Backend for a gitignores dropdown 2016-05-20 15:58:36 -05:00
Lin Jen-Shin a7f6b75e7f Fix a missed rename 2016-05-20 15:36:25 -05:00
Jonas Weber 382e8cfef6 Infinity Bug in Commit Statistics
fixes #1548
2016-05-20 22:23:08 +02:00
Lin Jen-Shin 9436a444f3 Rename reply_key to mail_key 2016-05-20 13:05:57 -05:00
Lin Jen-Shin 4b341dea55 Actually there's no such case 2016-05-20 12:52:53 -05:00
Douwe Maan 18ef054bc7 Merge branch '17464-backport-email-syntax-highlighting' into 'master'
Syntax-highlight diffs in push emails

![image](/uploads/8ecbabc65382214b8de63aae24f66cea/image.png)

Based on:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/151



See merge request !4147
2016-05-19 21:12:53 +00:00
Robert Speicher 883e2d2187 Merge branch 'migration-helpers' into 'master'
Added helper methods for database migrations

These helpers can ultimately be used to write migrations that don't
require downtime.

See #15464 for more information.

See merge request !3860
2016-05-19 16:49:14 +00:00
Rubén Dávila 0c47b68d04 Mask credentials from URL when import of project has failed. 2016-05-18 21:16:36 -05:00
Lin Jen-Shin a7c823a573 Give ProjectNotFound when the project is not readable 2016-05-18 17:57:14 -05:00
Lin Jen-Shin c337e748d3 so we use separate classes to handle different tasks 2016-05-18 17:25:45 -05:00
Fatih Acet bb883387f9 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into awardables
# Conflicts:
#	app/controllers/projects/merge_requests_controller.rb
#	app/models/note.rb
#	db/schema.rb
#	spec/models/note_spec.rb
2016-05-18 13:05:53 -05:00
James Lopez 08f237516b Merge branches 'feature/project-export' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-import 2016-05-18 17:53:03 +02:00
James Lopez a5f04ad488 fixed CI commits on export 2016-05-18 17:48:15 +02:00
Sean McGivern a9977f2b7a Syntax-highlight diffs in push emails
Based on:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/151
2016-05-17 13:23:17 +01:00
Lin Jen-Shin 8156475ea5 Report better errors. TODO: Enable skipped test 2016-05-16 21:27:16 +00:00
Lin Jen-Shin a065c8d5d8 Create a new issue via: incoming+group/project+AUTH_TOKEN@... 2016-05-16 21:27:16 +00:00