Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix array access regression in template rendering #4620

Merged
merged 2 commits into from
Feb 15, 2018

Conversation

christophermaier
Copy link
Contributor

Recent versions of handlebars change array index access syntax, breaking that feature in Habitat templates. This pins to the last known-good version of handlebars.

Read commits for further details.

Fixes #4615

krnowak and others added 2 commits February 15, 2018 16:44
The `handlebars` crate introduced a change to how it accesses array
members in version 0.29.0 which is incompatible with Habitat's current
template syntax.

Where Habitat would use something like `{{members[0]}}` to access a
specific array member, `handlebars` now expects `{{members.[0]}}`.
This syntax actually mirrors the original JavaScript implementation,
as well as the syntax of other tools like `jq`. Since using 0.29.0 or
higher of `handlebars` would break any Habitat templates that use
direct array access, we need to lock to version 0.28.3, the last prior
version that works for us.

Future work will need to be done to either use an alternative template
engine, or evolve our templating syntax to use the new syntax.

Thanks to @krnowak for discovering this regression.

Fixes #4615

Signed-off-by: Christopher Maier <cmaier@chef.io>
@thesentinels
Copy link
Contributor

Thanks for the pull request! Here is what will happen next:

  1. Your PR will be reviewed by the maintainers
  2. If everything looks good, one of them will approve it, and your PR will be merged.

Thank you for contributing!

@reset
Copy link
Collaborator

reset commented Feb 15, 2018

tenor-132262063

@christophermaier
Copy link
Contributor Author

@thesentinels approve

@thesentinels
Copy link
Contributor

🤘 I am testing your branch against master before merging it. We do this to ensure that the master branch is never failing tests.

@fnichol
Copy link
Collaborator

fnichol commented Feb 15, 2018

Late 👍 here, but yep.

tenor-166039114

@thesentinels
Copy link
Contributor

:neckbeard: Travis CI has started testing this PR.

@thesentinels
Copy link
Contributor

💖 Travis CI reports this PR passed.

It always makes me feel nice when humans approve of one anothers work. I'm merging this PR now.

I just want you and the contributor to answer me one question:

gif-keyboard-3280869874741411265

@thesentinels thesentinels merged commit 95aa181 into master Feb 15, 2018
@thesentinels thesentinels deleted the cm/4615-handlebars branch February 15, 2018 23:45
@christophermaier christophermaier added Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Type: Bug Issues that describe broken functionality and removed A-supervisor labels Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Type: Bug Issues that describe broken functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in template variable handling
5 participants