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

Improve support for ION/JSON processing in Pebble expressions #3715

Open
3 tasks
anna-geller opened this issue May 13, 2024 · 0 comments
Open
3 tasks

Improve support for ION/JSON processing in Pebble expressions #3715

anna-geller opened this issue May 13, 2024 · 0 comments
Labels
backend Need some backend code changes enhancement New feature or request
Milestone

Comments

@anna-geller
Copy link
Member

anna-geller commented May 13, 2024

Required todos:

  • rename the json filter to jsonEncode for more clarity about what it does — it takes a data structure or object and converts it into a JSON string e.g. {{ [1, 2, 3] | jsonEncode }}
  • rename the json() function to jsonDecode() to make it clear that it takes a JSON string and converts it into a data structure or object so the user can access further attributes using a dot notation e.g. '{{ jsonDecode(read(taskrun.items)) }}'
  • add a new ionDecode() function that will take an ION string (from reading an ION file) and convert it into a data structure or object e.g. '{{ ionDecode(read(taskrun.items)) }}'; this function can only process a single row

Important notes:

  • The renaming should ideally be implemented in a non-breaking way e.g. using json() will raise a warning in the UI but it will still work
  • The goal of these tasks is to make it easy to process data split by ForEachItem. However, the ionDecode() function should raise an error when trying to parse a multi-line string (i.e. ION file with multiple rows); this is important for performance reasons
@anna-geller anna-geller added backend Need some backend code changes enhancement New feature or request labels May 13, 2024
@anna-geller anna-geller added this to the v0.18.0 milestone May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Need some backend code changes enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant