Skip to content

Cds ingestor#1345

Open
kennethrioja wants to merge 3 commits into
ElixirTeSS:masterfrom
kennethrioja:cds-ingestor
Open

Cds ingestor#1345
kennethrioja wants to merge 3 commits into
ElixirTeSS:masterfrom
kennethrioja:cds-ingestor

Conversation

@kennethrioja

Copy link
Copy Markdown
Contributor

Summary of changes

Motivation and context

Screenshots

N/A

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree to license it to the TeSS codebase under the BSD license.

@fbacall
fbacall requested a review from Copilot July 24, 2026 15:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new ingestion source for CERN CDS Videos (https://videos.cern.ch/) so TeSS can ingest CDS video records and search results (useful for HEPTraining).

Changes:

  • Introduces Ingestors::CdsVideosIngestor to ingest a single record URL or a paginated search query.
  • Registers the new ingestor in IngestorFactory.
  • Adds unit tests and a fixture payload covering record ingestion and paginated search ingestion.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
lib/ingestors/cds_videos_ingestor.rb New ingestor implementation for CDS Videos record/search ingestion.
lib/ingestors/ingestor_factory.rb Registers the CDS Videos ingestor so it’s selectable by method key.
test/unit/ingestors/cds_videos_ingestor_test.rb Unit tests for URL conversion, pagination, and record-to-material mapping.
test/fixtures/files/ingestion/cdsvideos/cds.ingestor.json Fixture CDS record response used by unit tests.
Comments suppressed due to low confidence (2)

lib/ingestors/cds_videos_ingestor.rb:24

  • @verbose is assigned but never read, which makes the method harder to scan and suggests dead code. If this isn’t used elsewhere, it should be removed.
      @verbose = false

test/unit/ingestors/cds_videos_ingestor_test.rb:81

  • This test definition is missing the usual two-space indentation, which makes the file inconsistent with the surrounding tests and can trip style checks.
test 'should read search source with pagination across multiple pages' do

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +83 to +99
metadata = data['metadata']&.transform_keys! { |k| k == '_cds' ? 'cds' : k }

material = OpenStruct.new
material.title = metadata.dig('title', 'title').titleize
material.url = "#{CDS_VIDEOS_RECORD_URL}#{data['id']}"
material.description = get_description(metadata)
material.keywords = metadata['keywords'][0..9]&.map { |k| k['name'] }&.join(', ') || ''
material.licence = metadata.dig('copyright', 'holder') == 'CERN' ? 'other-at' : 'notspecified'
material.status = 'Active'
material.contact = get_contact(metadata)
material.version = metadata['report_number'][0]
material.date_created = metadata['date']
material.date_published = metadata['publication_date']
material.authors = get_authors(metadata)
material.contributors = get_contributors(metadata)
material.resource_type = "#{metadata['type'].titleize} – #{metadata['category'].titleize}"
material
Comment on lines +2 to +4
require 'json'
require 'httparty'
require 'nokogiri'
Comment on lines +55 to +58
assert_equal 'Video – Lectures', sample.resource_type

expected_keywords = 'Ulrich Dorda, Beam cooling, high-intensity beams, beam quality, hadron beams, cooling techniques, beam emittance, stochastic cooling, electron cooling, ionization cooling'
assert_equal expected_keywords, sample.keywords
Comment on lines +7 to +9
@ingestor = Ingestors::CdsVideosIngestor.new
@user = users(:regular_user)
@content_provider = content_providers(:portal_provider)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants