Five cases disagree with Ruby Liquid 5.14.0, including contradictory strict2 expectations

Aperta
#170 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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

  1. Blank-body inline errors: blank_if_body_suppresses_error_text_strict, blank_unless_body_suppresses_error_text_strict, and blank_for_body_suppresses_error_text_strict each declare error_mode: [strict2, strict] and expect an empty output. The runner selects strict2; Ruby 5.14.0 instead emits the inline comparison or invalid integer error. The corresponding *_shows_error_text_strict2 cases 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.

  2. Assignment filter error: assign_swallows_filter_error expects beforeafter[]. The strict Ruby adapter selects strict2, where Ruby 5.14.0 renders beforeLiquid error (line 1): invalid integerafter[]. With lax and strict, our direct Ruby probes return the expected beforeafter[]. We noticed earlier work on this fixture; the mode difference may warrant a further check against the current reference.

  3. Interpolation-shaped variable name: security_var_name_no_interpolation expects empty output for {{ #{1+1} }} in lax mode. The supplied lax Ruby adapter raises Liquid::SyntaxError because 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Shopify/liquid-spec

Tutte le issue di Shopify/liquid-spec

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.