Skip to content

Lutaml integration#75

Draft
andrew2net wants to merge 27 commits intomainfrom
lutaml-integration
Draft

Lutaml integration#75
andrew2net wants to merge 27 commits intomainfrom
lutaml-integration

Conversation

@andrew2net
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread lib/relaton/itu.rb
# gem_path = File.expand_path "..", __dir__
# grammars_path = File.join gem_path, "grammars", "*"
# grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
Digest::MD5.hexdigest Relaton::Itu::VERSION + Relaton::Bib::VERSION # grammars
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Line is too long. [84/80]

module Itu
class ApprovalStage < Lutaml::Model::Serializable
attribute :process, :string, values: %w[tap aap]
attribute :content, :string, values: %w[determined in-force a lc ac lj aj na ar ri at sg c tap]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Line is too long. [101/80]

TYPES = %w[
recommendation recommendation-supplement recommendation-amendment recommendation-corrigendum
recommendation-errata recommendation-annex focus-group implementers-guide technical-paper
technical-report joint-itu-iso-iec resolution service-publication handbook question contribution
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Line is too long. [104/80]

class Doctype < Bib::Doctype
TYPES = %w[
recommendation recommendation-supplement recommendation-amendment recommendation-corrigendum
recommendation-errata recommendation-annex focus-group implementers-guide technical-paper
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Line is too long. [97/80]

module Itu
class Doctype < Bib::Doctype
TYPES = %w[
recommendation recommendation-supplement recommendation-amendment recommendation-corrigendum
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Line is too long. [100/80]

Comment thread lib/relaton/itu/editorial_group.rb Outdated
module Relaton
module Itu
class EditorialGroup < Lutaml::Model::Serializable
choice(min:1, max:1) do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Space missing after colon.

Comment thread lib/relaton/itu/group.rb Outdated

attribute :type, :string, values: %w[
tsag study-group focus-group adhoc-group correspondence-group joint-coordination-activity
working-party working-group rapporteur-group intersector-rapporteur-group regional-group
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Line is too long. [96/80]

Comment thread lib/relaton/itu/group.rb Outdated
end

attribute :type, :string, values: %w[
tsag study-group focus-group adhoc-group correspondence-group joint-coordination-activity
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Line is too long. [97/80]

@ronaldtse
Copy link
Copy Markdown
Contributor

@andrew2net when are you planning to merge this?

@andrew2net
Copy link
Copy Markdown
Contributor Author

@ronaldtse it can be merged when all relaton-* gems v2 are ready. We can't use the new gems with old ones together.
I'm going to release v2 relaton-iso, relaton-bib today. Also, an updated puid-iso will be released (it can parse URNs now).
All the relaton-* gems have implemented flavor models with lutal-model. Next, their parsers, scrapers, tests, etc need to be adapted to their new models.
It's hard to say how long it will take to update all relaton-* gems. I'm sure it will be faster after relaton-iso, because now there is a pattern of how to do it. I'll do my best to finish it as fast as I can. Let's assume it can take 1 relaton gem per day.

- Implemented DataFetcher class to handle fetching of ITU-R documents from the search API.
- Added search_request method for making POST requests and handling pagination.
- Updated DataParserR to parse results from the new API structure, including fetching document identifiers, titles, publication dates, and sources.
- Enhanced tests for DataFetcher to cover pagination and error handling.
- Refactored DataParserR tests to align with the new parsing logic and added cases for different document types.
- Created Processor class to manage document processing and fetching.
Comment on lines +105 to +111
case value
when /(\w+),?\s+(\d{4})/
month = Date::MONTHNAMES.index($1)
month ? "#{$2}-#{format('%02d', month)}" : $2
when /(\d{4})/
$1
end

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on a
library input
may run slow on strings with many repetitions of 'a'.
This
regular expression
that depends on a
library input
may run slow on strings with many repetitions of 'a'.
This
regular expression
that depends on a
user-provided value
may run slow on strings with many repetitions of 'a'.
Comment thread lib/relaton/itu/pubid.rb
private

def date_from_code(code)
/(?<cod>.+?)-(?<date>\d{6})(?:-I|$)/ =~ code

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on a
library input
may run slow on strings with many repetitions of 'a'.
andrew2net and others added 13 commits February 23, 2026 22:32
Encode editorial group data as a contributor entry with role
type="author" and description="committee", using Organization with
nested Subdivision elements, following the canonical relaton-bib pattern.

- Add fetch_workgroup to RecommendationParser to extract study group
  from the HTML recommendation page (Label8 span)
- Add fetch_workgroup stub to RadioRegulationsParser
- Split Scraper#fetch_contributors to include editorial contributor
  with bureau abbreviation and optional study group subdivision
- Enable previously-skipped "fetch bureau from code" test
- Update fixtures (from_yaml.xml, itu_bib_item.yml, asciibib.adoc)
  to use contributor-based editorial group format
- Regenerate XML fixtures with new editorial contributor

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Each integration test loads and parses index file.

This slows down the tests and creates huge VCRs
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.

3 participants