Skip to content

Commit 29d5694

Browse files
authored
AP-536 okcomputer head requests (#33)
* using head requests for alma and wowza okcomputer * use berkeley_library-util gem to add head_check for okcomputer * update CHANGES.md
1 parent 87c4787 commit 29d5694

7 files changed

Lines changed: 98 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
/test/tmp/
4141
/test/version_tmp/
4242
/tmp/
43+
/vendor/
4344

4445
# Used by dotenv library to load environment variables.
4546
# .env

CHANGES.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,84 @@
1+
# 1.1.5 (2026-02-05)
2+
3+
* AP-536 Change some OkComputer healthchecks to HEAD requests
4+
Alma and Wowza healthchecks now use HEAD requests, mainly because
5+
we are only concerned with service status for these checks, and
6+
because Alma, specifically, responds much faster for HEAD requests
7+
than for GET requests.
8+
* Adds the Berkeley_Library_Util gem to enable a new, extended version
9+
of OkComputer's HTTPCheck that is called HeadCheck.
10+
* OkComputer uses open-uri under the hood, which does not support HEAD
11+
requests, so we used our own Requester wrapper for RestClient to
12+
extend support.
13+
14+
# 1.1.4 (2026-01-15)
15+
16+
* ADA-669 stylesheets: Refactor header imprint styles
17+
Before this change, the containing `a` element was using a `display`
18+
of `contents`, which caused the elements to be inaccessible via the
19+
keyboard. Changing the `a` to be a simple flex item caused various
20+
other layout issues that were corrected:
21+
* `vertical-align` was set to `middle` for both the image and text,
22+
allowing them to look mostly the same as before.
23+
* Added `text-align: center` to ensure the elements are centred on
24+
mobile-sized viewports in column layout mode.
25+
* On mobile, the image remains a `block` element so that it causes a
26+
hard break in the flex grid (otherwise, on larger mobile/tablet
27+
screen sizes, it is undersized and the "Audio/Video" appears next to
28+
the logo element). On desktop, they are no longer required to be
29+
`block` elements.
30+
* Additionally, the fixed width size of the logo is now set as the
31+
`max-width`, and a `width` of `100%` is used. This allows the logo
32+
to shrink on very small viewports, such as an iPhone 11 in 2x zoom
33+
mode. The iPhone 11 @ 2x has an effective viewport of 305px, which
34+
is smaller than the 315px width and caused the logo to be cut off
35+
with the current rules.
36+
* ADA-670 Rework HTML markup for records
37+
* Use `<ARTICLE/>` for the overall record container; each track remains
38+
its own `<SECTION/>` which makes more semantic sense.
39+
* Use `<ASIDE/>` instead of `<UL/>` for track information. This is the
40+
intent for this tag (ancillary information about the section it appears
41+
inside or next to), and fixes the accessibility issue of improperly
42+
using a list for markup of something that is not a list.
43+
* ADA-674 Use the `aria-pressed` attribute on fullscreen
44+
* This adds the `aria-pressed` attribute for the fullscreen button. The
45+
value toggles in the enterFullScreen/exitFullScreen methods.
46+
* Notably, the value is always `false` in Safari / iOS WebKit. This is
47+
because the WebKit's native fullscreen view disable access to the DOM
48+
and all elements. There is no way to interact or manipulate them from
49+
the fullscreen view. This should be fine, because that means any time
50+
the user can interact with them, the pressed value should be false.
51+
* ADA-667 Always set ARIA attributes on time scrubber
52+
* This is a backport of https://github.com/mediaelement/mediaelement/pull/2986,
53+
which is described in https://github.com/mediaelement/mediaelement/issues/2908.
54+
* Co-authored-by: Raphael Krusenbaum <rkrusenb-git@noreply.materna.group>
55+
* ADA-667 Add volume status element to volume slider
56+
* This fixes https://github.com/mediaelement/mediaelement/issues/2950 and
57+
https://github.com/mediaelement/mediaelement/issues/2976, and is a full
58+
backport of https://github.com/mediaelement/mediaelement/pull/2988.
59+
* Co-authored-by: Raphael Krusenbaum <rkrusenb-git@noreply.materna.group>
60+
61+
# 1.1.3 (2026-01-13)
62+
63+
* DP-2239 updating footer image to ucb svg
64+
* Instead of changing the colour of links on hover to the highlight
65+
colour (which results in very poor contrast), use the box shadow
66+
effect that we already use in Framework and Lost-and-Found.
67+
* For the login button on the header, change the cursor to a pointer
68+
so it appears as a link, instead of leaving it as an arrow since it
69+
actually is a button. This helps POLA / UX.
70+
71+
Closes: ADA-668
72+
73+
# 1.1.2 (2026-01-12)
74+
75+
* update library logo
76+
77+
# 1.1.1 (2025-12-17)
78+
79+
* fix mutiplatform builds
80+
* ensures test artifacts are copied out
81+
182
# 1.1.0 (2025-12-09)
283

384
* AP-533: pass in image build arguments (#22)

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ruby ruby_version_exact
88
gem 'berkeley_library-av-core', '~> 0.5.0'
99
gem 'berkeley_library-docker', '~> 0.2.0'
1010
gem 'berkeley_library-logging', '~> 0.2'
11+
gem 'berkeley_library-util', '~> 0.3'
1112
gem 'browser', '~> 4.2'
1213
gem 'jbuilder', '~> 2.13'
1314
gem 'mutex_m'

Gemfile.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ GEM
9595
marc (~> 1.0)
9696
parslet (~> 2.0)
9797
ruby-marc-spec (~> 0.1)
98-
berkeley_library-util (0.2.0)
98+
berkeley_library-util (0.3.0)
9999
berkeley_library-logging (~> 0.3)
100100
rest-client (~> 2.1)
101101
typesafe_enum (~> 0.3)
@@ -421,13 +421,15 @@ PLATFORMS
421421
arm64-darwin-21
422422
arm64-darwin-22
423423
arm64-darwin-23
424+
arm64-darwin-25
424425
x86_64-darwin-19
425426
x86_64-linux
426427

427428
DEPENDENCIES
428429
berkeley_library-av-core (~> 0.5.0)
429430
berkeley_library-docker (~> 0.2.0)
430431
berkeley_library-logging (~> 0.2)
432+
berkeley_library-util (~> 0.3)
431433
brakeman
432434
browser (~> 4.2)
433435
bundle-audit

config/initializers/okcomputer.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# frozen_string_literal: true
22

3+
require 'berkeley_library/util/uris/head_check'
4+
35
# Health check configuration
46

57
OkComputer.logger = Rails.logger
@@ -27,12 +29,12 @@ def check
2729
end
2830

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

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

3739
# Ensure Wowza is working
38-
OkComputer::Registry.register 'wowza-streaming', OkComputer::HttpCheck.new(WOWZA_TEST_URL)
40+
OkComputer::Registry.register 'wowza-streaming', BerkeleyLibrary::Util::HeadCheck.new(WOWZA_TEST_URL)

spec/request/okcomputer_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
RSpec.describe 'OKComputer', type: :request do
44
before do
5-
stub_sru_request('b23305522')
5+
stub_sru_head_request('b23305522')
66

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

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

2120
it 'returns all checks to /health' do
2221
get '/health'
22+
2323
expect(response).to have_http_status :ok
2424
expect(response.parsed_body.keys).to match_array %w[
2525
alma-metadata

spec/spec_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ def stub_sru_request(record_id, body: nil)
7272
stub_request(:get, sru_url).to_return(status: 200, body: body || File.new(alma_sru_data_path_for(record_id)))
7373
end
7474

75+
def stub_sru_head_request(record_id)
76+
sru_url = alma_sru_url_for(record_id)
77+
stub_request(:head, sru_url).to_return(status: 200)
78+
end
79+
7580
def alma_marc_record_for(record_id)
7681
marc_xml_path = alma_sru_data_path_for(record_id)
7782
MARC::XMLReader.new(marc_xml_path).first

0 commit comments

Comments
 (0)