遇到无法彻底删除project的问题,采用如下脚步解决:
sudo gitlab-rails console
irb(main):001:0> Project.unscoped.where(pending_delete: true).map(&:name_with_namespace)
=> ["applaudience / filming-locations-map", "applaudience / showtime-data-scraper-sources"]
irb(main):002:0>
irb(main):003:0* Project.unscoped.where(pending_delete: true)
=> #<ActiveRecord::Relation [#<Project id:97 applaudience/filming-locations-map>, #<Project id:76 applaudience/showtime-data-scraper-sources>]>
irb(main):004:0> p = Project.unscoped.find(76)
=> #<Project id:76 applaudience/showtime-data-scraper-sources>
irb(main):005:0> p.pending_delete
=> true
irb(main):006:0> p.pending_delete = false
=> false
irb(main):007:0> p.save
=> true
irb(main):008:0> p.errors.full_messages
=> []
irb(main):009:0> u = User.find_by_username('gajus')
=> #<User id:4 @gajus>
irb(main):010:0> Projects::DestroyService.new(p, u, {}).execute
Scoped order and limit are ignored, it's forced to be batch order and batch size
=> true