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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
/test/tmp/
/test/version_tmp/
/tmp/
/vendor/

# Used by dotenv library to load environment variables.
# .env
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Current Changelog moved to GitHub releases page
Comment thread
jason-raitz marked this conversation as resolved.
Outdated

* https://github.com/BerkeleyLibrary/avplayer/releases
Comment thread
jason-raitz marked this conversation as resolved.
Outdated

# 1.1.0 (2025-12-09)

* AP-533: pass in image build arguments (#22)
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ruby ruby_version_exact
gem 'berkeley_library-av-core', '~> 0.5.0'
gem 'berkeley_library-docker', '~> 0.2.0'
gem 'berkeley_library-logging', '~> 0.2'
gem 'berkeley_library-util', '~> 0.3'
gem 'browser', '~> 4.2'
gem 'jbuilder', '~> 2.13'
gem 'mutex_m'
Expand Down
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ GEM
marc (~> 1.0)
parslet (~> 2.0)
ruby-marc-spec (~> 0.1)
berkeley_library-util (0.2.0)
berkeley_library-util (0.3.0)
berkeley_library-logging (~> 0.3)
rest-client (~> 2.1)
typesafe_enum (~> 0.3)
Expand Down Expand Up @@ -421,13 +421,15 @@ PLATFORMS
arm64-darwin-21
arm64-darwin-22
arm64-darwin-23
arm64-darwin-25
x86_64-darwin-19
x86_64-linux

DEPENDENCIES
berkeley_library-av-core (~> 0.5.0)
berkeley_library-docker (~> 0.2.0)
berkeley_library-logging (~> 0.2)
berkeley_library-util (~> 0.3)
brakeman
browser (~> 4.2)
bundle-audit
Expand Down
8 changes: 5 additions & 3 deletions config/initializers/okcomputer.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# frozen_string_literal: true

require 'berkeley_library/util/uris/head_check'

# Health check configuration

OkComputer.logger = Rails.logger
OkComputer.check_in_parallel = true
OkComputer.check_in_parallel = !Rails.env.test?
Comment thread
jason-raitz marked this conversation as resolved.
Outdated

ALMA_TEST_ID = 'b23305522'
TIND_TEST_ID = '(pacradio)01469'
Expand All @@ -27,12 +29,12 @@ def check
end

# Ensure Alma API is working.
OkComputer::Registry.register 'alma-metadata', OkComputer::HttpCheck.new(ALMA_TEST_URL)
OkComputer::Registry.register 'alma-metadata', BerkeleyLibrary::Util::HeadCheck.new(ALMA_TEST_URL)

# Ensure TIND API is working. This cannot use `OkComputer::HttpCheck`
# out of the box as we can't yet inject headers into the request without
# subclassing the whole thing.
OkComputer::Registry.register 'tind-metadata', TindCheck.new

# Ensure Wowza is working
OkComputer::Registry.register 'wowza-streaming', OkComputer::HttpCheck.new(WOWZA_TEST_URL)
OkComputer::Registry.register 'wowza-streaming', BerkeleyLibrary::Util::HeadCheck.new(WOWZA_TEST_URL)
6 changes: 3 additions & 3 deletions spec/request/okcomputer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

RSpec.describe 'OKComputer', type: :request do
before do
stub_sru_request('b23305522')
stub_sru_head_request('b23305522')

hls_manifest = File.read('spec/data/playlist.m3u8')
manifest_url = 'https://wowza.lib.berkeley.edu/Pacifica/mp3:PRA_NHPRC1_AZ1084_00_000_00.mp3/playlist.m3u8'
stub_request(:get, manifest_url).to_return(status: 200, body: hls_manifest)
stub_request(:head, manifest_url).to_return(status: 200)

record_id = '(pacradio)01469'
tind_url = BerkeleyLibrary::AV::Metadata::Source::TIND.marc_uri_for(record_id)
Expand All @@ -20,6 +19,7 @@

it 'returns all checks to /health' do
get '/health'

expect(response).to have_http_status :ok
expect(response.parsed_body.keys).to match_array %w[
alma-metadata
Expand Down
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ def stub_sru_request(record_id, body: nil)
stub_request(:get, sru_url).to_return(status: 200, body: body || File.new(alma_sru_data_path_for(record_id)))
end

def stub_sru_head_request(record_id)
sru_url = alma_sru_url_for(record_id)
stub_request(:head, sru_url).to_return(status: 200)
end

def alma_marc_record_for(record_id)
marc_xml_path = alma_sru_data_path_for(record_id)
MARC::XMLReader.new(marc_xml_path).first
Expand Down