<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-ce.git/app/services/protected_branches/create_service.rb, branch scripts-differences</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>Enable more frozen string in app/services/**/*.rb</title>
<updated>2018-07-18T21:07:50+00:00</updated>
<author>
<name>gfyoung</name>
<email>gfyoung17@gmail.com</email>
</author>
<published>2018-07-18T16:03:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=0cf45debb45cc7a412fd1b290c215280aaca6a45'/>
<id>0cf45debb45cc7a412fd1b290c215280aaca6a45</id>
<content type='text'>
Partially addresses #47424.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Partially addresses #47424.
</pre>
</div>
</content>
</entry>
<entry>
<title>ProtectedBranchPolicy used from Controller for destroy/update</title>
<updated>2018-03-26T09:29:52+00:00</updated>
<author>
<name>James Edwards-Jones</name>
<email>jedwardsjones@gitlab.com</email>
</author>
<published>2018-03-25T00:54:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=973bd4622dec2c326d05a047b93a7b67c9196fb4'/>
<id>973bd4622dec2c326d05a047b93a7b67c9196fb4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Protected branch is now created for default branch on import</title>
<updated>2018-01-06T12:20:49+00:00</updated>
<author>
<name>Tiago Botelho</name>
<email>tiagonbotelho@hotmail.com</email>
</author>
<published>2018-01-03T16:01:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=819fc98fed227487b0a273ee294e374e7457782b'/>
<id>819fc98fed227487b0a273ee294e374e7457782b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Backport changes from gitlab-org/gitlab-ee!581 to CE.</title>
<updated>2016-08-16T05:35:14+00:00</updated>
<author>
<name>Timothy Andrew</name>
<email>mail@timothyandrew.net</email>
</author>
<published>2016-08-16T05:09:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=e805a6470031d942f7de604fdf7acfc7cf4f0b1a'/>
<id>e805a6470031d942f7de604fdf7acfc7cf4f0b1a</id>
<content type='text'>
!581 has a lot of changes that would cause merge conflicts if not
properly backported to CE. This commit/MR serves as a better
foundation for gitlab-org/gitlab-ee!581.

= Changes =

1. Move from `has_one {merge,push}_access_level` to `has_many`, with the
   `length` of the association limited to `1`. This is _effectively_ a
   `has_one` association, but should cause less conflicts with EE, which
   is set to `has_many`. This has a number of related changes in the
   views, specs, and factories.

2. Make `gon` variable loading more consistent (with EE!581) in the
   `ProtectedBranchesController`. Also use `::` to prefix the
   `ProtectedBranches` services, because this is required in EE.

3. Extract a `ProtectedBranchAccess` concern from the two access level
   models. This concern only has a single `humanize` method here, but
   will have more methods in EE.

4. Add `form_errors` to the protected branches creation form. This is
   not strictly required for EE compatibility, but was an oversight
   nonetheless.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
!581 has a lot of changes that would cause merge conflicts if not
properly backported to CE. This commit/MR serves as a better
foundation for gitlab-org/gitlab-ee!581.

= Changes =

1. Move from `has_one {merge,push}_access_level` to `has_many`, with the
   `length` of the association limited to `1`. This is _effectively_ a
   `has_one` association, but should cause less conflicts with EE, which
   is set to `has_many`. This has a number of related changes in the
   views, specs, and factories.

2. Make `gon` variable loading more consistent (with EE!581) in the
   `ProtectedBranchesController`. Also use `::` to prefix the
   `ProtectedBranches` services, because this is required in EE.

3. Extract a `ProtectedBranchAccess` concern from the two access level
   models. This concern only has a single `humanize` method here, but
   will have more methods in EE.

4. Add `form_errors` to the protected branches creation form. This is
   not strictly required for EE compatibility, but was an oversight
   nonetheless.
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement final review comments from @rymai.</title>
<updated>2016-07-29T09:50:39+00:00</updated>
<author>
<name>Timothy Andrew</name>
<email>mail@timothyandrew.net</email>
</author>
<published>2016-07-29T07:01:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=cebcc417eda08711ad17a433d6d9b4f49830c04c'/>
<id>cebcc417eda08711ad17a433d6d9b4f49830c04c</id>
<content type='text'>
1. Instantiate `ProtectedBranchesAccessSelect` from `dispatcher`

2. Use `can?(user, ...)` instead of `user.can?(...)`

3. Add `DOWNTIME` notes to all migrations added in !5081.

4. Add an explicit `down` method for migrations removing the
   `developers_can_push` and `developers_can_merge` columns, ensuring that
   the columns created (on rollback) have the appropriate defaults.

5. Remove duplicate CHANGELOG entries.

6. Blank lines after guard clauses.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Instantiate `ProtectedBranchesAccessSelect` from `dispatcher`

2. Use `can?(user, ...)` instead of `user.can?(...)`

3. Add `DOWNTIME` notes to all migrations added in !5081.

4. Add an explicit `down` method for migrations removing the
   `developers_can_push` and `developers_can_merge` columns, ensuring that
   the columns created (on rollback) have the appropriate defaults.

5. Remove duplicate CHANGELOG entries.

6. Blank lines after guard clauses.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use `Gitlab::Access` to protected branch access levels.</title>
<updated>2016-07-29T09:50:39+00:00</updated>
<author>
<name>Timothy Andrew</name>
<email>mail@timothyandrew.net</email>
</author>
<published>2016-07-29T06:13:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=0a8aeb46dc187cc309ddbe23d8624f5d24b6218c'/>
<id>0a8aeb46dc187cc309ddbe23d8624f5d24b6218c</id>
<content type='text'>
1. It makes sense to reuse these constants since we had them duplicated
   in the previous enum implementation. This also simplifies our
   `check_access` implementation, because we can use
   `project.team.max_member_access` directly.

2. Use `accepts_nested_attributes_for` to create push/merge access
   levels. This was a bit fiddly to set up, but this simplifies our code
   by quite a large amount. We can even get rid of
   `ProtectedBranches::BaseService`.

3. Move API handling back into the API (previously in
   `ProtectedBranches::BaseService#translate_api_params`.

4. The protected branch services now return a `ProtectedBranch` rather
   than `true/false`.

5. Run `load_protected_branches` on-demand in the `create` action, to
   prevent it being called unneccessarily.

6. "Masters" is pre-selected as the default option for "Allowed to Push"
   and "Allowed to Merge".

7. These changes were based on a review from @rymai in !5081.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. It makes sense to reuse these constants since we had them duplicated
   in the previous enum implementation. This also simplifies our
   `check_access` implementation, because we can use
   `project.team.max_member_access` directly.

2. Use `accepts_nested_attributes_for` to create push/merge access
   levels. This was a bit fiddly to set up, but this simplifies our code
   by quite a large amount. We can even get rid of
   `ProtectedBranches::BaseService`.

3. Move API handling back into the API (previously in
   `ProtectedBranches::BaseService#translate_api_params`.

4. The protected branch services now return a `ProtectedBranch` rather
   than `true/false`.

5. Run `load_protected_branches` on-demand in the `create` action, to
   prevent it being called unneccessarily.

6. "Masters" is pre-selected as the default option for "Allowed to Push"
   and "Allowed to Merge".

7. These changes were based on a review from @rymai in !5081.
</pre>
</div>
</content>
</entry>
<entry>
<title>Authorize user before creating/updating a protected branch.</title>
<updated>2016-07-29T09:50:39+00:00</updated>
<author>
<name>Timothy Andrew</name>
<email>mail@timothyandrew.net</email>
</author>
<published>2016-07-27T04:44:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=6d841eaadcbccfa4527bd892bf86fc8dbba19455'/>
<id>6d841eaadcbccfa4527bd892bf86fc8dbba19455</id>
<content type='text'>
1. This is a third line of defence (first in the view, second in the
   controller).

2. Duplicate the `API::Helpers.to_boolean` method in `BaseService`. The
   other alternative is to `include API::Helpers`, but this brings with it
   a number of other methods that might cause conflicts.

3. Return a 403 if authorization fails.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. This is a third line of defence (first in the view, second in the
   controller).

2. Duplicate the `API::Helpers.to_boolean` method in `BaseService`. The
   other alternative is to `include API::Helpers`, but this brings with it
   a number of other methods that might cause conflicts.

3. Return a 403 if authorization fails.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix default branch protection.</title>
<updated>2016-07-29T09:50:39+00:00</updated>
<author>
<name>Timothy Andrew</name>
<email>mail@timothyandrew.net</email>
</author>
<published>2016-07-08T09:15:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=a9958ddc7c9d4c455d4c5459b7b83da1fab9ccb4'/>
<id>a9958ddc7c9d4c455d4c5459b7b83da1fab9ccb4</id>
<content type='text'>
1. So it works with the new data model for protected branch access levels.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. So it works with the new data model for protected branch access levels.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add "No One Can Push" to the protected branches UI.</title>
<updated>2016-07-29T09:50:39+00:00</updated>
<author>
<name>Timothy Andrew</name>
<email>mail@timothyandrew.net</email>
</author>
<published>2016-07-07T10:48:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=ab6096c17261605d835a4a8edae21f31d90026df'/>
<id>ab6096c17261605d835a4a8edae21f31d90026df</id>
<content type='text'>
1. Move to dropdowns instead of checkboxes. One each for "Allowed to
   Push" and "Allowed to Merge"

2. Refactor the `ProtectedBranches` coffeescript class into
   `ProtectedBranchesAccessSelect`.

3. Modify the backend to accept the new parameters.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Move to dropdowns instead of checkboxes. One each for "Allowed to
   Push" and "Allowed to Merge"

2. Refactor the `ProtectedBranches` coffeescript class into
   `ProtectedBranchesAccessSelect`.

3. Modify the backend to accept the new parameters.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use the `{Push,Merge}AccessLevel` models in the UI.</title>
<updated>2016-07-29T09:50:39+00:00</updated>
<author>
<name>Timothy Andrew</name>
<email>mail@timothyandrew.net</email>
</author>
<published>2016-07-07T07:36:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=134fe5af83167f95205a080f7932452de7d77496'/>
<id>134fe5af83167f95205a080f7932452de7d77496</id>
<content type='text'>
1. Improve error handling while creating protected branches.

2. Modify coffeescript code so that the "Developers can *" checkboxes
   send a '1' or '0' even when using AJAX. This lets us keep the backend
   code simpler.

3. Use services for both creating and updating protected branches.
   Destruction is taken care of with `dependent: :destroy`
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Improve error handling while creating protected branches.

2. Modify coffeescript code so that the "Developers can *" checkboxes
   send a '1' or '0' even when using AJAX. This lets us keep the backend
   code simpler.

3. Use services for both creating and updating protected branches.
   Destruction is taken care of with `dependent: :destroy`
</pre>
</div>
</content>
</entry>
</feed>
