• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / bibdata / f04bc944-f9b4-4a42-8b26-dcacd0e3e688

11 Mar 2025 10:27PM UTC coverage: 34.017% (-58.1%) from 92.162%
f04bc944-f9b4-4a42-8b26-dcacd0e3e688

Pull #2653

circleci

christinach
Add new lc_subject_facet field.
Helps with the vocabulary work https://github.com/pulibrary/orangelight/pull/3386
In this new field we index only the lc subject heading and the subdivisions
So that when the user searches using the Details section, they can query solr for
all the subject headings and their divisions.

This is needed for the Subject browse Vocabulary work.
example: "lc_subject_facet": [
             "Booksellers and bookselling—Italy—Directories",
             "Booksellers and bookselling-Italy",
             "Booksellers and bookselling"
              ]
Pull Request #2653: Add new lc_subject_facet field.

1 of 3 new or added lines in 1 file covered. (33.33%)

2215 existing lines in 93 files now uncovered.

1294 of 3804 relevant lines covered (34.02%)

0.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

23.08
/app/models/scsb_full_records_request.rb
1
class ScsbFullRecordsRequest
1✔
2
  attr_accessor :scsb_env, :email
1✔
3

4
  def initialize(scsb_env, email)
1✔
UNCOV
5
    @scsb_env = scsb_env
×
UNCOV
6
    @email = email
×
7
  end
8

9
  def scsb_host
1✔
UNCOV
10
    case scsb_env
×
11
    when 'uat'
UNCOV
12
      'https://uat-recap.htcinc.com:9093'
×
13
    when 'production'
UNCOV
14
      'https://scsb.recaplib.org:9093'
×
15
    end
16
  end
17

18
  def scsb_conn
1✔
UNCOV
19
    Faraday.new(url: scsb_host) do |faraday|
×
UNCOV
20
      faraday.request(:url_encoded)
×
21
    end
22
  end
23

24
  # See https://scsb.recaplib.org:9093/swagger-ui.html#/data-dump-rest-controller/exportDataDump for documentation
25
  def scsb_request(institution_code)
1✔
UNCOV
26
    response = scsb_conn.get do |req|
×
UNCOV
27
      req.path = '/dataDump/exportDataDump'
×
UNCOV
28
      req.params['collectionGroupIds'] = '1,2,5,6'
×
UNCOV
29
      req.params['emailToAddress'] = email
×
UNCOV
30
      req.params['fetchType'] = 10
×
UNCOV
31
      req.params['imsDepositoryCodes'] = repository_codes(institution_code)
×
UNCOV
32
      req.params['institutionCodes'] = institution_code
×
UNCOV
33
      req.params['outputFormat'] = 0
×
UNCOV
34
      req.params['requestingInstitutionCode'] = 'PUL'
×
UNCOV
35
      req.params['transmissionType'] = 0
×
UNCOV
36
      req.headers['Accept'] = '*/*'
×
UNCOV
37
      req.headers['api_key'] = scsb_auth_key
×
38
    end
UNCOV
39
    expected_response_body = 'Export process has started and we will send an email notification upon completion'
×
UNCOV
40
    Rails.logger.error("Received unexpected response: #{response.body}") unless response.body == expected_response_body
×
UNCOV
41
    response
×
42
  rescue Faraday::ConnectionFailed, Faraday::TimeoutError => e
43
    Rails.logger.warn("#{self.class}: Connection error for #{scsb_server}")
×
44
    raise e
×
45
  end
46

47
  def repository_codes(institution_code)
1✔
UNCOV
48
    case institution_code
×
49
    when 'PUL', 'CUL'
UNCOV
50
      'RECAP'
×
51
    when 'HL'
UNCOV
52
      'RECAP,HD'
×
53
    end
54
  end
55

56
  private
1✔
57

58
    def scsb_auth_key
1✔
UNCOV
59
      if Rails.env.test?
×
UNCOV
60
        'TESTME'
×
61
      else
62
        ENV['SCSB_AUTH_KEY']
×
63
      end
64
    end
65
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc