<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-ce.git/spec/models, branch process-commit-worker-improvements</title>
<subtitle>gitlab.com: gitlab-org/gitlab-ce.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/'/>
<entry>
<title>Pass commit data to ProcessCommitWorker</title>
<updated>2016-12-01T12:36:06+00:00</updated>
<author>
<name>Yorick Peterse</name>
<email>yorickpeterse@gmail.com</email>
</author>
<published>2016-11-24T14:07:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=6b4d33566f5f434cc86381a4a1347e42bbe348ee'/>
<id>6b4d33566f5f434cc86381a4a1347e42bbe348ee</id>
<content type='text'>
By passing commit data to this worker we remove the need for querying
the Git repository for every job. This in turn reduces the time spent
processing each job.

The migration included migrates jobs from the old format to the new
format. For this to work properly it requires downtime as otherwise
workers may start producing errors until they're using a newer version
of the worker code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By passing commit data to this worker we remove the need for querying
the Git repository for every job. This in turn reduces the time spent
processing each job.

The migration included migrates jobs from the old format to the new
format. For this to work properly it requires downtime as otherwise
workers may start producing errors until they're using a newer version
of the worker code.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'rs-include-emailhelpers' into 'master'</title>
<updated>2016-12-01T10:46:40+00:00</updated>
<author>
<name>Rémy Coutable</name>
<email>remy@rymai.me</email>
</author>
<published>2016-12-01T10:46:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=e91afc0dc071f2cb2dde54b12c04bb90d2c65f7b'/>
<id>e91afc0dc071f2cb2dde54b12c04bb90d2c65f7b</id>
<content type='text'>

Only include EmailHelpers in mailer specs and specs using them

See merge request !7836</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>

Only include EmailHelpers in mailer specs and specs using them

See merge request !7836</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor JiraService by moving code out of JiraService#execute method</title>
<updated>2016-12-01T08:45:06+00:00</updated>
<author>
<name>Adam Niedzielski</name>
<email>adamsunday@gmail.com</email>
</author>
<published>2016-12-01T08:45:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=1105597303496e60308f93441b591a6f7dfadc74'/>
<id>1105597303496e60308f93441b591a6f7dfadc74</id>
<content type='text'>
The implicit interface of project services states that the "execute"
method is meant to be called when project hooks are executed.
Currently JiraService does not support any project events even though
JiraService#supported_events says that "commit" and "merge_request"
are supported. They are only used to render correct options in
JIRA configuration screen, but they are not supported.
Because of that, this commit makes "execute" method a no-op.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The implicit interface of project services states that the "execute"
method is meant to be called when project hooks are executed.
Currently JiraService does not support any project events even though
JiraService#supported_events says that "commit" and "merge_request"
are supported. They are only used to render correct options in
JIRA configuration screen, but they are not supported.
Because of that, this commit makes "execute" method a no-op.
</pre>
</div>
</content>
</entry>
<entry>
<title>Only include EmailHelpers in mailer specs and specs using them</title>
<updated>2016-12-01T04:17:33+00:00</updated>
<author>
<name>Robert Speicher</name>
<email>rspeicher@gmail.com</email>
</author>
<published>2016-11-30T08:29:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=819f459b69935f75cbe423884149564cf6cea001'/>
<id>819f459b69935f75cbe423884149564cf6cea001</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename `MergeRequest#pipeline` to `head_pipeline`</title>
<updated>2016-11-29T13:12:49+00:00</updated>
<author>
<name>Grzegorz Bizon</name>
<email>grzesiek.bizon@gmail.com</email>
</author>
<published>2016-11-28T10:13:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=a49e9949c6bc474c8bfd4016d9c6c3b59776772f'/>
<id>a49e9949c6bc474c8bfd4016d9c6c3b59776772f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'hoopes/gitlab-ce-21027-add-diff-hunks-to-notification-emails' into 'master'</title>
<updated>2016-11-29T04:11:15+00:00</updated>
<author>
<name>Douwe Maan</name>
<email>douwe@gitlab.com</email>
</author>
<published>2016-11-29T04:11:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=b0bde100f2480d77a72bdbd777fb0ef2b8ff4024'/>
<id>b0bde100f2480d77a72bdbd777fb0ef2b8ff4024</id>
<content type='text'>

Add diff hunks to notification emails

Add diff hunks to notification emails. Continued from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5855 - thanks @hoopes!

This also fixes an issue where the + / - prefixes were missing from diffs in emails.

Screenshots (from my browser) of the HTML emails, along with text screenshots :stuck_out_tongue:

![image](/uploads/cb31400becf5149d40c8bb98a655aa93/image.png)

```
New comment for Merge Request !1 on app/views/admin/builds/index.html.haml:

http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/1#note_1023

&gt;          Finished

This is a comment at the top of a match section.
```

![image](/uploads/704dd3845797530697a27f5c1953c053/image.png)

```
New comment for Merge Request !1 on app/views/admin/builds/index.html.haml:

http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/1#note_1022

&gt;          Finished
&gt;          %span.badge.js-running-count= @all_builds.finished.count(:id)
&gt;  
&gt; -    %li{class: ('active' if @scope == 'all')}
&gt; -      = link_to admin_builds_path(scope: :all) do
&gt; -        All
&gt; -        %span.badge.js-totalbuilds-count= @all_builds.count(:id)
&gt; -
&gt;  .gray-content-block
&gt;    #{(@scope || 'running').capitalize} builds
&gt;  

This is a comment at the bottom of a match section.
```

![image](/uploads/4063f3d9738aea8ebf3c0e690d0eddee/image.png)

```
New comment for Merge Request !1 on app/views/admin/builds/index.html.haml:

http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/1#note_1024

&gt;          = link_to 'Cancel all', cancel_all_admin_builds_path, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
&gt;  
&gt;    %ul.center-top-menu
&gt; -    %li{class: ('active' if @scope.nil?)}
&gt; +    %li{class: ('active' if @scope == 'all')}
&gt;        = link_to admin_builds_path do
&gt; +        All

This is a comment with some deleted and added lines above it.
```

Closes #21027, closes #24340.

See merge request !7660</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>

Add diff hunks to notification emails

Add diff hunks to notification emails. Continued from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5855 - thanks @hoopes!

This also fixes an issue where the + / - prefixes were missing from diffs in emails.

Screenshots (from my browser) of the HTML emails, along with text screenshots :stuck_out_tongue:

![image](/uploads/cb31400becf5149d40c8bb98a655aa93/image.png)

```
New comment for Merge Request !1 on app/views/admin/builds/index.html.haml:

http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/1#note_1023

&gt;          Finished

This is a comment at the top of a match section.
```

![image](/uploads/704dd3845797530697a27f5c1953c053/image.png)

```
New comment for Merge Request !1 on app/views/admin/builds/index.html.haml:

http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/1#note_1022

&gt;          Finished
&gt;          %span.badge.js-running-count= @all_builds.finished.count(:id)
&gt;  
&gt; -    %li{class: ('active' if @scope == 'all')}
&gt; -      = link_to admin_builds_path(scope: :all) do
&gt; -        All
&gt; -        %span.badge.js-totalbuilds-count= @all_builds.count(:id)
&gt; -
&gt;  .gray-content-block
&gt;    #{(@scope || 'running').capitalize} builds
&gt;  

This is a comment at the bottom of a match section.
```

![image](/uploads/4063f3d9738aea8ebf3c0e690d0eddee/image.png)

```
New comment for Merge Request !1 on app/views/admin/builds/index.html.haml:

http://localhost:3000/gitlab-org/gitlab-ce/merge_requests/1#note_1024

&gt;          = link_to 'Cancel all', cancel_all_admin_builds_path, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
&gt;  
&gt;    %ul.center-top-menu
&gt; -    %li{class: ('active' if @scope.nil?)}
&gt; +    %li{class: ('active' if @scope == 'all')}
&gt;        = link_to admin_builds_path do
&gt; +        All

This is a comment with some deleted and added lines above it.
```

Closes #21027, closes #24340.

See merge request !7660</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'jej-use-issuable-finder-instead-of-access-check' into 'security'</title>
<updated>2016-11-29T00:26:23+00:00</updated>
<author>
<name>Douwe Maan</name>
<email>douwe@gitlab.com</email>
</author>
<published>2016-11-22T10:25:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=3bf34face4cacf07ca973705c261369b1f596626'/>
<id>3bf34face4cacf07ca973705c261369b1f596626</id>
<content type='text'>

Replace issue access checks with use of IssuableFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

## Which fixes are in this MR?

:warning: - Potentially untested  
:bomb: - No test coverage  
:traffic_light: - Test coverage of some sort exists (a test failed when error raised)  
:vertical_traffic_light: - Test coverage of return value (a test failed when nil used)  
:white_check_mark: - Permissions check tested

### Issue lookup with access check

Using `visible_to_user` likely makes these security issues too. See [Code smells](#code-smells).

- [x] :vertical_traffic_light: app/finders/notes_finder.rb:15 [`visible_to_user`]
- [x] :traffic_light: app/views/layouts/nav/_project.html.haml:73 [`visible_to_user`] [`.count`]
- [x] :white_check_mark: app/services/merge_requests/build_service.rb:84 [`issue.try(:confidential?)`]
- [x] :white_check_mark: lib/api/issues.rb:112 [`visible_to_user`]
  - CHANGELOG: Prevented API returning issues set to 'Only team members' to everyone
- [x] :white_check_mark: lib/api/helpers.rb:126 [`can?(current_user, :read_issue, issue)`] Maybe here too?
- [x] :white_check_mark: lib/gitlab/search_results.rb:53 [`visible_to_user`]

### Previous discussions
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b2ff264eddf9819d7693c14ae213d941494fe2b3_128_126
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#7b6375270d22f880bdcb085e47b519b426a5c6c7_87_87

See merge request !2031</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>

Replace issue access checks with use of IssuableFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

## Which fixes are in this MR?

:warning: - Potentially untested  
:bomb: - No test coverage  
:traffic_light: - Test coverage of some sort exists (a test failed when error raised)  
:vertical_traffic_light: - Test coverage of return value (a test failed when nil used)  
:white_check_mark: - Permissions check tested

### Issue lookup with access check

Using `visible_to_user` likely makes these security issues too. See [Code smells](#code-smells).

- [x] :vertical_traffic_light: app/finders/notes_finder.rb:15 [`visible_to_user`]
- [x] :traffic_light: app/views/layouts/nav/_project.html.haml:73 [`visible_to_user`] [`.count`]
- [x] :white_check_mark: app/services/merge_requests/build_service.rb:84 [`issue.try(:confidential?)`]
- [x] :white_check_mark: lib/api/issues.rb:112 [`visible_to_user`]
  - CHANGELOG: Prevented API returning issues set to 'Only team members' to everyone
- [x] :white_check_mark: lib/api/helpers.rb:126 [`can?(current_user, :read_issue, issue)`] Maybe here too?
- [x] :white_check_mark: lib/gitlab/search_results.rb:53 [`visible_to_user`]

### Previous discussions
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b2ff264eddf9819d7693c14ae213d941494fe2b3_128_126
- [ ] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#7b6375270d22f880bdcb085e47b519b426a5c6c7_87_87

See merge request !2031</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'jej-fix-missing-access-check-on-issues' into 'security'</title>
<updated>2016-11-29T00:25:46+00:00</updated>
<author>
<name>Douwe Maan</name>
<email>douwe@gitlab.com</email>
</author>
<published>2016-11-18T13:51:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=6d37fe952b5679d7586eaa569d0488dbb92032fe'/>
<id>6d37fe952b5679d7586eaa569d0488dbb92032fe</id>
<content type='text'>
Fix missing access checks on issue lookup using IssuableFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

:warning: - Potentially untested
:bomb: - No test coverage
:traffic_light: - Test coverage of some sort exists (a test failed when error raised)
:vertical_traffic_light: - Test coverage of return value (a test failed when nil used)
:white_check_mark: - Permissions check tested

- [x] :white_check_mark: app/controllers/projects/branches_controller.rb:39
  - `before_action :authorize_push_code!` helpes limit/prevent exploitation. Always checks for reporter access so fine with
    confidential issues, issues only visible to team, etc.
- [x] :traffic_light: app/models/cycle_analytics/summary.rb:9 [`.count`]
- [x] :white_check_mark: app/controllers/projects/todos_controller.rb:19

- [x] Potential double render in app/controllers/projects/todos_controller.rb

- https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#cedccb227af9bfdf88802767cb58d43c2b977439_24_24

See merge request !2030
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix missing access checks on issue lookup using IssuableFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

:warning: - Potentially untested
:bomb: - No test coverage
:traffic_light: - Test coverage of some sort exists (a test failed when error raised)
:vertical_traffic_light: - Test coverage of return value (a test failed when nil used)
:white_check_mark: - Permissions check tested

- [x] :white_check_mark: app/controllers/projects/branches_controller.rb:39
  - `before_action :authorize_push_code!` helpes limit/prevent exploitation. Always checks for reporter access so fine with
    confidential issues, issues only visible to team, etc.
- [x] :traffic_light: app/models/cycle_analytics/summary.rb:9 [`.count`]
- [x] :white_check_mark: app/controllers/projects/todos_controller.rb:19

- [x] Potential double render in app/controllers/projects/todos_controller.rb

- https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#cedccb227af9bfdf88802767cb58d43c2b977439_24_24

See merge request !2030
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix spec style</title>
<updated>2016-11-28T19:40:48+00:00</updated>
<author>
<name>Sean McGivern</name>
<email>sean@gitlab.com</email>
</author>
<published>2016-11-23T16:25:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=b8917eb75e94cb13b02534c920ee926c9e97174e'/>
<id>b8917eb75e94cb13b02534c920ee926c9e97174e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Pass tag SHA to post-receive hook when tag is created via UI</title>
<updated>2016-11-28T14:04:51+00:00</updated>
<author>
<name>Adam Niedzielski</name>
<email>adamsunday@gmail.com</email>
</author>
<published>2016-11-28T14:04:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=cf58271e11f6704523be5211ecfb2d02ae1091fe'/>
<id>cf58271e11f6704523be5211ecfb2d02ae1091fe</id>
<content type='text'>
We only know the tag SHA after we create the tag.
This means that we pass a different value to the hooks that happen before
creating the tag, and a different value to the hooks that happen after
creating the tag.

This is not an ideal situation, but it is a trade-off we decided to
make. For discussion of the alternatives please refer to
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7700#note_18982873

"pre-receive" and "update" hooks always get the SHA of the commit
that the tag points to. "post-receive" gets the tag SHA if it is
an annotated tag or the commit SHA if it is an lightweight tag.
Currently we always create annotated tags if UI is used.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We only know the tag SHA after we create the tag.
This means that we pass a different value to the hooks that happen before
creating the tag, and a different value to the hooks that happen after
creating the tag.

This is not an ideal situation, but it is a trade-off we decided to
make. For discussion of the alternatives please refer to
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7700#note_18982873

"pre-receive" and "update" hooks always get the SHA of the commit
that the tag points to. "post-receive" gets the tag SHA if it is
an annotated tag or the commit SHA if it is an lightweight tag.
Currently we always create annotated tags if UI is used.
</pre>
</div>
</content>
</entry>
</feed>
