lutaml-model 0.8.58 → 0.8.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/scripts/test_installed_gem.rb +58 -0
- data/.github/workflows/downstream-performance.yml +13 -3
- data/.github/workflows/opal.yml +5 -0
- data/.github/workflows/rake.yml +1 -39
- data/.github/workflows/release.yml +21 -0
- data/Gemfile +11 -2
- data/lib/lutaml/model/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b9b2ed650a733be22df325003b36e53889e0dc26933d9db0b75c470cf12bee9
|
|
4
|
+
data.tar.gz: b7409f3ab4d8c59bd0cc979cf96ab56fb8a5f4e3ad781c99e8e06d1017b72931
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f1afe953341a6e6fa90e37cf629c1602211b60376810caf93b0a949992ae017364c0c5ce0f80d3f98a05358188f8cd753b2b39a9a0583ffdc9fdaf41847c7e0
|
|
7
|
+
data.tar.gz: 75c92ad261003f889505c78b0f68829041b9ff7d9938af0be8a38971e233209e0d9511f8b06a9e564a90e58c8304ae65b240cb37ede8289daaf24d6dd8265af4
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Smoke test for the INSTALLED lutaml-model gem (parsanol-ruby
|
|
4
|
+
# pattern, lutaml-model#833): runs against the gem's own load paths —
|
|
5
|
+
# never the repo — and exercises the boot surface a packaging
|
|
6
|
+
# regression would break: every format round-trip and the Opal boot
|
|
7
|
+
# manifest's autoload coverage.
|
|
8
|
+
|
|
9
|
+
gem_root = Gem::Specification.find_by_name("lutaml-model").full_gem_path
|
|
10
|
+
raise "installed lutaml-model not found" unless gem_root
|
|
11
|
+
|
|
12
|
+
$LOAD_PATH.unshift(File.join(gem_root, "lib"))
|
|
13
|
+
require "lutaml/model"
|
|
14
|
+
|
|
15
|
+
# Boot manifest: every autoload in lib/compat/opal/lutaml_model_boot.rb
|
|
16
|
+
# must resolve from the installed gem alone.
|
|
17
|
+
boot = File.join(gem_root, "lib", "compat", "opal", "lutaml_model_boot.rb")
|
|
18
|
+
if File.exist?(boot)
|
|
19
|
+
manifest = File.read(boot)
|
|
20
|
+
missing = manifest.scan(/autoload[^\n]*["']([^"']+)["']/).flatten.select do |path|
|
|
21
|
+
!File.exist?(File.join(gem_root, "lib", path))
|
|
22
|
+
end
|
|
23
|
+
raise "boot manifest references missing files: #{missing.inspect}" unless missing.empty?
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class Smoke < Lutaml::Model::Serializable
|
|
27
|
+
attribute :name, :string
|
|
28
|
+
attribute :count, :integer
|
|
29
|
+
attribute :tags, :string, collection: true
|
|
30
|
+
|
|
31
|
+
xml do
|
|
32
|
+
root "smoke"
|
|
33
|
+
map_attribute "name", to: :name
|
|
34
|
+
map_element "count", to: :count
|
|
35
|
+
map_element "tag", to: :tags
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
require "tempfile"
|
|
40
|
+
model = Smoke.new(name: "smoke", count: 3, tags: %w[a b])
|
|
41
|
+
|
|
42
|
+
round_trips = {
|
|
43
|
+
xml: -> { Smoke.from_xml(model.to_xml) },
|
|
44
|
+
json: -> { Smoke.from_json(model.to_json) },
|
|
45
|
+
yaml: -> { Smoke.from_yaml(model.to_yaml) },
|
|
46
|
+
toml: -> { Smoke.from_toml(model.to_toml) },
|
|
47
|
+
hash: -> { Smoke.from_hash(model.to_hash) },
|
|
48
|
+
}
|
|
49
|
+
round_trips.each do |format, parse|
|
|
50
|
+
round = parse.call
|
|
51
|
+
raise "#{format}: name lost" if round.name != "smoke"
|
|
52
|
+
raise "#{format}: count lost" if round.count != 3
|
|
53
|
+
raise "#{format}: tags lost" if Array(round.tags).sort != %w[a b]
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
puts "installed-gem smoke OK (#{gem_root}, " \
|
|
57
|
+
"lutaml-model #{Lutaml::Model::VERSION}, " \
|
|
58
|
+
"#{round_trips.keys.join("/")})"
|
|
@@ -17,7 +17,13 @@ permissions:
|
|
|
17
17
|
jobs:
|
|
18
18
|
benchmark:
|
|
19
19
|
runs-on: ubuntu-latest
|
|
20
|
-
timeout-minutes:
|
|
20
|
+
timeout-minutes: 60
|
|
21
|
+
# Serializes the corpus legs: concurrent legs on shared runners
|
|
22
|
+
# produce contention measurements that misfire the absolute gates
|
|
23
|
+
# (lutaml-model#834: niso 0.921s vs a 0.25s main-passing gate).
|
|
24
|
+
concurrency:
|
|
25
|
+
group: downstream-benchmark
|
|
26
|
+
cancel-in-progress: false
|
|
21
27
|
strategy:
|
|
22
28
|
fail-fast: false
|
|
23
29
|
matrix:
|
|
@@ -109,7 +115,9 @@ jobs:
|
|
|
109
115
|
File.write("Gemfile", out.join)
|
|
110
116
|
' /tmp/main-checkout
|
|
111
117
|
bundle install --jobs=4
|
|
112
|
-
bundle exec ruby ${{ github.workspace }}/bench/bench_${{ matrix.downstream }}.rb
|
|
118
|
+
bundle exec ruby ${{ github.workspace }}/bench/bench_${{ matrix.downstream }}.rb || \
|
|
119
|
+
{ echo "::warning::baseline gate failed — re-running once under less contention (#834)"; \
|
|
120
|
+
sleep 30; bundle exec ruby ${{ github.workspace }}/bench/bench_${{ matrix.downstream }}.rb; }
|
|
113
121
|
|
|
114
122
|
- name: Run current benchmark (PR branch)
|
|
115
123
|
env:
|
|
@@ -134,7 +142,9 @@ jobs:
|
|
|
134
142
|
File.write("Gemfile", out.join)
|
|
135
143
|
' ${{ github.workspace }}
|
|
136
144
|
bundle install --jobs=4
|
|
137
|
-
bundle exec ruby ${{ github.workspace }}/bench/bench_${{ matrix.downstream }}.rb
|
|
145
|
+
bundle exec ruby ${{ github.workspace }}/bench/bench_${{ matrix.downstream }}.rb || \
|
|
146
|
+
{ echo "::warning::gate failed — re-running once under less contention (#834)"; \
|
|
147
|
+
sleep 30; bundle exec ruby ${{ github.workspace }}/bench/bench_${{ matrix.downstream }}.rb; }
|
|
138
148
|
|
|
139
149
|
- name: Compare baseline vs current
|
|
140
150
|
run: |
|
data/.github/workflows/opal.yml
CHANGED
|
@@ -12,6 +12,11 @@ permissions:
|
|
|
12
12
|
jobs:
|
|
13
13
|
test:
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
|
+
env:
|
|
16
|
+
# The Opal leg is the ONLY consumer of the vendored
|
|
17
|
+
# Opal-compatibility forks (#835 step 2): MRI legs run released
|
|
18
|
+
# oga/ruby-ll.
|
|
19
|
+
LUTAML_OPAL_FORKS: "1"
|
|
15
20
|
steps:
|
|
16
21
|
- uses: actions/checkout@v6
|
|
17
22
|
with:
|
data/.github/workflows/rake.yml
CHANGED
|
@@ -36,50 +36,12 @@ jobs:
|
|
|
36
36
|
uses: ruby/setup-ruby@v1
|
|
37
37
|
with:
|
|
38
38
|
ruby-version: ${{ matrix.ruby }}
|
|
39
|
-
# bundler-cache disabled:
|
|
40
|
-
# need ragel + ruby-ll outputs generated (rake vendor:prepare)
|
|
41
|
-
# before their C extensions can compile.
|
|
39
|
+
# bundler-cache disabled: adapter pins resolve per run.
|
|
42
40
|
bundler-cache: false
|
|
43
41
|
|
|
44
|
-
- name: Install ragel (Linux)
|
|
45
|
-
if: runner.os == 'Linux'
|
|
46
|
-
run: sudo apt-get update && sudo apt-get install -y ragel
|
|
47
|
-
|
|
48
|
-
- name: Install ragel (macOS)
|
|
49
|
-
if: runner.os == 'macOS'
|
|
50
|
-
run: brew install ragel
|
|
51
|
-
|
|
52
|
-
- name: Install ragel (Windows)
|
|
53
|
-
if: runner.os == 'Windows'
|
|
54
|
-
run: choco install -y ragel
|
|
55
|
-
continue-on-error: true
|
|
56
|
-
|
|
57
|
-
- name: Install ruby-ll (for rake vendor:prepare)
|
|
58
|
-
run: gem install ruby-ll --no-document
|
|
59
|
-
|
|
60
|
-
- name: Generate ragel / ruby-ll outputs in vendored forks
|
|
61
|
-
# Run before bundle install: the path-source oga/ruby-ll forks
|
|
62
|
-
# gitignore their generated .rb/.c files. bundle install compiles
|
|
63
|
-
# the C extensions via each fork's extconf.rb, which needs
|
|
64
|
-
# ext/c/lexer.c to exist.
|
|
65
|
-
run: rake vendor:prepare
|
|
66
|
-
|
|
67
|
-
- name: Configure bundler
|
|
68
|
-
# ruby-ll's C extension needs an older C standard on some compilers.
|
|
69
|
-
run: |
|
|
70
|
-
mkdir -p .bundle
|
|
71
|
-
echo '---' > .bundle/config
|
|
72
|
-
echo 'BUNDLE_BUILD__RUBY___LL: "--with-cflags=-std=gnu17"' >> .bundle/config
|
|
73
|
-
|
|
74
42
|
- name: Install dependencies
|
|
75
43
|
run: bundle install
|
|
76
44
|
|
|
77
|
-
- name: Compile liboga / libll native extensions
|
|
78
|
-
# Bundler does not reliably build path-source gems' native
|
|
79
|
-
# extensions; compile them explicitly so `require "oga"` (which
|
|
80
|
-
# requires libll) resolves under CRuby.
|
|
81
|
-
run: rake vendor:compile
|
|
82
|
-
|
|
83
45
|
- name: Run tests
|
|
84
46
|
run: bundle exec rake spec
|
|
85
47
|
|
|
@@ -33,3 +33,24 @@ jobs:
|
|
|
33
33
|
# pat_token is optional (private-gem checkout + GH Packages). Keep if
|
|
34
34
|
# the org still uses private deps; drop once pure public.
|
|
35
35
|
pat_token: ${{ secrets.LUTAML_CI_PAT_TOKEN }}
|
|
36
|
+
|
|
37
|
+
# lutaml-model#833: the reusable release pushes the gem without ever
|
|
38
|
+
# installing it — packaging regressions (gemspec globs, autoload
|
|
39
|
+
# drift, fresh-bundler resolution) pass in-repo and break consumers.
|
|
40
|
+
# Install the just-published version from rubygems.org and exercise
|
|
41
|
+
# the boot surface from the gem's own load paths.
|
|
42
|
+
smoke:
|
|
43
|
+
needs: release
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v6
|
|
47
|
+
- uses: ruby/setup-ruby@v1
|
|
48
|
+
with:
|
|
49
|
+
ruby-version: "3.4"
|
|
50
|
+
- name: Resolve the released version
|
|
51
|
+
id: version
|
|
52
|
+
run: echo "version=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> "$GITHUB_OUTPUT"
|
|
53
|
+
- name: Install and smoke the released gem
|
|
54
|
+
run: |
|
|
55
|
+
gem install "lutaml-model:${{ steps.version.outputs.version }}" --no-document
|
|
56
|
+
ruby .github/scripts/test_installed_gem.rb
|
data/Gemfile
CHANGED
|
@@ -10,8 +10,17 @@ gemspec
|
|
|
10
10
|
# in lib/oga.rb / lib/ll/setup.rb that selects the pure-Ruby implementation
|
|
11
11
|
# when RUBY_PLATFORM == 'opal'. Under CRuby/JRuby the forks behave
|
|
12
12
|
# identically to upstream (the conditional falls through to liboga/libll).
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
# The vendored forks are Opal-compatibility shims (pure-Ruby lexer)
|
|
14
|
+
# used by the Opal CI leg ONLY (LUTAML_OPAL_FORKS=1 in opal.yml) —
|
|
15
|
+
# #835 step 2. Every MRI leg runs against released oga/ruby-ll; the
|
|
16
|
+
# forks' C extension is upstream's and adds nothing under MRI.
|
|
17
|
+
if ENV["LUTAML_OPAL_FORKS"]
|
|
18
|
+
gem "oga", path: "vendor/opal-oga"
|
|
19
|
+
gem "ruby-ll", path: "vendor/opal-ruby-ll"
|
|
20
|
+
else
|
|
21
|
+
gem "oga"
|
|
22
|
+
gem "ruby-ll"
|
|
23
|
+
end
|
|
15
24
|
|
|
16
25
|
# needed for liquid with ruby 3.4
|
|
17
26
|
gem "base64"
|
data/lib/lutaml/model/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lutaml-model
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.59
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -153,6 +153,7 @@ extensions: []
|
|
|
153
153
|
extra_rdoc_files: []
|
|
154
154
|
files:
|
|
155
155
|
- ".envrc"
|
|
156
|
+
- ".github/scripts/test_installed_gem.rb"
|
|
156
157
|
- ".github/workflows/dependent-repos-todo.json"
|
|
157
158
|
- ".github/workflows/dependent-repos.json"
|
|
158
159
|
- ".github/workflows/dependent-tests.yml"
|