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

Loki: Fix parsing of escaped quotes in LogQL #69584

Merged
merged 2 commits into from Jun 6, 2023

Conversation

svennergr
Copy link
Contributor

@svennergr svennergr commented Jun 5, 2023

What is this feature?

Parsing a visual representation of a query containing escaped quotes caused a bug. This PR fixes parsing of escaped quotes.

Special notes for your reviewer:

  1. Open a Loki in code editor with the query:
{app="frontend"} |= "\"line"
  1. Change to query builder.
  2. Notice that the "line value in the visualrepresentation is now correct - previously it was not.
  3. Add any operation.
  4. Notice that the resulting query will be something like
{app="frontend"} |= `"line`

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

Backend code coverage report for PR #69584
No changes

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

Frontend code coverage report for PR #69584

Plugin Main PR Difference
loki 84.98% 84.98% 0%

@svennergr svennergr merged commit a81cee1 into main Jun 6, 2023
22 checks passed
@svennergr svennergr deleted the svennergr/fix-logql-converting branch June 6, 2023 09:07
@grafanabot
Copy link
Contributor

The backport to v10.0.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-69584-to-v10.0.x origin/v10.0.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x a81cee1d05ade7d09856ff4b7da1b6712382ee3e
# Push it to GitHub
git push --set-upstream origin backport-69584-to-v10.0.x
git switch main
# Remove the local backport branch
git branch -D backport-69584-to-v10.0.x

Then, create a pull request where the base branch is v10.0.x and the compare/head branch is backport-69584-to-v10.0.x.

@grafanabot grafanabot added the backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. label Jun 6, 2023
svennergr added a commit that referenced this pull request Jun 6, 2023
* fix parsing issue

* replace escaped quotes

(cherry picked from commit a81cee1)
svennergr added a commit that referenced this pull request Jun 6, 2023
Loki: Fix parsing of escaped quotes in LogQL (#69584)

* fix parsing issue

* replace escaped quotes

(cherry picked from commit a81cee1)
@zerok zerok modified the milestones: 10.0.x, 10.0.1, 10.1.x Jun 20, 2023
@ricky-undeadcoders ricky-undeadcoders modified the milestones: 10.1.x, 10.1.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog area/frontend backport v10.0.x backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. datasource/Loki type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants