Commit Graph

50 Commits

Author SHA1 Message Date
Nick Thomas 9f05e97aad
Run rubocop -a 2019-03-13 13:42:43 +00:00
Andrew Newdigate 3288e1a874 Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
2019-03-06 17:51:56 +02:00
Stan Hu 100b050b99 Fix import handling errors in Bitbucket Server importer
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20724 removed
`Gitlab::Git::RepositoryMirroring::RemoteError`, but this was still
being handled in the Bitbucket Server importer and only encountered if
some exception other than `Gitlab::Shell::Error` were thrown.
2019-01-18 15:54:24 -08:00
Stan Hu e96fd232a6 Remove unnecessary includes of ShellAdapter
Determined by running the script:

```
included = `git grep --name-only ShellAdapter`.chomp.split("\n")
used = `git grep --name-only gitlab_shell`.chomp.split("\n")
included - used
```
2018-12-05 23:19:27 -08:00
Tiago Botelho 4bd8a427d4
Removes all the irrelevant import related code and columns
Clears the import related columns and code from the Project
model over to the ProjectImportState model
2018-11-27 12:58:13 +00:00
gfyoung e166e5747c Enable some frozen string in lib/gitlab
Enable frozen string for the following files:

* lib/gitlab/auth/**/*.rb
* lib/gitlab/badge/**/*.rb
* lib/gitlab/bare_repository_import/**/*.rb
* lib/gitlab/bitbucket_import/**/*.rb
* lib/gitlab/bitbucket_server_import/**/*.rb
* lib/gitlab/cache/**/*.rb
* lib/gitlab/checks/**/*.rb

Partially addresses #47424.
2018-10-13 02:31:31 -07:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Stan Hu e850d4ea6c Add JSON logging for Bitbucket Server importer
Adds an importer.log so that it's easier to track what's happening with the import.
2018-08-30 10:58:31 -07:00
Stan Hu 09cdd7dca0 Bitbucket Server importer: Eliminate most idle-in-transaction issues
Just like with the GitHub importer, the Bitbucket Server importer can hit the
default 60 s idle-in-transaction timeouts if it takes too long to create the
merge request. We solve this by using the same approach as the GitHub importer:

1. Bypass all validation and hooks in creating a merge request
2. Insert the Git data in a separate transaction

Part of #50021
2018-08-26 07:13:36 -07:00
Stan Hu d8ce4f942b Remove date from author line since that is already present in `created_at` 2018-08-03 06:07:37 -07:00
Stan Hu 61f5c2e38c Add a comment when user can't be identified 2018-08-02 15:52:11 -07:00
Stan Hu db4ff688da Fix failing spec in fallback diff note change 2018-07-31 15:38:14 -07:00
Stan Hu da88f61b82 Improve formatting of fallback diff note 2018-07-31 15:33:21 -07:00
Stan Hu 2aa4d7f10f Fix bug where fallback diff notes would not have an associated position 2018-07-31 14:30:01 -07:00
Stan Hu 0b91a53302 Handle empty description field 2018-07-31 13:59:45 -07:00
Stan Hu 0085b76fb3 Give some context on threaded discussions 2018-07-31 11:33:37 -07:00
Stan Hu 89d164fbe9 Fix Rubocop complaint about update_attributes 2018-07-31 08:58:45 -07:00
Stan Hu 3cda8c93d8 Fix merge request SHA 2018-07-30 23:37:54 -07:00
Stan Hu 7c88c4af0e No need to look up commit SHA since Bitbucket has a full-length SHA 2018-07-30 23:19:36 -07:00
Stan Hu 7b23b55005 Restrict to confirmed users and allow memoization of unkonwn e-mails 2018-07-28 22:25:10 -07:00
Stan Hu f94b52256d Remove merge request deletion code 2018-07-20 22:31:17 -07:00
Stan Hu 69fe32a51c Disable recovery of missing SHAs by default 2018-07-20 09:45:59 -07:00
Stan Hu f673923d3f Fix and clean up code for deleting branches 2018-07-18 23:20:10 -07:00
Stan Hu a19a5b57e4 Improve formatting of diff notes that could not be imported 2018-07-17 21:42:07 -07:00
Stan Hu bb0603935d Some formatting cleanup 2018-07-17 15:58:12 -07:00
Stan Hu 099f9fcd13 Fallback to creating a note if DiffNote fails to import 2018-07-17 15:48:01 -07:00
Stan Hu da02df04ec Code cleanup and test threaded discussions 2018-07-17 15:01:33 -07:00
Stan Hu 78f23d3c17 Simplify user lookups 2018-07-17 13:53:48 -07:00
Stan Hu 7b288105ed Remove unneeded method 2018-07-17 13:46:09 -07:00
Stan Hu 11dd390c11 Add tests for pull request comments 2018-07-15 22:07:39 -07:00
Stan Hu 57c9a89313 Fix assorted bugs and write spec for importing merge event 2018-07-15 15:36:18 -07:00
Stan Hu 0d9f74d2f5 Delete temporary branches after an import 2018-07-13 15:43:15 -07:00
Stan Hu ec4109d413 Make Connection#post consistent with Connection#get and add specs 2018-07-12 23:17:05 -07:00
Stan Hu f85712fb98 Use browse URL of project to link imports 2018-07-12 15:26:37 -07:00
Stan Hu 8ab13e1497 Batch re-creating branches and fetching the remote 2018-07-05 21:51:12 -07:00
Stan Hu cc4a39cc54 Reduce number of API requests and fix merge request events 2018-07-05 21:11:29 -07:00
Stan Hu ee22da98f0 Assign merge event to ghost user if committer cannot be found 2018-07-03 16:44:32 -07:00
Stan Hu d3c75ea4d9 Support creating a remote branch to import closed pull requests 2018-07-03 16:37:17 -07:00
Stan Hu f4f4e02564 Add merge commit SHA 2018-07-01 08:26:30 -07:00
Stan Hu a4cbbfe465 Fix Rubocop complaints 2018-06-28 22:26:33 -07:00
Stan Hu 7b67350a0c Remove unnecessary code and fix branch names 2018-06-28 15:18:53 -07:00
Stan Hu ee5f8f2830 Fix generation of diff line positions 2018-06-28 13:48:25 -07:00
Stan Hu 5817c67014 Import threaded discussions in diffs 2018-06-28 01:49:35 -07:00
Stan Hu c4dbe61a84 First iteration of importing diff notes 2018-06-28 00:50:10 -07:00
Stan Hu 014abc9c07 Handle threaded comments and prepare for inline comments 2018-06-28 00:27:04 -07:00
Stan Hu 5728ffbf12 Import standalone pull request comments 2018-06-27 14:25:09 -07:00
Stan Hu 615e180799 More work towards importing pull requests 2018-06-26 15:59:47 -07:00
Stan Hu d7c79839d3 wip 2018-06-25 23:32:28 -07:00
Stan Hu 046a5e398d More work towards supporting Bitbucket Server 2018-06-25 22:40:11 -07:00
Stan Hu c9deb7cef8 Copy and paste importer from Bitbucket Importer 2018-06-25 13:13:59 -07:00