Commit Graph

10 Commits

Author SHA1 Message Date
Douwe Maan 44cbfeaba8 Merge branch 'adam-fix-labels-find-or-create' into 'master'
Pass user instance to Labels::FindOrCreateService or skip_authorization: true

## What does this MR do?

It fixes a bug described in #23694 when `project.owner` was passed to `Labels::FindOrCreateService`. `Labels::FindOrCreateService` expected a user instance and `project.owner` may return a group as well. This MR makes sure that we either pass a user instance or `skip_authorization: true`.

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

- places where we pass `skip_authorization: true`

## Does this MR meet the acceptance criteria?

- Tests
  - [x] 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)
- [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?

Fixes #23694

See merge request !7093
2016-10-28 15:01:59 +00:00
Adam Niedzielski e2c603696a Pass user instance to Labels::FindOrCreateService or skip_authorization: true
Do not pass project.owner because it may return a group and Labels::FindOrCreateService
throws an error in this case.
Fixes #23694.
2016-10-28 11:31:45 +02:00
Ahmad Sherif 14fbd25d06 Modify GitHub importer to be retryable 2016-10-28 11:30:20 +02:00
Douglas Barbosa Alexandre 4f6d1c1d70 Rename Labels::CreateService to Labels::FindOrCreateService 2016-10-19 14:58:28 -02:00
Douglas Barbosa Alexandre f0ad0ceff5 Fix GitHub importer spec 2016-10-19 14:58:28 -02:00
Douglas Barbosa Alexandre d009d38ed6 User Labes::CreateService to create labels 2016-10-19 14:58:27 -02:00
Douglas Barbosa Alexandre 02761638f1 Avoid conflict with admin labels when importing GitHub labels 2016-09-09 11:22:38 -03:00
Douglas Barbosa Alexandre 67c02edccf Move create! method from formatters to the BaseFormatter 2016-06-06 14:26:28 -03:00
Douglas Barbosa Alexandre 9437b8a2e4 Import GitHub repositories respecting the API rate limit
While Octokit auto pagination set the page size to the maximum 100, and
seek to not overstep the rate limit. When the rate limit is reached its
raises an exception, and stop doing new requests.

Here we use a custom pattern for traversing large lists, so we can
check if we’ll reach the rate limit and wait the API to reset the rate
limit before making new requests.
2016-06-06 12:12:18 -03:00
Douglas Barbosa Alexandre 05a4f444c3 Import labels from GitHub 2016-04-18 17:14:59 -03:00