Skip to content

Conversation

zhuje
Copy link
Contributor

@zhuje zhuje commented Aug 10, 2023

Related Issue
https://issues.redhat.com/browse/OCPBUGS-14902

Summary
Fix the content filter by converting text input into a raw string (<text…>) instead of plain string (""). This allows special characters to be escaped within Loki LogQLs.

Resources
https://grafana.com/blog/2021/01/05/how-to-escape-special-characters-with-lokis-logql

Before
The text input ""manger-role"" causes a parsing error.
Before

After
The text input is now wrapped in backtick (``) instead of quotes (""). The text input "manger-role" no longer causes a parsing error.
After

@openshift-ci openshift-ci bot requested review from jgbernalp and kyoto August 10, 2023 00:52
@zhuje zhuje changed the title OCPBUGS-14902 Loki search does not allow special chars OCPBUGS-14902: Loki search does not allow special chars Aug 10, 2023
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 10, 2023
@openshift-ci-robot
Copy link

@zhuje: This pull request references Jira Issue OCPBUGS-14902, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Related Issue
https://issues.redhat.com/browse/OCPBUGS-14902

Summary
Fix the content filter by converting text input into a raw string (<text…>) instead of plain string (""). This allows special characters to be escaped within Loki LogQLs.

Resources
https://grafana.com/blog/2021/01/05/how-to-escape-special-characters-with-lokis-logql

Before
The text input ""manger-role"" causes a parsing error.
Before

After
The text input is now wrapped in backtick (``) instead of quotes (""). The text input "manger-role" no longer causes a parsing error.
After

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zhuje zhuje changed the title OCPBUGS-14902: Loki search does not allow special chars [WIP] OCPBUGS-14902: Loki search does not allow special chars Aug 10, 2023
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 10, 2023
@kyoto
Copy link
Member

kyoto commented Aug 10, 2023

I see there are a couple of test failures.

Also, with this approach I guess we won't be able to search for any string that contains a ` character. Although this is still a big improvement on the current behavior.

@zhuje
Copy link
Contributor Author

zhuje commented Aug 10, 2023

/test test-e2e

@zhuje
Copy link
Contributor Author

zhuje commented Aug 11, 2023

/retest

@jgbernalp
Copy link
Contributor

@zhuje we need to fix the e2e tests as some of them are matching on the expected query and this changed including the ticks, in particular web/cypress/integration/logs-page.cy.ts

@zhuje zhuje changed the title [WIP] OCPBUGS-14902: Loki search does not allow special chars OCPBUGS-14902: Loki search does not allow special chars Aug 14, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 14, 2023
…o form raw strings (``) instead of plain strings using quotes(""). This allows special characters to be escaped in Loki LogQL queries.
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 14, 2023

@zhuje: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@jgbernalp
Copy link
Contributor

/lgtm

@zhuje we might need to update the JIRA ticket to add the specific logging version rather than the OCP version. Also this might need to be backported to 5.7

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2023
@zhuje
Copy link
Contributor Author

zhuje commented Aug 15, 2023

/approved

@zhuje
Copy link
Contributor Author

zhuje commented Aug 15, 2023

/jira refresh

@openshift-ci-robot
Copy link

@zhuje: This pull request references Jira Issue OCPBUGS-14902, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zhuje zhuje changed the title OCPBUGS-14902: Loki search does not allow special chars Loki search does not allow special chars Aug 15, 2023
@openshift-ci-robot openshift-ci-robot removed jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 15, 2023
@openshift-ci-robot
Copy link

@zhuje: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

In response to this:

Related Issue
https://issues.redhat.com/browse/OCPBUGS-14902

Summary
Fix the content filter by converting text input into a raw string (<text…>) instead of plain string (""). This allows special characters to be escaped within Loki LogQLs.

Resources
https://grafana.com/blog/2021/01/05/how-to-escape-special-characters-with-lokis-logql

Before
The text input ""manger-role"" causes a parsing error.
Before

After
The text input is now wrapped in backtick (``) instead of quotes (""). The text input "manger-role" no longer causes a parsing error.
After

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zhuje
Copy link
Contributor Author

zhuje commented Aug 15, 2023

/jira refresh

@openshift-ci-robot
Copy link

@zhuje: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zhuje zhuje changed the title Loki search does not allow special chars OCPBUGS-14902: Loki search does not allow special chars Aug 15, 2023
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 15, 2023
@openshift-ci-robot
Copy link

@zhuje: This pull request references Jira Issue OCPBUGS-14902, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Related Issue
https://issues.redhat.com/browse/OCPBUGS-14902

Summary
Fix the content filter by converting text input into a raw string (<text…>) instead of plain string (""). This allows special characters to be escaped within Loki LogQLs.

Resources
https://grafana.com/blog/2021/01/05/how-to-escape-special-characters-with-lokis-logql

Before
The text input ""manger-role"" causes a parsing error.
Before

After
The text input is now wrapped in backtick (``) instead of quotes (""). The text input "manger-role" no longer causes a parsing error.
After

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zhuje
Copy link
Contributor Author

zhuje commented Aug 15, 2023

/jira refresh

@openshift-ci-robot
Copy link

@zhuje: This pull request references Jira Issue OCPBUGS-14902, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zhuje zhuje changed the title OCPBUGS-14902: Loki search does not allow special chars Loki search does not allow special chars Aug 15, 2023
@openshift-ci-robot openshift-ci-robot removed jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 15, 2023
@openshift-ci-robot
Copy link

@zhuje: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

In response to this:

Related Issue
https://issues.redhat.com/browse/OCPBUGS-14902

Summary
Fix the content filter by converting text input into a raw string (<text…>) instead of plain string (""). This allows special characters to be escaped within Loki LogQLs.

Resources
https://grafana.com/blog/2021/01/05/how-to-escape-special-characters-with-lokis-logql

Before
The text input ""manger-role"" causes a parsing error.
Before

After
The text input is now wrapped in backtick (``) instead of quotes (""). The text input "manger-role" no longer causes a parsing error.
After

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zhuje zhuje changed the title Loki search does not allow special chars OCPBUGS-14902: Loki search does not allow special chars Aug 15, 2023
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 15, 2023
@openshift-ci-robot
Copy link

@zhuje: This pull request references Jira Issue OCPBUGS-14902, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Related Issue
https://issues.redhat.com/browse/OCPBUGS-14902

Summary
Fix the content filter by converting text input into a raw string (<text…>) instead of plain string (""). This allows special characters to be escaped within Loki LogQLs.

Resources
https://grafana.com/blog/2021/01/05/how-to-escape-special-characters-with-lokis-logql

Before
The text input ""manger-role"" causes a parsing error.
Before

After
The text input is now wrapped in backtick (``) instead of quotes (""). The text input "manger-role" no longer causes a parsing error.
After

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zhuje
Copy link
Contributor Author

zhuje commented Aug 15, 2023

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 15, 2023
@openshift-ci-robot
Copy link

@zhuje: This pull request references Jira Issue OCPBUGS-14902, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.14.0) matches configured target version for branch (4.14.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot requested a review from yapei August 15, 2023 16:06
@kyoto
Copy link
Member

kyoto commented Aug 16, 2023

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 16, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kyoto, zhuje

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 16, 2023
@openshift-merge-robot openshift-merge-robot merged commit a53ce58 into openshift:main Aug 16, 2023
@openshift-ci-robot
Copy link

@zhuje: Jira Issue OCPBUGS-14902: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-14902 has been moved to the MODIFIED state.

In response to this:

Related Issue
https://issues.redhat.com/browse/OCPBUGS-14902

Summary
Fix the content filter by converting text input into a raw string (<text…>) instead of plain string (""). This allows special characters to be escaped within Loki LogQLs.

Resources
https://grafana.com/blog/2021/01/05/how-to-escape-special-characters-with-lokis-logql

Before
The text input ""manger-role"" causes a parsing error.
Before

After
The text input is now wrapped in backtick (``) instead of quotes (""). The text input "manger-role" no longer causes a parsing error.
After

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zhuje
Copy link
Contributor Author

zhuje commented Aug 21, 2023

/cherrypick release-5.7

@openshift-cherrypick-robot

@zhuje: new pull request created: #136

In response to this:

/cherrypick release-5.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zhuje zhuje changed the title OCPBUGS-14902: Loki search does not allow special chars LOG-4457: Loki search does not allow special chars Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants