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
bugfix: add missing comma in vector/matrix array #14047
bugfix: add missing comma in vector/matrix array #14047
Conversation
We require that all commits are properly signed, could you run Also, we want to include this fix on the release branch |
588fec9
to
a0eee95
Compare
Ideally we would add a test which failed on the previous code too. |
Sure, will do |
I've tested the change locally and it works, but it looks like you've got some extra commits in here by accident 😅 What you wanna do is:
You can do this in a new PR, or you can force push commits over here. It's up to you |
Signed-off-by: Amir Vejahat <amir.vejahat.av@gmail.com>
a0eee95
to
08dfaa1
Compare
Thanks for the help @ArthurSens . I've fixed the branching issue. please note that circleci has failed due to project suspension, I'm not sure if there's anything I could do to make it work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @amirvejahat, one last thing.
As Bryan mentioned, it would be nice to have a test case to make sure we don't make this mistake again in the future.
You can add a new test case in web/api/v1/json_codec.go
, inside the test TestJsonCodec_Encode
{
response: &QueryData{
ResultType: parser.ValueTypeVector,
Result: promql.Vector{
promql.Sample{
Metric: labels.FromStrings("__name__", "foo"),
T: 1000,
F: 1,
},
promql.Sample{
Metric: labels.FromStrings("__name__", "bar"),
T: 2000,
F: 2,
},
},
},
expected: `{"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"foo"},"value":[1,"1"]},{"metric":{"__name__":"bar"},"value":[2,"2"]}]}}`,
},
Yeah, the failing CI is not related to this PR... no need to worry about it :) |
Hi @amirvejahat at the moment this is breaking Thank you again for your contribution! |
Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
@gotjosh , I've just added the test. Do you mind reviewing it? EDIT: Looks like another test could be added for matrixes 🤔 |
Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you @ArthurSens!
Thanks @amirvejahat for the fix and sorry for taking over the PR, we just wanted to get this fixed soon :) |
This now needs to be merged back into main. |
Yeah, I've just created the PR to prepare the new release and another PR merging it back to main will follow shortly after |
Thanks @ArthurSens for adding the test case, I was away from my keyboard. glad to see it's merged now. looking forward to future contribution. |
Fixes #14040
Fixes #14011