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

Tanka can't handle top level arrays #321

Merged
merged 7 commits into from
Aug 9, 2020
Merged

Conversation

GabrielDyck
Copy link
Contributor

@GabrielDyck GabrielDyck commented Jul 17, 2020

Hi @sh0rez.
I'm glad to help with this issue #310. Please, let me know if I forgot something or we need to add anything else.

@GabrielDyck GabrielDyck changed the title Tanka can't handle top level arrays https://github.com/grafana/tanka/issues/310 Tanka can't handle top level arrays #310 Jul 17, 2020
@GabrielDyck GabrielDyck changed the title Tanka can't handle top level arrays #310 Tanka can't handle top level arrays Jul 17, 2020
Copy link
Member

@sh0rez sh0rez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool! Some nits and this is ready to go 🚀

.gitignore Outdated Show resolved Hide resolved
pkg/tanka/parse.go Outdated Show resolved Hide resolved
"testing"
)

func TestEvalJsonnet(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would love to see this also check objects, and evaluation results.

You could for example create multiple pseudo "environments" in testdata, like so:

- /
- /jsonnetfile.json
- /cases/
- /cases/array/main.jsonnet
- /cases/object/main.jsonnet

Then evaluate these as a table test, checking the error is nil and the result is what we expect.
Good work!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I'll add it. Thank you for your feedback.

@GabrielDyck
Copy link
Contributor Author

@sh0rez all changes are ready. Let me know if it's ok. If you think it's ok, we could create another PR with a single commit for readability.

@GabrielDyck GabrielDyck requested a review from sh0rez August 5, 2020 13:54
Copy link
Member

@sh0rez sh0rez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, sorry for the long delay here.

Looks awesome, thanks a lot!!

@sh0rez sh0rez merged commit a6d5fde into grafana:master Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants