Five cases disagree with Ruby Liquid 5.14.0, including contradictory strict2 expectations
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- ruby
- Ambito
- testing-qa
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Ruby
- Stelle
- 21
- Fork
- 9
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Shopify/liquid-spec
-
Liquid syntax errorAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Shopify/liquid-spec#91 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Shopify/liquid-spec#39 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Shopify/liquid-spec#37 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Shopify/liquid-spec#33 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Shopify/liquid-spec#31 · 5 commenti ·
Tutte le issue di Shopify/liquid-spec
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
TarteelAI/quranic-universal-library#1111 ·
I maintainer di solito rispondono entro 1 giorno
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every commandForse già presa @k4kratik l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
sachincool/cruft#4 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
auth0/ruby-auth0#840 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
riscv/riscv-unified-db#2859 ·
I maintainer di solito rispondono entro 2 giorni
-
agent-driven deployment documentation future releases nice to have
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno