• 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

27.27
/app/models/scsb/partner_updates/full.rb
1
module Scsb
1✔
2
  class PartnerUpdates
1✔
3
    class Full < Update
1✔
4
      def initialize(dump:, dump_file_type:, timestamp: DateTime.now.to_time)
1✔
UNCOV
5
        super
×
6
      end
7

8
      def self.validate_csv(dump_id, file, institution)
1✔
UNCOV
9
        matches_expected_collections = false
×
UNCOV
10
        raise StandardError, "No metadata files found matching #{institution}" unless file
×
11

UNCOV
12
        csv = CSV.read(file, headers: true)
×
UNCOV
13
        group_ids = csv['Collection Group Id(s)'].first
×
UNCOV
14
        matches_expected_collections = group_ids == '1*2*5*6'
×
UNCOV
15
        filename = File.basename(file)
×
UNCOV
16
        scsb_file_dir = ENV['SCSB_FILE_DIR']
×
UNCOV
17
        destination_filepath = "#{scsb_file_dir}/#{filename}"
×
UNCOV
18
        FileUtils.move(file, destination_filepath)
×
UNCOV
19
        Dump.attach_dump_file(dump_id, destination_filepath, :recap_records_full_metadata)
×
UNCOV
20
        File.unlink(destination_filepath) if File.exist?(destination_filepath)
×
UNCOV
21
        unless matches_expected_collections
×
UNCOV
22
          raise StandardError, "Metadata file indicates that dump for #{institution} does not include the correct Group IDs, not processing. Group ids: #{group_ids}"
×
23
        end
24

UNCOV
25
        matches_expected_collections
×
26
      end
27

28
      def self.download_full_file(institution, extension)
1✔
UNCOV
29
        Scsb::S3Bucket.partner_transfer_client.download_recent(
×
30
          prefix: ENV['SCSB_S3_PARTNER_FULLS'] || 'data-exports/PUL/MARCXml/Full',
31
          output_directory: ENV['SCSB_PARTNER_UPDATE_DIRECTORY'] || '/tmp/updates',
32
          file_filter: /#{institution}.*\.#{extension}/
33
        )
34
      end
35
    end
36
  end
37
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