Commit Graph

1033 Commits

Author SHA1 Message Date
Sean McGivern ce7eb4e492 Add more tests for conflicts 2016-08-12 23:24:48 +03:00
Sean McGivern ac9229a31b Clarify Conflict::File#sections method 2016-08-12 23:24:48 +03:00
Sean McGivern 52eb523c9b Add blob_icon to conflict file JSON 2016-08-12 23:24:47 +03:00
Sean McGivern e50e88b85c Add blob_path to conflict file JSON 2016-08-12 23:24:47 +03:00
Sean McGivern 3b84cfdc74 Use same resolution format on FE and BE 2016-08-12 23:24:46 +03:00
Sean McGivern 261d47bce9 Fix specs
- Add match line header to expected result for `File#sections`.
- Lowercase CSS colours.
- Remove unused `diff_refs` keyword argument.
- Rename `parent` -> `parent_file`, to be more explicit.
- Skip an iteration when highlighting.
2016-08-12 23:24:46 +03:00
Sean McGivern 18398152fa Raise errors for large and binary files 2016-08-12 23:24:44 +03:00
Sean McGivern 7af277f683 Auto-highlight conflict when rich_text is called 2016-08-12 23:24:43 +03:00
Sean McGivern 14a4b17d1c Allow resolving conflicts in MR controller 2016-08-12 23:24:43 +03:00
Sean McGivern a1c7961217 Handle multiple merge conflict files in collection 2016-08-12 23:24:43 +03:00
Sean McGivern df2ed097b7 Add backend for merge conflicts reading 2016-08-12 23:24:43 +03:00
Scott Le 6109daf480 api for generating new merge request
DRY code + fix rubocop

Add more test cases

Append to changelog

DRY changes list

find_url service for merge_requests

use GET for getting merge request links

remove files

rename to get_url_service

reduce loop

add test case for cross project

refactor tiny thing

update changelog
2016-08-11 23:37:00 +07:00
Kamil Trzcinski 39203f1adf Pre-create all builds for Pipeline when a trigger is received
This change simplifies a Pipeline processing by introducing a special new status: created.
This status is used for all builds that are created for a pipeline.
We are then processing next stages and queueing some of the builds (created -> pending) or skipping them (created -> skipped).
This makes it possible to simplify and solve a few ordering problems with how previously builds were scheduled.
This also allows us to visualise a full pipeline (with created builds).

This also removes an after_touch used for updating a pipeline state parameters.
Right now in various places we explicitly call a reload_status! on pipeline to force it to be updated and saved.
2016-08-11 15:22:35 +02:00
Douwe Maan ae63f152c3 Merge branch 'feature/svg-badge-template' into 'master'
Use badge image template instead of using separate images

## What does this MR do?

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

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

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

## Why was this MR needed?

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

## What are the relevant issue numbers?

#3714

## Screenshots (if relevant)

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

## Does this MR meet the acceptance criteria?

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

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

## What does this MR do?

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

## What are the relevant issue numbers?

Fixes #15528

Fixes #17766

Fixes #19310

Fixes #19439

Fixes #19998

Fixes #20153

Fixes #20552

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

#20385

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

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

See merge request !5630
2016-08-09 23:26:15 +00:00
Douwe Maan ee721e12ab Merge branch 'brodock/gitlab-ce-feature/redis-sentinel'
# Conflicts:
#	lib/gitlab/redis.rb
2016-08-09 18:22:26 -05:00
Robert Speicher d31ff28c69 Merge branch 'fix/import-mr-source' into 'master'
Fix importing with an invalid MR source project

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

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

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

## What does this MR do?

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

## Why was this MR needed?

See #20698

## What are the relevant issue numbers?

Closes #20698

## Does this MR meet the acceptance criteria?

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

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

## What does this MR do?

This MR enabled two additional Rubocop cops:

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

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

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

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

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


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

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

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

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

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

This MR was created following !1979 and !1978

Closes #14898

See merge request !1980
2016-08-05 00:50:32 +00:00
Douglas Barbosa Alexandre 1e736fb527 Allow users to import cross-repository pull requests from GitHub 2016-08-04 17:16:50 -03:00
Douglas Barbosa Alexandre 51cf14b37c Does not need to disable GitHub webhooks since PRs are check out locally 2016-08-04 17:16:50 -03:00
tiagonbotelho 482d7802cc changes default_branch_protection to allow devs_can_merge protection option aswell 2016-08-04 21:15:26 +01:00
Gabriel Mazetto 6f31879508 Fixed specs for Gitlab::Redis and code for Redis Sentinel support 2016-08-04 18:55:37 +02:00
Gabriel Mazetto ef6043880e Specs for RedisConfig
Make sure :url is not present on RedisConfig.params after parsing
2016-08-04 18:55:37 +02:00
Jacob Vosmaer e55e224cd9 Fix ArgumentError in GitAccess specs 2016-08-04 15:22:34 +02:00
Rémy Coutable d3c1e93d55 Merge branch '20527-fork-commits-have-impact-on-original-project' into 'master'
Don’t close issues on original project

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

See merge request !1981
2016-08-04 13:06:38 +00:00
Paco Guzman fa54a8e984 Don’t close issues on original project from a fork
Signed-off-by: Paco Guzman <pacoguzmanp@gmail.com>
2016-08-04 12:38:08 +02:00
Rémy Coutable ae83801cd5 Merge branch 'fix/import-error' into 'master'
Fix Import/Export error checking versions

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

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

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

See merge request !5638
2016-08-04 10:09:18 +00:00
James Lopez f87eb25020 Fix Import/Export error checking versions 2016-08-03 13:00:34 +02:00
Grzegorz Bizon c7b31e4029 Enable some Rubocop cops related to new lines 2016-08-03 12:02:41 +02:00
Paco Guzman c86c1905b5 switch from diff_file_collection to diffs
So we have raw_diffs too
2016-08-03 07:00:20 +02:00
Paco Guzman 1d0c7b7492 Introduce Compare model in the codebase.
This object will manage Gitlab::Git::Compare instances
2016-08-03 07:00:20 +02:00
Paco Guzman 8f359ea917 Move to Gitlab::Diff::FileCollection
Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
2016-08-03 07:00:20 +02:00
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