Commit Graph

1541 Commits

Author SHA1 Message Date
Pawel Chojnacki c3a940000e Handles unsubscribe from notifications via email
- allows unsubscription processing of email in format "reply+%{key}+unsubscribe@acme.com" (example)
- if config.address includes %{key} and replies are enabled every unsubscriable message will include mailto: link in its List-Unsubscribe header
2017-01-13 10:11:46 -05:00
Douwe Maan 764fc0dd69 Merge branch 'zj-unadressable-url-variables' into 'master'
Do not check for valid url for .gitlab-ci.yml

Closes #22970

See merge request !8451
2017-01-12 18:19:11 +00:00
Horacio Sanson f986b4c4e5 Add support for PlantUML diagrams in Asciidoc.
This MR enables rendering of PlantUML diagrams in Asciidoc documents. To add a
PlantUML diagram all we need is to include a plantuml block like:

```
[plantuml, id="myDiagram", width="100px", height="100px"]
--
bob -> alice : ping
alice -> bob : pong
--
```

The plantuml block is substituted by an HTML img element with *src* pointing to
an external PlantUML server.

This MR also add a PlantUML integration section to the Administrator -> Settings
page to configure the PlantUML rendering service and to enable/disable it.

Closes: #17603
2017-01-12 10:04:52 +00:00
Grzegorz Bizon cff423449f Fix Rubocop offenses in LDAP related code and spec 2017-01-10 14:31:21 +01:00
Adam Niedzielski 82692ea214 Restore backup correctly when "BACKUP" environment variable is passed 2017-01-09 18:38:53 +01:00
Rémy Coutable 6056903265 Merge branch 'feature/log-ldap-to-application-log' into 'master'
Log LDAP blocking/unblocking events to application log

See merge request !8042
2017-01-09 13:39:19 +00:00
Sean McGivern cb4964d23b Merge branch 'track_last_used_date_of_ssh_keys' into 'master'
Record and show last used date of SSH Keys

See merge request !8113
2017-01-09 10:30:49 +00:00
Vincent Wong b6df93a51f Record and show last used date of SSH Keys
Addresses: Issue #13810

1. Adds a last_used_at attribute to the Key table/model
2. Update a key's last_used_at whenever it gets used
3. Display how long ago an ssh key was last used
2017-01-09 04:15:39 +11:00
Drew Blessing de4eee0894 LDAP attributes needs default values 2017-01-06 00:24:33 -06:00
Z.J. van de Weg 6ef6f9f205 Do not check for valid url for .gitlab-ci.yml
Until this commit, GitLab would check if the URL in your .gitlab-ci.yml
would be valid and adressable. However, this approach is rather limited.

To begin, the URL couldn't be http://example:$PORT/my-project, as the
PORT value would be interpolated after checking if the URL was valid,
which its not. Also this gem will limit the amount of protocols allowed.

This commit doesn't check, at all, if the URL is valid. This is now the
responsablilty of the user. In my opion this is right, as the user
ultimately benefits from a correct URL, but also, its impossible to
cover all cases.
2017-01-05 19:59:10 +01:00
Robert Speicher 2e20a71d21 Ensure internal Gitlab::Git references use the namespace 2017-01-04 19:09:29 -05:00
Robert Speicher a00578ce5c Absorb gitlab_git 2017-01-04 19:09:28 -05:00
Drew Blessing babb7d5260 Gitlab::LDAP::Person uses LDAP attributes configuration
We allow users to configure LDAP attribute preferences. For example,
email can be configured to use `mail`, `email` and `userPrincipalName`,
falling through to the next until a value is found. Prior to this
change, Gitlab::LDAP::Person did not honor this configuration. Now,
the class will honor `name` and `mail` configuration. It does not
handle `username`, or fallback to `first_name` + `last_name` in the
absence of `name`.
2017-01-03 13:26:47 -06:00
Douwe Maan 20afb4c69e Merge branch 'feature/1376-allow-write-access-deploy-keys' into 'master'
Allow to add deploy keys with write-access

Closes #1376

See merge request !7383
2016-12-27 15:00:49 +00:00
Douwe Maan d6a37a8cef Merge branch 'bugfix/outlook-language-parsing' into 'master'
Switch to Discourse's EmailReplyTrimmer for more robust reply parsing

See merge request !7473
2016-12-27 14:46:47 +00:00
Sean McGivern 1e5e56c698 Fix MR with files hidden by .gitattributes
Don't try to highlight and cache files hidden by .gitattributes entries.
2016-12-26 16:25:55 +00:00
Sean McGivern 0ebd50ce00 Merge branch 'feature/more-storage-statistics' into 'master'
Add more storage statistics

See merge request !7754
2016-12-26 09:48:30 +00:00
Z.J. van de Weg b7894a7451 Fix errorcode 500 on slash commands
Coverage was failing, so this could slip through the cracks
2016-12-23 09:46:32 +01:00
http://jneen.net/ f02f238d52 Revert "allow empty-quotes"
This reverts commit 4f2f678aff8d7dfcac96c47cf7eb480a5707ddaf.
2016-12-21 09:51:42 -08:00
http://jneen.net/ 602c319862 allow empty-quotes 2016-12-21 09:51:41 -08:00
http://jneen.net/ 03753ff146 remove trailing whitespace from email bodies 2016-12-21 09:51:41 -08:00
http://jneen.net/ a3bb2463c4 switch to email_reply_trimmer from discourse 2016-12-21 09:51:39 -08:00
Yorick Peterse c9fdf739b2 Merge branch '25908-fix-grape-after-update' into 'master'
Use Grape's new Route methods

See merge request !8223
2016-12-21 15:53:19 +00:00
Markus Koller 3ef4f74b1a
Add more storage statistics
This adds counters for build artifacts and LFS objects, and moves
the preexisting repository_size and commit_count from the projects
table into a new project_statistics table.

The counters are displayed in the administration area for projects
and groups, and also available through the API for admins (on */all)
and normal users (on */owned)

The statistics are updated through ProjectCacheWorker, which can now
do more granular updates with the new :statistics argument.
2016-12-21 16:39:49 +01:00
Rémy Coutable 7e5deb6abe Merge branch 'multipart-uploaded-file' into 'master'
Inject ::UploadedFile from Multipart middleware

Closes #25888

See merge request !8215
2016-12-21 13:38:04 +00:00
Rémy Coutable 90c6a1a319 Use Grape's new Route methods
- Use Route#request_method instead of Route#route_method
- Use Route#path instead of Route#route_path

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-21 13:46:52 +01:00
Jacob Vosmaer 4ec259fd36 Inject ::UploadedFile from Multipart middleware
I mistakenly concluded Rack::Multipart injects File instances into the
params. These should be UploadedFile instances. This reuses a mock
UploadedFile class we already had in GitLab.
2016-12-21 13:07:53 +01:00
James Lopez 5452747729 Fix error importing label priorities and added relevant spec 2016-12-21 10:33:20 +01:00
Douglas Barbosa Alexandre d1bf557aac Rename MattermostNotificationService back to MattermostService 2016-12-20 19:42:13 -02:00
Douglas Barbosa Alexandre fed29117de Rename SlackNotificationService back to SlackService 2016-12-20 19:42:13 -02:00
Markus Koller bd0c171c55
fixup! Log messages when blocking/unblocking LDAP accounts 2016-12-20 19:54:37 +01:00
Markus Koller e87e280598
Log messages when blocking/unblocking LDAP accounts 2016-12-20 19:51:45 +01:00
Lin Jen-Shin 884f57c910 Use consistent names and move checks to the method,
and move those checks to be private. Feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_20285012

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_20285279
2016-12-20 21:19:07 +08:00
Lin Jen-Shin 0f0738e788 Merge remote-tracking branch 'upstream/master' into feature/1376-allow-write-access-deploy-keys
* upstream/master: (538 commits)
  Reject blank environment vcariables in Gitlab::Git::RevList
  Add online terminal documentation
  Add changelog entry
  Add terminal UI and controller actions
  Fix specs
  Even out padding on plus button in breadcrumb menu
  Update font size of detail page header to 14px
  Update CHANGELOG.md for 8.13.10
  Update CHANGELOG.md for 8.14.5
  Fix Route#rename_children behavior
  Remove inline-block styling from status
  Add terminals to the Kubernetes deployment service
  Add a ReactiveCaching concern for use in the KubernetesService
  Add xterm.js 2.1.0 and a wrapper class to the asset pipeline
  Remove unnecessary hidden svg elements for icons.
  Fix consistent typo in environment.js
  Use a block to insert extra check for authenticate_build!
  Align milestone column header with count number
  Add Wiki import to BB importer
  Make CI badge hitboxes better match container
  ...
2016-12-20 20:54:40 +08:00
Rémy Coutable 367b68a01d Merge branch '22348-gitea-importer' into 'master'
It adds a brand new importer for Gitea!

This is a continuation of !6945 started by @bkc.

Gitea aims to be 100% GitHub-compatible but there's a few differences:

- Gitea is not an OAuth provider (yet): https://github.com/go-gitea/gitea/issues/27
  - This means we cannot map Gitea users given an assignee ID => assignees are not set on imported issues and merge requests
- No releases API for now: https://github.com/go-gitea/gitea/issues/330
- API version is `v1` (GitHub is `v3`)
- The IID field for milestones is `id` compared to `number` in GitHub.
- Issues, PRs, milestones, labels don't have a `url` field (the importer now fallback to `''` in that case)

**Known issues:**

- Comments are not imported because comments JSON always have a blank `html_url`/`issue_url`/`pull_request_url`, so the IID cannot be extracted and the issuable cannot be found... :( This is tracked in https://github.com/go-gitea/gitea/issues/401, and solved by https://github.com/gogits/gogs/pull/3624 but this needs to be submitted / merged in Gitea.

This is noted in the documentation.

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

1. I've made `Import::GiteaController` inherit from `Import::GithubController` since both controllers should be identical in the long-term and their current differences are small.
1. I've added a base `IssuableFormatter` class from which `IssueFormatter` & `PullRequestFormatter` inherit
1. I've added shared examples for GitHub/Gitea importer classes
1. I've made `Gitlab::ImportSources` more robust and tested! 🎄 
1. I've added routing specs for import routes! 🎄 

Closes #22348

See merge request !8116
2016-12-20 11:11:24 +00:00
Kamil Trzciński 7607226026 Merge branch '22864-kubernetes-deploy-with-terminal' into 'master'
Add online terminal support for Kubernetes

## What does this MR do?

Gives terminal access to kubernetes-deployed environments  via the deployment service

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

## Why was this MR needed?

Part of idea to production

## Screenshots (if relevant)

### `/root/reviewing/environments`

![Screen_Shot_2016-12-15_at_19.10.40](/uploads/bd2c54c07b6c85dec3328a20cd185b64/Screen_Shot_2016-12-15_at_19.10.40.png)

### `/root/reviewing/environments/10013`

![Screen_Shot_2016-12-19_at_12.52.39](/uploads/db4e4e06cda88437e8727433d65898b9/Screen_Shot_2016-12-19_at_12.52.39.png)

### `/root/reviewing/enviroments/10013/terminal`

![Screen_Shot_2016-12-15_at_02.35.52](/uploads/1bb77b7e2de2c657ae3bda62dc4f0970/Screen_Shot_2016-12-15_at_02.35.52.png)

## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
  - [X] Added for this feature/bug
  - [x] All builds are passing
- [X] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [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 it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

* Closes #22864 #22958
* Alternative to, and somewhat based on,  !6770 
* Depends on https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/83

See merge request !7690
2016-12-20 10:34:29 +00:00
Sean McGivern deb74f73d9 Merge branch '25848-fix-git-rev-list-env-parsing' into 'master'
Reject blank environment variables in Gitlab::Git::RevList

Closes #25848

See merge request !8189
2016-12-20 10:14:20 +00:00
Grzegorz Bizon 52278412c7 Merge branch 'zj-kamil-slack-slash-commands' into 'master'
Slack slash commands

## What does this MR do?

Implement Slack Slash Commands by utilizing generalized Mattermost presenter to fulfill Slack requirements.

## Why was this MR needed?

We want to expose Slack Slash Commands as a first-class service.

## What are the relevant issue numbers?

Supersedes !8007  
Closes #22182

See merge request !8126
2016-12-20 09:41:37 +00:00
Rémy Coutable 212967aefb
Reject blank environment vcariables in Gitlab::Git::RevList
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-20 09:45:37 +01:00
Douglas Barbosa Alexandre d1d1e7c6d7 Merge branch 'bb-wiki-import' into 'master'
Add Wiki import to BB importer

## What does this MR do?

Adds wiki importing



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

## What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/25819

See merge request !8180
2016-12-19 21:31:29 +00:00
Nick Thomas c3d972f4e8 Add terminals to the Kubernetes deployment service 2016-12-19 19:53:04 +00:00
Grzegorz Bizon 5048baaa37 Merge branch 'fix-yaml-variables' into 'master'
Convert CI YAML variables keys into strings

So that this would be more consistent with the other variables,
which all of them are string based.

Closes #25554

See merge request !8088
2016-12-19 19:09:04 +00:00
Valery Sizov 5b0ebbe5b4 Add Wiki import to BB importer 2016-12-19 20:48:08 +02:00
Rémy Coutable 8c8c4f8c5a Merge branch 'fix/import-export-mr-error' into 'master'
Fix import/export merge requests error

When MWBS is set and the MR exported/imported an error gets thrown. We should ignore this so it can succeed as the merge user may no longer exist in the target instance.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/24009 and https://gitlab.com/gitlab-com/support-forum/issues/1345

See merge request !8134
2016-12-19 18:03:06 +00:00
Rémy Coutable ab06313c36 Add Project#gitea_import?
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-19 17:35:51 +01:00
Rémy Coutable 8fc63d1f64 Improve Gitlab::ImportSources
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-19 17:35:51 +01:00
Rémy Coutable 99ddd1dcbe Modify GithubImport to support Gitea
The reason is that Gitea plan to be GitHub-compatible so it makes sense
to just modify GitHubImport a bit for now, and hopefully we can change
it to GitHubishImport once Gitea is 100%-compatible.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-19 17:35:51 +01:00
James Lopez 0631c7bcdc Fix MR issue to do with merge user 2016-12-19 16:52:38 +01:00
James Lopez 786457ca3e
Fix for missing service when importing from EE to CE
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-19 16:32:26 +01:00
Lin Jen-Shin 4d8a2bc987 Fix tests because now we don't convert values 2016-12-19 23:32:09 +08:00