Skip to content

Commit

Permalink
Remove unused backfill rake tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Giddins <[email protected]>
  • Loading branch information
segiddins committed Sep 19, 2024
1 parent 2ffe934 commit fd7570c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 123 deletions.
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ Style/StringLiterals:
Style/FrozenStringLiteralComment:
Enabled: false

Security/MarshalLoad:
Enabled: false

Style/EmptyMethod:
EnforcedStyle: expanded

Expand Down
78 changes: 0 additions & 78 deletions lib/tasks/gemcutter.rake
Original file line number Diff line number Diff line change
Expand Up @@ -26,84 +26,6 @@ namespace :gemcutter do
end
end

namespace :checksums do
desc "Initialize missing checksums."
task init: :environment do
without_sha256 = Version.where(sha256: nil)
mod = ENV["shard"]
without_sha256.where("id % 4 = ?", mod.to_i) if mod

total = without_sha256.count
i = 0
without_sha256.find_each do |version|
GemcutterTaskshelper.recalculate_sha256!(version)
i += 1
print format("\r%.2f%% (%d/%d) complete", i.to_f / total * 100.0, i, total)
end
puts
puts "Done."
end

desc "Check existing checksums."
task check: :environment do
failed = false
i = 0
total = Version.count
Version.find_each do |version|
actual_sha256 = GemcutterTaskshelper.recalculate_sha256(version.full_name)
if actual_sha256 && version.sha256 != actual_sha256
puts "#{version.full_name}.gem has sha256 '#{actual_sha256}', " \
"but '#{version.sha256}' was expected."
failed = true
end
i += 1
print format("\r%.2f%% (%d/%d) complete", i.to_f / total * 100.0, i, total)
end
end
end

namespace :metadata do
desc "Backfill old gem versions with metadata."
task backfill: :environment do
without_metadata = Version.where("metadata = ''")
mod = ENV["shard"]
without_metadata = without_metadata.where("id % 4 = ?", mod.to_i) if mod

total = without_metadata.count
i = 0
puts "Total: #{total}"
without_metadata.find_each do |version|
GemcutterTaskshelper.recalculate_metadata!(version)
i += 1
print format("\r%.2f%% (%d/%d) complete", i.to_f / total * 100.0, i, total)
end
puts
puts "Done."
end
end

namespace :required_ruby_version do
desc "Backfill gem versions with rubygems_version."
task backfill: :environment do
ActiveRecord::Base.logger.level = 1 if Rails.env.development?

without_required_ruby_version = Version.where("created_at < '2014-03-21' and required_ruby_version is null and indexed = true")
mod = ENV["shard"]
without_required_ruby_version = without_required_ruby_version.where("id % 4 = ?", mod.to_i) if mod

total = without_required_ruby_version.count
i = 0
puts "Total: #{total}"
without_required_ruby_version.find_each do |version|
GemcutterTaskshelper.assign_required_ruby_version!(version)
i += 1
print format("\r%.2f%% (%d/%d) complete", i.to_f / total * 100.0, i, total)
end
puts
puts "Done."
end
end

namespace :typo do
desc "Add names to gem typo exception list\nUsage: rake gemcutter:typo:exception[<gem_name>,<info>]"
task :exception, %i[name info] => %i[environment] do |_task, args|
Expand Down
42 changes: 0 additions & 42 deletions lib/tasks/helpers/gemcutter_tasks_helper.rb

This file was deleted.

0 comments on commit fd7570c

Please sign in to comment.