Commit graph

5 commits

Author SHA1 Message Date
Jacopo
9000626a60 Moves Uniquify counter in the initializer 2018-04-19 13:56:37 +02:00
Jacopo
6ae3098eb8 Uses Uniquify to calculate Issue#suggested_branch_name 2018-04-19 13:56:37 +02:00
Timothy Andrew
f2ed82fa84
Implement final review comments from @DouweM and @rymai
- Have `Uniquify` take a block instead of a Proc/function. This is more
  idiomatic than passing around a function in Ruby.

- Block a user before moving their issues to the ghost user. This avoids a data
  race where an issue is created after the issues are migrated to the ghost user,
  and before the destroy takes place.

- No need to migrate issues (to the ghost user) in a transaction, because
  we're using `update_all`

- Other minor changes
2017-02-24 16:50:20 +05:30
Timothy Andrew
8f01644ff4
Implement review comments from @rymai and @yorickpeterse
1. Refactoring and specs in the `Uniquify` class.

2. Don't use the `AdvisoryLocking` class. Similar functionality is
provided (backed by Redis) in the `ExclusiveLease` class.
2017-02-24 16:50:20 +05:30
Timothy Andrew
ca16c3734b
Extract code from Namespace#clean_path for ghost user generation.
1. Create a `Uniquify` class, which generalizes the process of generating unique
   strings, by accepting a function that defines what "uniqueness" means in a
   given context.

2. WIP: Make sure tests for `Namespace` pass, add more if necessary.

3. WIP: Add tests for `Uniquify`
2017-02-24 16:50:19 +05:30