Commit Graph
1770 Commits
Author SHA1 Message Date
Sean McGivern 5eb9cb68f7 Fix images in emails 2016-06-16 11:47:01 +01:00
Jacob Schatz 1a832c8f00 Merge branch 'network-assets' into 'master'
Replace raphael-rails with raphael.js and split it from the rest of the JS

## What does this MR do?

Removes raphael.js and its related libraries from the default JS bundle.

It also removes raphael-rails because the gem is unmaintained and – for whatever reason – didn't want to cooperate with the way I was trying to require it.

This brings the default (compressed and minified) application.js from 354KB after the d3 MR (!4394) down to 324KB.

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

That tests pass and that there aren't errors on any pages (especially the Network page).

## Why was this MR needed?

It's only used on the Network page and was using way too much bandwidth for just one page.

## What are the relevant issue numbers?

#14372 #13165 

Follow-up to !4394 and !4516.

cc: @jschatz1 

See merge request !4519
2016-06-15 21:11:31 +00:00
Rémy Coutable be09845914 Merge branch 'environments-and-deployments' into 'master'
Add environments and deployments

This MR is a continuation of https://gitlab.com/gitlab-org/gitlab-ce/issues/17009.

The current implementation is as follow:
1. We have two new tables: `environments` and `deployments`.
2. We have a new tab: `Environments` under `Pipelines` where you can see all you environments and add a new one.
3. We add a new option to `.gitlab-ci.yml` to track where we should create a deployment for environment.
4. If environment in `.gitlab-ci.yml` is specified it will create a deployment. **If environment does not exist it will be created.** (this got changed)
5. The deployment is always successful and shows the time of the action, in that case a build that presumably should do deployment. In the future we could extend deployment with statuses: success, failure. We could extend deployments with information that this is partial or full deployment.
6. User have to create environments that he will track first.
7. User can remove environments.
8. User can retry/rollback past deployment (in that case we retry past build). The new build when succeeds it will create a new deployment.
9. Currently environment have only one parameter: `name`. In the future it should have: `variables`, `credentials` and possibly `runners` and maybe other resources.
10. Currently deployment have this parameters: `sha`, `ref`, `deployable (in this case a build)`, `user (who triggered a deployment)`, `created_at`.

The `.gitlab-ci.yml`:
```
deploy to production:
  stage: deploy
  script: dpl travis...
  environment: production
```

What needs to be done:
- [x] Write initial implementation
- [x] Improve implementation (@ayufan)
- [x] Write tests (@ayufan)
- [x] Improve UX of the forms (cc @markpundsack) - reviewed by @markpundsack
- [x] Improve implementation of the views (cc @jschatz1) - done by @iamphill 
- [x] Write .gitlab-ci.yml documentation for `environments` - done by @ayufan
- [ ] Write user documentation (@ayufan and @markpundsack)

See merge request !4605
2016-06-15 13:48:09 +00:00
Douwe Maan 8249fdcd47 Merge branch '18451-track-new-redis-connections' into 'master'
Resolve "Track the number of new Redis connections per transaction"

## What does this MR do?

Add a new metric counter, `new_redis_connections`, that contains the number of calls to `Redis::Client#connect` in the current transaction.

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

Not sure. I tested this in kind of a brute-force way:

1. Add a debugger in the monkey-patched `connect` method.
2. With metrics enabled, start the app and load a page.
3. The first Redis connection is created by `Rack::Attack` and isn't in a transaction, but still works fine.
4. The second Redis connection is within a transaction (the page load), and increments the counter.
5. If I reload the page, neither debugger is hit.
6. If I use a Redis client and do `CLIENT KILL` on my two existing clients, then reload the page, I get 3 and 4 again.
7. If I disable metrics collection, the debugger never gets hit.

## Why was this MR needed?

We may have a Redis connection leak somewhere, so adding metrics will let us track this.

## What are the relevant issue numbers?

Closes #18451.

## Screenshots (if relevant)

Hahaha nope, not relevant.

## Does this MR meet the acceptance criteria?

- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- [ ] Tests
  - [ ] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [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)

cc @yorickpeterse 

See merge request !4649
2016-06-15 09:56:42 +00:00
Stan Hu 5ac17fb2fa Merge branch 'manual-todos-issuable-sidebar' into 'master'
Manually create todo for issuable

## What does this MR do?

Adds a button to the sidebar in issues & merge requests to allow users to manually create a todo item themselves.

## What are the relevant issue numbers?

Closes #15045 

## Screenshots (if relevant)

![Screen_Shot_2016-06-07_at_09.52.14](/uploads/00af70244c0589d19f241c3e85f3d63d/Screen_Shot_2016-06-07_at_09.52.14.png)

![Screen_Shot_2016-06-07_at_09.52.06](/uploads/e232b02208613a4a50cff4d1e6f119ff/Screen_Shot_2016-06-07_at_09.52.06.png)

![Screen_Shot_2016-06-07_at_09.51.14](/uploads/f1d36435d49ab882538ae2252bec8086/Screen_Shot_2016-06-07_at_09.51.14.png)

See merge request !4502
2016-06-14 22:01:43 +00:00
Sean McGivern 3582c6aedc Track new Redis connections
Increment the counter `new_redis_connections` on each call to
`Redis::Client#connect`, if we're in a transaction.
2016-06-14 16:41:17 +01:00
Douwe Maan fe32942f8e Merge branch '13948-access-request-to-projects-and-groups' into 'master'
Allow users to request access to projects and groups

#### TODO:

- [x] Factorize the projects & groups members list
- [x] Factorize `request_access` and `approve` controller methods into a concern
- [x] Factorize the project & group dropdowns
- [x] Factorize access request routes
- [x] Factorize mailers

#### Will be done in separate MRs

- [ ] Documentation
- [ ] API

#### Access request to project

- [x] Design project access request button to spec (defined in #13948)
- [x] Request access to a project as a logged in user
- [x] Withdraw access request to a project as a logged in user
- [x] Do not treat project member request as actual membership (done partly in Ability)
- [x] Display access requests on project's members page (+ allow to change level, approve, and deny request)
- [x] Email requesting user at notification email address when accepted/denied
- [x] Email all project admins at notification email addresses when new access request
- [x] Unit specs to cover new functionality: `AccessRequestable` is missing specs
- [x] Controller specs to cover new functionality
- [x] Mailer specs to cover new functionality
- [x] Features specs to cover new UI and interactions
- [x] Regression specs still passing

#### Access request to group

- [x] Design group access request button to spec (defined in #13948)
- [x] Request access to a group as a logged in user
- [x] Withdraw access request to a group as a logged in user
- [x] Do not treat group member request as actual membership
- [x] Display access requests on group's members page (+ allow to change level, approve, and deny request)
- [x] Email requesting user at notification email address when accepted/denied
- [x] Email all project admins at notification email addresses when new access request
- [x] Unit specs to cover new functionality
- [x] Controller specs to cover new functionality
- [x] Mailer specs to cover new functionality
- [x] Features specs to cover new UI and interactions
- [x] Regression specs still passing

Closes #13948.

### Requesting access to a project

#### Responsive UI

![request-access-to-project](/uploads/59337d84ca4c2f637dfd73fca038def9/request-access-to-project.gif)

#### Request access link

![1-project-request-access-link](/uploads/5436f7854bc48bff74b2664b311920c6/1-project-request-access-link.png)

#### Flash once access is requested

![2-project-request-access-flash](/uploads/8b304dd737431c47d00ee90ab88b8098/2-project-request-access-flash.jpg)

#### Email sent to project admins on new access requests

##### HTML Email

![3-project-request-access-email-html](/uploads/63842c9bd4e43a907ab189087dd24cad/3-project-request-access-email-html.jpg)

##### Plain Email

![4-project-request-access-email-plain](/uploads/249289418678c65abfcf4c1e944986c6/4-project-request-access-email-plain.jpg)

### Withdrawing access request to a project

#### Withdraw access request link

![5-project-withdraw-request-link](/uploads/932984713a98f03ad75cd9606245cbe2/5-project-withdraw-request-link.png)

#### Withdraw access request confirmation dialog box

![6-project-withdraw-request-confirm](/uploads/bf6afb5b83ad8ba31443812d0ccbc50b/6-project-withdraw-request-confirm.png)

#### Flash once access has been withdrawn

![6-2-project-withdraw-request-confirm](/uploads/4dea00452adc4febd7cff4a969a7830a/6-2-project-withdraw-request-confirm.png)

### Access requests management page

![7-project-access-requests](/uploads/2030399fa9ce261e0df4bd3d399bfc24/7-project-access-requests.jpg)

#### Deny access request confirmation dialog box

![8-project-access-request-deny-confirm](/uploads/b6ffcc3092b037fb4d3a5f1929befa90/8-project-access-request-deny-confirm.png)

#### Email sent to requester on denied access requests

##### HTML Email

![9-project-request-access-denied-email-html](/uploads/7fb26d627f8919039ce88302e72ede83/9-project-request-access-denied-email-html.jpg)

##### Plain Email

![10-project-request-access-denied-email-plain](/uploads/34a21f2266e3238dc29b93f855183fb0/10-project-request-access-denied-email-plain.jpg)

#### Email sent to requester on granted access requests

##### HTML Email

![11-project-request-access-granted-email-html](/uploads/cecd4d874885c48dd8bb420f19defd8f/11-project-request-access-granted-email-html.jpg)

##### Plain Email

![12-project-request-access-granted-email-plain](/uploads/636446f7a711904231d592add2de83dc/12-project-request-access-granted-email-plain.jpg)

----------------------------------

----------------------------------

### Requesting access to a group

#### Responsive UI

![request-access-to-group](/uploads/b319b8844836ad599ad4d562f3ba6057/request-access-to-group.gif)

#### Request access link

![1-group-request-access-link](/uploads/1eccd38061f0183ba71c482f51ebf53a/1-group-request-access-link.png)

#### Flash once access is requested

![2-group-request-access-flash](/uploads/bbb94ede6c54cd0b6b28e8e1196f687c/2-group-request-access-flash.jpg)

#### Email sent to project admins on new access requests

##### HTML Email

![3-group-request-access-email-html](/uploads/7df7196e83d80bea861ea94bd8f3f390/3-group-request-access-email-html.jpg)

##### Plain Email

![4-group-request-access-email-plain](/uploads/55a1abcd7a42368f3ba8f20650339e4a/4-group-request-access-email-plain.jpg)

### Withdrawing access request to a project

#### Withdraw access request link

![5-group-withdraw-request-link](/uploads/d02ed4f353a334a0a6c181da6006f0d6/5-group-withdraw-request-link.png)

#### Withdraw access request confirmation dialog box

![6-group-withdraw-request-confirm](/uploads/09d6e123390f257aff9aed3b08695ad6/6-group-withdraw-request-confirm.png)

#### Flash once access has been withdrawn

![6-2-group-withdraw-request-confirm](/uploads/cf300d2292d0c10ca592424860b80d20/6-2-group-withdraw-request-confirm.png)

### Access requests management page

![7-group-access-requests](/uploads/821c55ba4276112b1994ca87b0c5e1ad/7-group-access-requests.jpg)

#### Deny access request confirmation dialog box

![8-group-access-request-deny-confirm](/uploads/68fad9da8bc82492be3f6d55d33dba17/8-group-access-request-deny-confirm.png)

#### Email sent to requester on denied access requests

##### HTML Email

![9-group-request-access-denied-email-html](/uploads/48a8e0cc2cea3b36529b04d259dc8e65/9-group-request-access-denied-email-html.jpg)

##### Plain Email

![10-group-request-access-denied-email-plain](/uploads/85d95642a218eaf52a35da8a7a0ac8ed/10-group-request-access-denied-email-plain.jpg)

#### Email sent to requester on granted access requests

##### HTML Email

![11-group-request-access-granted-email-html](/uploads/b18949a6538168824f3d0c272d89dd81/11-group-request-access-granted-email-html.jpg)

##### Plain Email

![12-group-request-access-granted-email-plain](/uploads/c33c7847ab86eeab4b07714467573f63/12-group-request-access-granted-email-plain.jpg)

See merge request !3798
2016-06-14 14:50:52 +00:00
Yorick Peterse f558bf0de4 Merge branch '18527-instrument-private-methods' into 'master'
Instrument private methods and instance private methods

See merge request !4639
2016-06-14 14:28:40 +00:00
Douwe Maan 9413d1c2e9 Merge branch 'master' into 13948-access-request-to-projects-and-groups
# Conflicts:
#	app/views/layouts/nav/_project.html.haml
2016-06-14 16:23:16 +02:00
Kamil Trzcinski 006b650988 Merge remote-tracking branch 'origin/master' into environments-and-deployments
# Conflicts:
#	db/schema.rb
2016-06-14 16:19:29 +02: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
Rémy Coutable d75edf1a98 Factorize access request routes into a new :access_requestable route concern
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00
Rémy Coutable d71fbe0dbd Factorize #request_access and #approve_access_request into a new AccessRequestActions controller concern
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00
Rémy Coutable d26f81239a Add request access for groups
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00
Kamil Trzcinski 7d9e8b04c0 Merge remote-tracking branch 'origin/master' into environments-and-deployments 2016-06-14 12:41:18 +02:00
David AlexanderandRémy Coutable 17c22156c5 Initial implementation of user access request to projects 2016-06-14 12:12:02 +02:00
Kamil Trzcinski 1b62b86fdd Merge remote-tracking branch 'origin/master' into artifacts-expire-date 2016-06-14 11:38:44 +02:00
Phil Hughes 330e913681 Uses update URL to update the status of a todo 2016-06-14 08:36:07 +01:00
Phil Hughes 20d382a891 Moved todo creation over to project todos controller 2016-06-14 08:36:07 +01:00
Phil Hughes f67b06ada0 Manually create todo for issuable
Added a button into the sidebar for issues & merge requests to allow users to manually create todo items

Closes #15045
2016-06-14 08:36:07 +01: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
Kamil Trzcinski f6de5937e3 Merge remote-tracking branch 'origin/master' into artifacts-expire-date 2016-06-13 16:05:30 +02:00
Kamil TrzcinskiandPhil Hughes cf9c5b54c6 Added documentation to artifacts expire 2016-06-13 11:09:19 +01:00
Kamil TrzcinskiandPhil Hughes 4e9e4e22af Enable exceptions on ChronicDuration 2016-06-13 11:03:30 +01:00
Kamil TrzcinskiandPhil Hughes ffe8dbde9b Move keep to ArtifactsController 2016-06-13 11:03:30 +01:00
Yorick Peterse ffd316483c Instrument all Banzai::ReferenceParser classes
Now that this code is no longer part of Banzai::Filter it needs to be
instrumented explicitly.
2016-06-13 12:03:25 +02:00
Kamil TrzcinskiandPhil Hughes aea4041ce9 Allow to expire build artifacts 2016-06-13 11:01:19 +01:00
Kamil Trzcinski 4f00b93ddd Add deployment views 2016-06-11 00:15:53 +02:00
Kamil Trzcinski cf7da039be commit status 2016-06-10 22:38:40 +02:00
Connor Shea 18e16e427d Replace raphael-rails with raphael.js so it can be split from the rest of the JavaScript. The gem isn't maintained anymore anyway. Added a network folder with an application.js including raphael components, since that's the only page using it currently. 2016-06-10 09:28:07 -06:00
Achilleas Pipinellis 2ff359142a Merge branch 'fix-registry-docs' into 'master'
Fix incorrect registry key value



See merge request !4595
2016-06-10 14:21:49 +00:00
Achilleas Pipinellis 0e7abb4c28 Fix incorrect registry key value
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/18441
2016-06-10 15:53:56 +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
Rémy Coutable 72647eda31 Don't require Gitlab::Redis in mail_room.yml if it's already defined
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-10 13:44:45 +02:00
Douwe Maan 3803b380b4 Merge branch 'fix-git-http-routing' into 'master'
Ensure only IDs ending in .git perform git actions

## What does this MR do?

Rails's routing is pretty strange. Previously, `GET /namespace/project/info/refs` would go to the Git HTTP controller (if the redirect for that case was taken out).

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

The specs fail if the redirect is moved to above the Git HTTP routes, removed altogether, or the Git HTTP constraints are changed. But there might still be missing cases.

## Why was this MR needed?

The master build and HTTP cloning were both broken.

## What are the relevant issue numbers?

Closes #18376.

## Screenshots (if relevant)

Nope.

## Does this MR meet the acceptance criteria?

- [x] [not needed] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [not needed] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] (not needed) API support added
- [ ] Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [x] 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 !4558
2016-06-09 15:01:10 +00:00
Sean McGivern df5fb28a3a Ensure only IDs ending in .git perform git actions
It doesn't seem possible to set constraints based on format for project
IDs ending in .git, so set the constraint on the ID and ensure the
format is nil to avoid the case where the project ID is something like
project.git.foo.
2016-06-09 11:53:11 +01:00
Rémy Coutable 3d72cb897e Merge branch '18019-fix-wiki-linking' into 'master'
Fix wiki linking behavior for markdown wiki pages

Related to #18019 

- As per the documentation in !4372 

## TODO
- [ ] !4432 Have wiki linking behave as per the documentation
    - [x] Move `WikiLinkFilter` specs to the pipeline level
    - [x] Verify current behavior on wiki `show` page
    - [x] Fix current behavior on wiki `show` page
    - [x] Verify current behaviour on wiki preview
    - [x] Fix current behaviour on wiki preview
        - [x] Rewrite all links and get preview links working
        - [x] Make sure all links are on-par with the wiki `show` page
        - [x] TDD `WikiLinkFilter` and get it working
        - [x] Hook `WikiLinkFilter` up
    - [x] Fix tests 
        - [x] Fix `markdown_spec`
        - [x] Fix `wiki` spinach feature
        - [x] Wait for [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/4f50dd2/builds) to pass
        - [x] Make sure all wiki-related pages are working as expected (history, all pages, etc.)
    - [x] Test in different ruby versions
    - [x] GitLab instances hosted on a relative URL
    - [x] Non-markdown rendering formats?
        - [x] RDoc
        - [x] ASCIIDoc
        - [x] Create issues to fix things for RDoc and ASCIIDoc
    - [x] Gauge performance impact
    - [x] Refactor
    - [x] Re-organize commits
    - [x] Make sure [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/f860e9a8dcabe7d5f160c32fc549807c98baa4a1/builds) passes
    - [x] Respond to @rymai's comments
        - [x] `class WikiLinkFilter < HTML::Pipeline::Filter`
        - [x] blank line after guard clause
        - [x] keyword arguments for `wiki` and `slug`
        - [x] invert the condition
        - [x] inline `user` in spec
        - [x] Make sure spec names are not out of date
        - [x] Comment for each rewrite rule
    - [x] Add CHANGELOG entry
    - [x] Reorganize commits
    - [x] Make sure [build](https://gitlab.com/gitlab-org/gitlab-ce/commit/19b91e749a6320d12fb299d33f1f6440777e0e26/builds) passes
    - [ ] Wait for merge

See merge request !4432
2016-06-09 08:37:27 +00:00
Timothy Andrew e6b1d1669b Hook up the updated WikiLinkFilter to the wiki controllers.
- Need to pass in a `page_slug` to the filter, so it can rewrite based
  on the current page (all links are rewritten to the level of the app root).
- The earlier `markdown_preview` endpoint was at the level of the wiki.
  We need to know the current page (for rewriting, as above), so this
  commit moves the endpoint to the level of a wiki page.
- Fix all tests
2016-06-09 10:15:01 +05:30
Robert Speicher fe75d163ab Merge branch '13840-allow-clones-from-http-url-s-without-appending-git' into 'master'
Allow clones from /namespace/project

Allow `git clone https://host/namespace/project` to work, in addition to `git clone https://host/namespace/project.git`

Closes #13840.

See merge request !4530
2016-06-08 20:48:24 +00:00
Sean McGivern cba32b71bd Allow clones from /namespace/project
Redirect /namespace/project/info/refs to
/namespace/project.git/info/refs, so `git clone` works on either
namespace/project.git or namespace/project.
2016-06-08 20:55:34 +01: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
Robert Speicher 4531b5da64 Merge branch 'upgrade-nokogiri' into 'master'
Bump nokogiri to 1.6.8

Number of important security and bug fixes. See:
https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md#168--2016-06-06

See merge request !4500
2016-06-07 20:36:54 +00:00
Stan Hu 5bb3e1934c Add LGPLv2 to license whiltelist 2016-06-07 10:14:18 -07:00
Yorick Peterse 99913b3d2c Merge branch '18082-instrument-repositorycheck-singlerepositoryworker-manually' into 'master'
Instrument `RepositoryCheck::SingleRepositoryWorker` manually

See merge request !4446
2016-06-07 16:56:01 +00:00
Alejandro Rodríguez d485ec9f1c Instrument RepositoryCheck::SingleRepositoryWorker manually
This worker is called manually by `RepositoryCheck::BatchWorker` meaning it's not tracked automatically by the Sidekiq middleware.
2016-06-07 12:10:55 -04: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
Connor Shea 7900c035bf Resolve feedback. 2016-06-06 13:39:36 -06:00
Connor Shea 3c32341215 Add Licensing information and guidelines to the Documentation. 2016-06-06 13:39:36 -06:00
Connor Shea 4cff270f20 Fix up all the decisions in the YML file. 2016-06-06 13:39:36 -06:00
Connor Shea ddca2806c7 Add gems and licenses that were previously missing. Approve a number of licenses after a bunch of research today. 2016-06-06 13:39:36 -06:00