Clear Redis cache and repositories/ directory when running rake dev:setup
We've had numerous team members have issues seeding projects because the repositories/ directories already existed on disk. I ran into a second problem today where retrying the seed failed because the repository existence check in https://gitlab.com/gitlab-org/gitlab/blob/8b2c59c61c1d9a0c9f5f1176cc298f42f2181824/ee/app/models/ee/project.rb#L356 was true, when it should have been false.
I propose that we find some way to:
- Wipe the
repositories/directory. Right now it's not that straightforward to do this in the Rake task because technically Rails isn't supposed to know about file paths, but Gitaly does. We could send an RPC to Gitaly to move the old project paths out of the way, or do the clean via a GDK command. - Flush the Redis cache. Maybe the same GDK command can run
flushdbon the Redis instance.
This is really the same issue as #988, but I wanted to call attention to it.
/cc: @ashmckenzie, @caalberts
Edited by Stan Hu