Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-06-25Change HTTP Status Code when repository disabledSam Battalio
2019-04-22Introduce ServiceResponse to wrap around responseLin Jen-Shin
See https://gitlab.com/gitlab-org/gitlab-ce/issues/60730
2019-03-30Fix API /project/:id/branches not returning correct merge statusStan Hu
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24034 introduced a regression where only the first 20 branches were used to determine whether a branch has been merged because the pagination was applied incorrectly. Requesting the second page of branches via the API would always have the wrong merge status. We fix this by properly paginating the branches before requesting their merge status. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56250
2018-12-27Fix timeout issues retrieving branches via APIStan Hu
47d4890d changed the order of pagination so that the full list of branches would be passed to Gitaly to determine which ones had been merged, but this operation can timeout for large repositories with many branches. We only need to determine whether the found branches have been merged, so limit the scan to those. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55724
2018-11-28Fix API::Namespaces to accept namepaces with dotsImre Farkas
It also renames the API::PROJECT_ENDPOINT_REQUIREMENTS constant to API::NAMESPACE_OR_PROJECT_REQUIREMENTS
2018-09-30Enable frozen string in lib/api and lib/backupgfyoung
Partially addresses #47424. Had to make changes to spec files because stubbing methods on frozen objects is a mess in RSpec and leads to failures: https://github.com/rspec/rspec-mocks/issues/1190
2018-09-13Merge branch 'rubocop-code-reuse' into 'master'Robert Speicher
Add RuboCop cops to enforce code reusing rules See merge request gitlab-org/gitlab-ce!21391
2018-09-12Resolve "500 Internal Server Error: Cherrypick commit with empty branch name"🙈 jacopo beschi 🙉
2018-09-11Disable existing offenses for the CodeReuse copsYorick Peterse
This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-08API: Use find_branch! in all placesRobert Schilling
2018-08-07Create Web IDE MR and branch pickerPaul Slaughter
2018-06-25Fix branch API can_push attribute and add specsDouwe Maan
2018-03-05Update API: add search param to branchesbunufi
2018-02-01Track and act upon the number of executed queriesYorick Peterse
This ensures that we have more visibility in the number of SQL queries that are executed in web requests. The current threshold is hardcoded to 100 as we will rarely (maybe once or twice) change it. In production and development we use Sentry if enabled, in the test environment we raise an error. This feature is also only enabled in production/staging when running on GitLab.com as it's not very useful to other users.
2017-11-23Renamed ProtectedBranches::ApiUpdateService to LegacyApiUpdateServiceJames Edwards-Jones
2017-11-06Improve performance of the /projects/:id/repository/branches API endpointRémy Coutable
Mitigate a N+1 requests to Gitaly problem. Still one left. Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-18Get Project Branch API shows an helpful error message on invalid refnameJacopo
In API v4 when requesting a branch with an invalid refname shows an helpful error message: 'The branch refname is invalid'.
2017-10-05Remove 'Repo' prefix from API entitesVitaliy @blackst0ne Klachkov
2017-09-19Detect n+1 issues involving GitalyAndrew Newdigate
2017-09-05Add branch existence check to the APIv4 branches via HEAD requestblackst0ne
2017-08-30Don't use public_send in destroy_conditionally! helperSean McGivern
As we only override in two places, we could just ask for the value rather than the method name.
2017-08-28Use commit date for branches and tagsRobert Schilling
2017-08-02Extending API for protected branchesEric
2017-07-27DRY the branches API requirements definitionRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27Fix the /projects/:id/repository/branches endpoint to handle dots in the ↵Rémy Coutable
branch name when the project full patch contains a `/` Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-21Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon
2017-03-20Allow unauthenticated access to some Branch API GET endpointsRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-16Add `requirements: { id: %r{[^/]+} }` for all projects and groups namespaced ↵Rémy Coutable
API routes Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-02-28Return 204 for delete endpointsRobert Schilling
2017-02-24Return 202 with JSON body on async removals on V4 APIOswaldo
2017-02-21Change branch_name param to branch throughout V4 APIOswaldo Ferreira
2017-02-16Paginate all endpoints that return an arrayRobert Schilling
2017-02-07Update Rubocop to ruby 2.3Z.J. van de Weg
2017-01-24Grapify last endpoint of the branches APIRobert Schilling
2016-12-08Allow branch names with dots on API endpointFelipe Artur
2016-11-09Add button to delete all merged branchesToon Claes
It adds a button to the branches page that the user can use to delete all the branches that are already merged. This can be used to clean up all the branches that were forgotten to delete while merging MRs. Fixes #21076.
2016-10-31GrapeDSL for branches endpointsZ.J. van de Weg
2016-10-24Implement second round of review comments from @DouweM.Timothy Andrew
- Pass `developers_and_merge` and `developers_can_push` in `params` instead of using keyword arguments. - Refactor a slightly complex boolean check to a simple `nil?` check.
2016-10-24Implement review comments from @DouweM.Timothy Andrew
2016-10-24Fix branch protection API.Timothy Andrew
1. Previously, we were not removing existing access levels before creating new ones. This is not a problem for EE, but _is_ for CE, since we restrict the number of access levels in CE to 1. 2. The correct approach is: CE -> delete all access levels before updating a protected branch EE -> delete developer access levels if "developers_can_{merge,push}" is switched off 3. The dispatch is performed by checking if a "length: 1" validation is present on the access levels or not. 4. Another source of problems was that we didn't put multiple queries in a transaction. If the `destroy_all` passes, but the `update` fails, we should have a rollback. 5. Modifying the API to provide users direct access to CRUD access levels will make things a lot simpler. 6. Create `create/update` services separately for this API, which perform the necessary data translation, before calling the regular `create/update` services. The translation code was getting too large for the API endpoint itself, so this move makes sense.
2016-08-16Fix failing tests relating to backporting ee!581.Timothy Andrew
1. `GitPushService` was still using `{merge,push}_access_level_attributes` instead of `{merge,push}_access_levels_attributes`. 2. The branches API creates access levels regardless of the state of the `developers_can_{push,merge}` parameters. This is in line with the UI, where Master access is the default for a new protected branch. 3. Use `after(:build)` to create access levels in the `protected_branches` factory, so that `factories_spec` passes. It only builds records, so we need to create access levels on `build` as well.
2016-07-29Use `Gitlab::Access` to protected branch access levels.Timothy Andrew
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.
2016-07-29Have the `branches` API work with the new protected branches data model.Timothy Andrew
1. The new data model moves from `developers_can_{push,merge}` to `allowed_to_{push,merge}`. 2. The API interface has not been changed. It still accepts `developers_can_push` and `developers_can_merge` as options. These attributes are inferred from the new data model. 3. Modify the protected branch create/update services to translate from the API interface to our current data model.
2016-07-19Simplify entities for branches and tags APIRobert Schilling
2016-07-19Only update onceRobert Schilling
2016-07-19API: Expose 'developers_can_merge' for branchesRobert Schilling
2016-07-19API: Expose 'developers_can_push' for branchesRobert Schilling
2016-07-01Enable Style/EmptyLines cop, remove redundant onesGrzegorz Bizon
2016-06-30Ensure that branch and tag names are given in APIRobert Schilling
2016-04-06Changed the argument of not_found for 'unprotect'Yasser Hussain
not_found appends string "Not Found" to the argument causing the resulting message to be "Branch does not exist Not Found" which is an incorrect error message. Changed the argument of not_found! for 'unprotect' command to "Branch" from "Branch does not exist". This makes the final error message to appear as "Branch Not Found" which is correct and same as error messages for other commands like 'protect'.