-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add http checksum endpoints to support polling
- Loading branch information
Showing
13 changed files
with
356 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class FixityCheck < ApplicationRecord | ||
enum status: { pending: 0, in_progress: 1, success: 2, failure: 3 } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class CreateFixityChecks < ActiveRecord::Migration[7.1] | ||
def change | ||
create_table :fixity_checks do |t| | ||
t.string :job_identifier, null: false, limit: 255 | ||
t.string :bucket_name, null: false | ||
t.string :object_path, null: false | ||
t.string :checksum_algorithm_name, null: false | ||
t.string :checksum_hexdigest, null: true | ||
t.bigint :object_size, null: true | ||
t.integer :status, null: false, default: 0 | ||
t.text :error_message, null: true | ||
t.timestamps | ||
end | ||
add_index :fixity_checks, :job_identifier, unique: true | ||
add_index :fixity_checks, :updated_at | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
FactoryBot.define do | ||
factory :fixity_check do | ||
job_identifier { SecureRandom.uuid } | ||
bucket_name { 'sample_bucket' } | ||
object_path { 'some/object/path' } | ||
checksum_algorithm_name { 'sha256' } | ||
|
||
trait :in_progress do | ||
status { 'in_progress' } | ||
end | ||
|
||
trait :failure do | ||
status { 'failure' } | ||
error_message { 'An error occurred and this is the message associated with it.' } | ||
end | ||
|
||
trait :success do | ||
status { 'success' } | ||
example_content = 'example' | ||
checksum_hexdigest { Digest::SHA256.hexdigest(example_content) } | ||
object_size { example_content.bytesize } | ||
end | ||
end | ||
end |
Oops, something went wrong.