jsonnet
jsonnet copied to clipboard
std.rstripChars functionality broken in v0.19.1
We tried to upgrade from 0.18.0 to 0.19.1, but we stumbled on a regression, it seems, in the std.rstripChars
function.
When we try to remove a newline from our templated string
{
test: std.rstripChars(|||
Made with ❤️ and [Grafonnet](https://github.com/grafana/grafonnet-lib). [Contribute to this dashboard on GitHub.com](https://github.com/onesignal/infra/blob/main/dashboards/%(filePath)s)
||| % { filePath: 'billing/main.dashboard.jsonnet' }, '\n')
}
The result in version 0.18.0 is correct:
{
"test": "Made with ❤️ and [Grafonnet](https://github.com/grafana/grafonnet-lib). [Contribute to this dashboard on GitHub.com](https://github.com/onesignal/infra/blob/main/dashboards/billing/main.dashboard.jsonnet)"
}
However, after upgrading to version 0.19.1, this is the result:
{
"test": "Made with ❤️ and [Grafonnet](https://github.com/grafana/grafonnet-lib). [Contribute to this dashboard on GitHub.com](https://github.com/onesignal/infra/blob/main/dashboards/billing/main.dashboard.json"
}
Another conclusion is the first link we add also seems to influence the result. If we compile
{
test: std.rstripChars(|||
[Contribute to this dashboard on GitHub.com](https://github.com/onesignal/infra/blob/main/dashboards/%(filePath)s)
||| % { filePath: 'billing/main.dashboard.jsonnet' }, '\n')
}
It works and yields the same results in v0.18.0 and v0.19.1
{
"test": "[Contribute to this dashboard on GitHub.com](https://github.com/onesignal/infra/blob/main/dashboards/billing/main.dashboard.jsonnet)"
}
We'll need to investigate. Thanks for reporting.
Tested that with different versions of jsonnet (0.18.0, 0.19.0, 0.19.1, latest version a3a1f0914dc3d2a6fd851edc8e5dc1ef52e372f7) and they all produce in the same correct result.
Tested on ubuntu 22.04.
I haven't been able to reproduce this, and a previous commenter wasn't able to reproduce either. I'll close this as wontfix/not reproducible, but if you're still aware of it happening and can reproduce then please reopen it!