Commit Graph
2612 Commits
Author SHA1 Message Date
Robert Speicher d453b24aca Merge branch 'validate-readme-format' into 'master'
Validate README format

Take the first previewable README file as project's README, otherwise if
none file is available, or we can't preview any of them, we assume that
project doesn't have a README file.

Fixes #3978
2016-01-05 17:03:24 -05:00
Douwe Maan 8de1f7159c Merge branch 'mikew1/gitlab-ce-better-asana-refs' into 'master'
Better support for referencing and closing issues in asana_service.rb (by @mikew1)



See merge request !2302
2016-01-05 16:10:16 +00:00
Douwe Maan 07c39c9976 Merge branch 'brunsa2/gitlab-ce-diverging-branch-graphs' into 'master'
Add graphs of commits ahead/behind default branch (by @brunsa2)

Replaces https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1716

See merge request !2301
2016-01-05 15:44:22 +00:00
Douglas Barbosa Alexandre 6ce01ca3ec Validate README format before displaying
Take the first previewable README file as project’s README, otherwise
if none file is available, or we can’t preview any of them, we assume
that project doesn’t have a README file.
2016-01-05 11:06:18 -02:00
Robert Speicher 46a220ae3c Add AbuseReport#notify
Tell, Don't Ask.
2016-01-04 18:59:42 -05:00
Dmitriy Zaporozhets e586492e48 Merge branch 'rs-issue-201' into 'master'
Prevent duplicate "username has already been taken" validation message

Closes #201 - two-year-old bug, woo! 💥 🎉

See merge request !2279
2016-01-04 17:20:38 +00:00
Stan Hu 561acdebf8 Merge branch 'extra-system-hooks' into 'master'
Added system hooks messages for renaming and transferring a project

This is work in progress but I wanted to get some feedback on it in case there is something I've missed or a better way to do it.

As the title says when a project is renamed or transferred to another group a system hook message is generated.

Currently adds a couple of extra properties to the standard project system hooks messages.

old_path_with_namespace - The old path of the project so we can see what has been renamed / transferred
changed_at - The time that change took place

My main concern is if there is a better way of doing this than passing the extra_data variable into the system hook.  Would it be better to extend the project model with these 2 items as transient properties as I doubt they would need to be saved to the database?  The other 

I've also seen, but can't find, someone talking about the emails sent when a project is renamed or transferred doesn't reference the original project path so if you have similarly named projects then you might not know what has been moved.  I think the extra_data (or however it is best to implement this) would allow the extra information to be sent in emails.

Closes [System hooks for project transfer and repository rename](http://feedback.gitlab.com/forums/176466-general/suggestions/6006233-system-hooks-for-project-transfer-and-repository-r)


See merge request !611
2016-01-04 15:39:52 +00:00
Mike Wyatt bb6b793c55 Don't log backtrace in Asana service 2016-01-04 11:19:39 -04:00
Valery Sizov 8b18449125 remove public field from namespace and refactoring 2016-01-04 16:00:29 +02:00
Steve Norman 79ec7f2897 Added system hooks messages for renaming and transferring a project 2016-01-04 13:48:00 +00:00
Robert Speicher fd178c1e7d Prevent duplicate "username has already been taken" validation message
Closes #201 - two-year-old bug, woo! 💥 🎉
2016-01-02 20:03:28 -05:00
Mike Wyatt cf4ccdda27 Merge remote-tracking branch 'upstream/master' into better-asana-refs
* upstream/master: (307 commits)
  Update CHANGELOG
  spinach fix
  Updated allocations Gem to version 1.0.3
  Removed various default metrics tags
  Update CHANGELOG
  Fix "I see current user as the first user" step
  Swap Author and Assignee Selectors on issuable index view
  Update CHANGELOG
  Make sure that is no pending migrations in Gitlab::CurrentSettings
  Added additional config environmental variables to help Debian packaging
  We don't use whenever anymore. Lets remove the schedule file
  Fix project transfer e-mail sending incorrect paths in e-mail notification
  Update CHANGELOG
  Use Gitlab::CurrentSettings for InfluxDB
  Write to InfluxDB directly via UDP
  Strip newlines from obfuscated SQL
  Add hotfix that allows to access build artifacts created before 8.3
  note votes methids implementation
  When reCAPTCHA is disabled, allow registrations to go through without a code
  Downcased user or email search for avatar_icon.
  ...
2015-12-31 18:45:55 -04:00
Grzegorz Bizon 333d3d9e5d Merge branch 'fix/missing-ci-build-traces' into 'master'
Hotfix for builds trace data integrity

Closes #4246

See merge request !2224
2015-12-30 06:54:27 +00:00
Mike Wyatt 9e7a88f089 Better handling of errors in Asana service
[ci skip]
2015-12-30 00:52:56 -04:00
Mike Wyatt 7b98d0e1a2 Update Asana service documentation 2015-12-30 00:51:05 -04:00
Mike Wyatt 6eb273a11c Restore colon in Asana comment 2015-12-30 00:50:44 -04:00
Mike Wyatt d67f697d9e Merge remote-tracking branch 'origin/master' into better-asana-refs
* origin/master:
  Use lazy reference extractor to get issue's MRs
  Banzai::XFilter -> Banzai::Filter::XFilter
  Move Markdown/reference logic from Gitlab::Markdown to Banzai
2015-12-30 00:33:15 -04:00
Stan Hu 59533d47dd Fix project transfer e-mail sending incorrect paths in e-mail notification
The introduction of ActiveJob and `deliver_now` in 7f214cee7 caused a race
condition where the mailer would be invoked before the project was committed
to the database, causing the transfer e-mail notification to show the old
path instead of the new one.

Closes #4670
2015-12-29 13:49:44 -08:00
Mike Wyatt e8080fc8fb Fix error in Asana service 2015-12-29 16:00:36 -04:00
Mike Wyatt 12ec1e3c40 Update Asana service to work with Personal Access Token, lessen number of requests to Asana API 2015-12-29 15:39:58 -04:00
Mike Wyatt 2cd2c54bd1 Update Asana field descriptions 2015-12-29 15:37:48 -04:00
Valery Sizov eeba266e3d Merge branch 'upvote_count_to_api' into 'master'
Revert upvotes and downvotes params back to MR API

issue https://gitlab.com/gitlab-org/gitlab-ce/issues/3672

See merge request !2212
2015-12-29 16:07:12 +00:00
Grzegorz Bizon 504696453b Add hotfix that allows to access build artifacts created before 8.3
This is a temporary hotfix that allows to access build artifacts created
before 8.3. See #5257.

This needs to be changed after migrating CI build files.

Note that `ArtifactUploader` uses `artifacts_path` to create a storage
directory before and after parsisting `Ci::Build` instance, before and
after moving a file to store (save and fetch a file).
2015-12-29 09:51:19 +01:00
Valery Sizov d3807328d8 note votes methids implementation 2015-12-29 10:11:20 +02:00
Gabriel Mazetto a3469d914a reCAPTCHA is configurable through Admin Settings, no reload needed. 2015-12-28 18:50:29 -02:00
Grzegorz Bizon 42592201d9 Hotfix for builds trace data integrity
Issue #4246
2015-12-28 15:28:39 +01:00
Dmitriy Zaporozhets 08b4d8b6ac Merge branch 'disable-git-follow' into 'master'
Disable --follow in `git log` to avoid loading duplicate commit data in infinite scroll

`git` doesn't work properly when `--follow` and `--skip` are specified together. We could even be **omitting commits in the Web log** as a result.

Here are the gory details. Let's say you ran:

```
git log -n=5 --skip=2 README
```

This is the working case since it omits `--follow`. This is what happens:

1. `git` starts at `HEAD` and traverses down the tree until it finds the top-most commit relevant to README.
2. Once this is found, this commit is returned via `get_revision_1()`.
3. If the `skip_count` is positive, decrement and repeat step 2. Otherwise go onto step 4.
4. `show_log()` gets called with that commit.
5. Repeat step 1 until we have all five entries.

That's exactly what we want. What happens when you use `--follow`? You have to understand how step 1 is performed:

* When you specify a pathspec on the command-line (e.g. README), a flag `prune` [gets set here](https://github.com/git/git/blob/master/revision.c#L2351).
* If the `prune` flag is active, `get_commit_action()` determines whether the commit should be [scanned for matching paths](https://github.com/git/git/blob/master/revision.c#L2989).
* In the case of `--follow`, however, `prune` is [disabled here](https://github.com/git/git/blob/master/revision.c#L2350).
* As a result, a commit is never scanned for matching paths and therefore never pruned. `HEAD` will always get returned as the first commit, even if it's not relevant to the README.
* Making matters worse, the `--skip` in the example above would actually skip a every other entry after `HEAD` N times. If README were changed in these skipped commits, we would actually miss information!

Since git uses a matching algorithm to determine whether a file was renamed, I
believe `git` needs to generate a diff of each commit to do this and traverse
each commit one-by-one to do this. I think that's the rationale for disabling
the `prune` functionality since you can't just do a simple string comparison.

Closes #4181, #4229, #3574, #2410

See merge request !2210
2015-12-28 12:05:55 +00:00
Valery Sizov 83d42c1518 Revert upvotes and downvotes params to MR API 2015-12-28 11:41:16 +02:00
Robert Speicher a97a2d2720 Merge branch 'mention-all' into 'master'
Only allow group/project members to mention `@all`

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

See merge request !2205
2015-12-27 21:09:16 +00:00
Dmitriy Zaporozhets fd231ff9fb Merge branch 'revert_votes_back' into 'master'
Revert vote buttons back to issue and MR pages

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



/cc @dzaporozhets @JobV 


![joxi_screenshot_1450809309400](/uploads/379a75505e0d5f24e743aa0a6a6684e2/joxi_screenshot_1450809309400.png)


See merge request !2206
2015-12-25 15:52:06 +00:00
Douwe Maan 7d5b51f387 Merge branch 'rs-opengraph' into 'master'
Add Open Graph meta tags



See merge request !2192
2015-12-25 13:41:55 +00:00
Valery SizovandValery Sizov a1b63e1252 revert back vote buttons to issue and MR pages 2015-12-25 14:11:19 +02:00
Stan Hu ff8cd116a0 Disable --follow in git log to avoid loading duplicate commit data in infinite scroll
`git` doesn't work properly when `--follow` and `--skip` are specified together. We could even be **omitting commits in the Web log** as a result.

Here are the gory details. Let's say you ran:

```
git log -n=5 --skip=2 README
```

This is the working case since it omits `--follow`. This is what happens:

1. `git` starts at `HEAD` and traverses down the tree until it finds the top-most commit relevant to README.
2. Once this is found, this commit is returned via `get_revision_1()`.
3. If the `skip_count` is positive, decrement and repeat step 2. Otherwise go onto step 4.
4. `show_log()` gets called with that commit.
5. Repeat step 1 until we have all five entries.

That's exactly what we want. What happens when you use `--follow`? You have to understand how step 1 is performed:

* When you specify a pathspec on the command-line (e.g. README), a flag `prune` [gets set here](https://github.com/git/git/blob/master/revision.c#L2351).
* If the `prune` flag is active, `get_commit_action()` determines whether the commit should be [scanned for matching paths](https://github.com/git/git/blob/master/revision.c#L2989).
* In the case of `--follow`, however, `prune` is [disabled here](https://github.com/git/git/blob/master/revision.c#L2350).
* As a result, a commit is never scanned for matching paths and therefore never pruned. `HEAD` will always get returned as the first commit, even if it's not relevant to the README.
* Making matters worse, the `--skip` in the example above would actually skip every other after `HEAD` N times. If README were changed in these skipped commits, we would actually miss information!

Since git uses a matching algorithm to determine whether a file was renamed, I
believe `git` needs to generate a diff of each commit to do this and traverse
each commit one-by-one to do this. I think that's the rationale for disabling
the `prune` functionality since you can't just do a simple string comparison.

Closes #4181, #4229, #3574, #2410
2015-12-25 01:28:33 -08:00
Robert Speicher ab3d855c0e Add support for twitter:label meta tags 2015-12-24 17:11:08 -05:00
Gabriel Mazetto 33964469b3 WIP require two factor authentication 2015-12-24 19:00:18 -02:00
Douwe Maan 43a3a401bd Merge branch 'master' into mention-all 2015-12-24 20:34:19 +01:00
Robert Speicher 1042c16b4b Merge branch 'master' of github.com:gitlabhq/gitlabhq 2015-12-24 14:00:29 -05:00
Douwe Maan 835333c426 Merge branch 'ldap-special-chars-fix' into 'master'
Fix identity and user retrieval when special characters are used

Fixes #4023

I also added tests to make sure the user with special characters in his name is returned correctly.

@rspeicher this probably should be added to 8.3 as a patch.

See merge request !2176
2015-12-24 16:35:00 +00:00
Dmitriy Zaporozhets 7caaa10807 Merge pull request #9915 from huacnlee/avoid-ability-methods-allocations
Avoid allocations in Ability class.
2015-12-24 16:28:03 +01:00
Douwe Maan 672cbbff95 Only allow group/project members to mention @all 2015-12-24 15:33:51 +01:00
Dmitriy Zaporozhets 1f9633d67c Merge branch 'fix-milestones-with-slashes' into 'master'
Fix Error 500 when global milestones have slashes

* Closes #4226

* Closes https://github.com/gitlabhq/gitlabhq/issues/9921

See merge request !2182
2015-12-24 13:04:43 +00:00
Dmitriy Zaporozhets 76b7e24f85 Merge branch 'edit-on-fork' into 'master'
Automatically fork a project when not allowed to edit a file.

Fixes #3215.

To do:

- [ ] Add tests

-----

## "Edit" button on file in a project the user does NOT have write access to

![edit_file](/uploads/7602157420768aef483a6586bba2d164/edit_file.png)

## Clicking will automatically create a fork

![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png)

## When the fork has been created, the user is returned to the edit page on the original project with a notice

![edit_notice](/uploads/94ed1319404370ff1e9c0d672fb41e03/edit_notice.png)

## The user cannot change the target branch and is informed that editing will start an MR

![edit_footer](/uploads/4da68d4795c7177e575b7c434d16eeae/edit_footer.png)

## Hitting "Commit changes" will commit and start an MR from my fork to the origin project

![Screen_Shot_2015-12-17_at_23.38.08](/uploads/d777a4db6f38a5a1be84031694465bc1/Screen_Shot_2015-12-17_at_23.38.08.png)

-----

## "Create file, "Upload file" and "New directory" buttons in a project the user does NOT have write access to

![new_directory](/uploads/72f556248f30d6652523bbb4be01b3e0/new_directory.png)

## Clicking any of these options will automatically create a fork

![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png)

## When the fork has been created, the user is returned to the tree page on the original project with a notice

![new_directory_notice](/uploads/a1a3e11308ae0e8f0913fae6813a37ed/new_directory_notice.png)

## Clicking "New directory" again will show the modal. The user cannot change the target branch and is informed that editing will start an MR

![new_dir](/uploads/99ca8cbfb2f70603e352b3fdf67b6281/new_dir.png)

## Hitting "Create directory" will commit and start an MR from my fork to the origin project

![Screen_Shot_2015-12-17_at_23.39.19](/uploads/3713d0235abf831361b803a6198c5bc1/Screen_Shot_2015-12-17_at_23.39.19.png)

cc @dzaporozhets @skyruler

See merge request !2145
2015-12-24 12:24:57 +00:00
Douwe Maan 84e75ebd4c Merge branch 'fix/visibility-level-setting-in-forked-projects' into 'master'
Fix/visibility level setting in forked projects

Fixes #3136

/cc @DouweM 

See merge request !1744
2015-12-24 12:09:38 +00:00
Grzegorz Bizon 3e6950481a Use method that creates runners registration token
`runners_registration_token` now creates a new token if it is blank.
2015-12-23 11:45:17 +01:00
Grzegorz Bizon 37731ba1a1 Add method that persist ensured token in TokenAuthenticatable 2015-12-23 10:47:18 +01:00
Grzegorz Bizon 76f7e80455 Fix method that ensures authentication token
Until now, `ensure_#{token_filed_name}` method didn't persist new token in database.

This closes #4235.
2015-12-23 09:37:01 +01:00
Stan Hu 34695569da Fix Error 500 when global milestones have slashes
Closes #4226
2015-12-22 13:15:32 -08:00
Patricio Cano 1d3889eb46 Fix identity and user retrieval when special characters are used 2015-12-22 13:23:35 -05:00
Kamil Trzcinski a495b9bc18 Deprecate GitLabCiService making it to always be inactive 2015-12-22 00:28:38 +01:00
Robert Speicher 12b6bf5c57 Merge branch 'fix-issue-related-mrs' into 'master'
Fix issue related cross-project MRs

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

See merge request !2163
2015-12-21 17:54:45 +00:00