Five cases disagree with Ruby Liquid 5.14.0, including contradictory strict2 expectations
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- ruby
- Domain
- testing-qa
Research direction
Start with specs/liquid_ruby/blank_body_error_handling.yml around the blank_if/unless/for_body cases and specs/liquid_ruby/filter_argument_semantics.yml for assign_swallows_filter_error, then check the mode declarations in examples/liquid_ruby.rb and examples/liquid_ruby_lax.rb. Rerun the two commands in the issue to confirm the four failures and one error. Done means each expectation is either corrected or restricted to the modes where Ruby Liquid 5.14.0 matches it, with maintainers confirming the intended strict2 behavior.
Written by the indexing model from the issue text.
Description
Summary
Five liquid-spec cases appear to disagree with Shopify's open-source Ruby Liquid 5.14.0 when run through liquid-spec's own Ruby adapters. Three blank-body cases also appear to assert opposite results for the same template and strict2 mode. We encountered this while testing an independent Liquid implementation, then reproduced the discrepancies directly with the reference engine and the suite's own adapters.
Could you confirm the intended behavior and whether these expectations or their declared modes should be updated?
Versions
- Shopify/liquid:
4e39ae4cc3da73921923c0669e0fc84a66b2f696,Liquid::VERSION = 5.14.0. - Shopify/liquid-spec:
84bf25e0edbca5f7e530574788b0f875ab331f50,Liquid::Spec::VERSION = 2.0.0. This is also the liquid-spec revision pinned by Liquid's Gemfile. - Ruby 4.0.1, arm64 macOS. The Ruby reference was loaded directly from the checkout above;
liquid-cwas disabled by the supplied examples.
Reproduction
Place clean checkouts of the pinned revisions in adjacent directories named liquid and liquid-spec. The suite Gemfile selects ../liquid when present. After installing the suite's declared dependencies, from liquid-spec run:
bundle exec ruby bin/liquid-spec run examples/liquid_ruby.rb \
--suite liquid_ruby \
--name '/blank_(if|unless|for)_body_(suppresses_error_text_strict|shows_error_text_strict2)|assign_swallows_filter_error/' \
--no-max-failures --json
bundle exec ruby bin/liquid-spec run examples/liquid_ruby_lax.rb \
--suite basics --name security_var_name_no_interpolation \
--no-max-failures --json
In our reproduction, the first command reported 4 failures and the second reported 1 error. We invoked the same runner and adapters with explicit Ruby load paths and the existing installed gems; no Swift code or JSON-RPC bridge participated. The default strict Ruby example declares strict2_blank_body_errors missing, so it skips the positive strict2 blank-body cases in the first command.
Cases
-
Blank-body inline errors:
blank_if_body_suppresses_error_text_strict,blank_unless_body_suppresses_error_text_strict, andblank_for_body_suppresses_error_text_stricteach declareerror_mode: [strict2, strict]and expect an empty output. The runner selectsstrict2; Ruby 5.14.0 instead emits the inline comparison orinvalid integererror. The corresponding*_shows_error_text_strict2cases specify the same templates, mode and context with the opposite expectation. The file's mode-matrix comments and Shopify/liquid#2118 describe suppression as the legacy lax/strict behavior and visible errors as strict2 behavior. -
Assignment filter error:
assign_swallows_filter_errorexpectsbeforeafter[]. The strict Ruby adapter selectsstrict2, where Ruby 5.14.0 rendersbeforeLiquid error (line 1): invalid integerafter[]. Withlaxandstrict, our direct Ruby probes return the expectedbeforeafter[]. We noticed earlier work on this fixture; the mode difference may warrant a further check against the current reference. -
Interpolation-shaped variable name:
security_var_name_no_interpolationexpects empty output for{{ #{1+1} }}in lax mode. The supplied lax Ruby adapter raisesLiquid::SyntaxErrorbecause the variable markup is not properly terminated. This report does not suggest evaluating the interpolation-like text; the question is whether rejection should be the expected safe behavior.
One possible resolution for the blank-body cases would be to declare the suppression cases strict only, leaving the existing strict2-visible-error cases in place. The assignment case may similarly need explicit mode-specific expectations. For the security case, an expected parse error could preserve the non-evaluation guarantee. These are suggestions for maintainer review, not assertions about Shopify's intended contract.
For context, the liquid-spec Gemfile falls back to v5.13.0 if ../liquid is absent; 5.14.0 changes the observed strict2 behavior. Shopify Liquid's own CI adapters also select different mode/render-feature scopes. We have not rerun the complete upstream CI matrix, so cannot infer the status of those broader runs from these targeted results.
- Dominant language
- Ruby
- Stars
- 21
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shopify/liquid-spec
-
Liquid syntax errorOpen
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Shopify/liquid-spec#91 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Shopify/liquid-spec#39 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Shopify/liquid-spec#37 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Shopify/liquid-spec#33 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Shopify/liquid-spec#31 · 5 comments ·
All issues in Shopify/liquid-spec
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
TarteelAI/quranic-universal-library#1111 ·
Maintainers usually reply within 1 day
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every commandPossibly taken @k4kratik claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
sachincool/cruft#4 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
riscv/riscv-unified-db#2859 ·
Maintainers usually reply within 2 days
-
agent-driven deployment documentation future releases nice to have
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
changesets
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
openstreetmap/openstreetmap-website#7629 · 1 comment ·
Maintainers usually reply within 1 day