Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions app/services/efile/gyr_efiler_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

module Efile
class GyrEfilerService
CURRENT_VERSION = 'ae332c44bac585fb9dbec9bf32ffff0d34a72830'
POSTGRES_LOCK_PREFIX = 1640661264
RETRYABLE_LOG_CONTENTS = [
/Transaction Result: The server sent HTTP status code 302: Moved Temporarily/,
Expand All @@ -18,6 +17,15 @@ class GyrEfilerService
/HTTP transport error: javax.net.ssl.SSLException/,
]

# TODO: Update this to unconditionally return the newer commit hash (8c46c9) after Jan 1 2026
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👉 👈 can you put this in jira instead of a todo comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

def self.current_version
if Rails.env.production? && Date.today.year < 2026
'ae332c44bac585fb9dbec9bf32ffff0d34a72830'
else
'8c46c9dccfc4da4b0acec5813966b1ba68abe245'
end
end

def self.run_efiler_command(*args)
Dir.mktmpdir do |working_directory|
FileUtils.mkdir_p(File.join(working_directory, "output", "log"))
Expand Down Expand Up @@ -80,7 +88,7 @@ def self.ensure_config_dir_prepared
FileUtils.mkdir_p(config_dir)
return if File.exist?(File.join(config_dir, '.ready'))

config_zip_path = Dir.glob(Rails.root.join("vendor", "gyr_efiler", "gyr-efiler-config-#{CURRENT_VERSION}.zip"))[0]
config_zip_path = Dir.glob(Rails.root.join("vendor", "gyr_efiler", "gyr-efiler-config-#{current_version}.zip"))[0]
raise StandardError.new("Please run rake setup:download_gyr_efiler then try again") if config_zip_path.nil?

system!("unzip -o #{config_zip_path} -d #{Rails.root.join("tmp", "gyr_efiler")}")
Expand Down Expand Up @@ -108,7 +116,7 @@ def self.ensure_config_dir_prepared
end

def self.ensure_gyr_efiler_downloaded
classes_zip_path = Dir.glob(Rails.root.join("vendor", "gyr_efiler", "gyr-efiler-classes-#{CURRENT_VERSION}.zip"))[0]
classes_zip_path = Dir.glob(Rails.root.join("vendor", "gyr_efiler", "gyr-efiler-classes-#{current_version}.zip"))[0]
raise StandardError.new("You must run rails setup:download_gyr_efiler") if classes_zip_path.nil?

return classes_zip_path
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/setup.rake
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace :setup do

task download_gyr_efiler: :environment do |_task|
paths = [
Rails.root.join('vendor', 'gyr_efiler', "gyr-efiler-classes-#{Efile::GyrEfilerService::CURRENT_VERSION}.zip"),
Rails.root.join('vendor', 'gyr_efiler', "gyr-efiler-config-#{Efile::GyrEfilerService::CURRENT_VERSION}.zip")
Rails.root.join('vendor', 'gyr_efiler', "gyr-efiler-classes-#{Efile::GyrEfilerService.current_version}.zip"),
Rails.root.join('vendor', 'gyr_efiler', "gyr-efiler-config-#{Efile::GyrEfilerService.current_version}.zip")
]
# If the file already exists, do not re-download.
next if paths.all? { |p| File.exist?(p) }
Expand Down
Loading