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

Support UTF-8 label matchers: Add new parser #3453

Merged

Commits on Aug 21, 2023

  1. Add label matchers parser

    This commit adds the new label matchers parser as proposed in prometheus#3353.
    Included is a number of compliance tests comparing the grammar
    supported in the new parser with the existing parser in pkg/labels.
    
    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    8a340c6 View commit details
    Browse the repository at this point in the history
  2. Comment out non-compliant tests

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    4a61022 View commit details
    Browse the repository at this point in the history
  3. Fix unused lint

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    4e5c1ab View commit details
    Browse the repository at this point in the history
  4. Use t.Skip() to skip tests

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    ac2c61b View commit details
    Browse the repository at this point in the history
  5. Feedback

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    18429bb View commit details
    Browse the repository at this point in the history
  6. Fix test

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    5603b1e View commit details
    Browse the repository at this point in the history
  7. Add docs to lexer.go and parse.go

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    68c9724 View commit details
    Browse the repository at this point in the history
  8. Fix comment

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    ed7750d View commit details
    Browse the repository at this point in the history
  9. Remove unused IsNone

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    e8bbe9b View commit details
    Browse the repository at this point in the history
  10. Update order of struct fields

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    f55bc8a View commit details
    Browse the repository at this point in the history
  11. Rewrite parseOpenParen and remoave accept

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    c9eb963 View commit details
    Browse the repository at this point in the history
  12. Fix err not returned from peekNext

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    6f4db08 View commit details
    Browse the repository at this point in the history
  13. Add benchmarks

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    7c6be41 View commit details
    Browse the repository at this point in the history
  14. Use eof instead of -1

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    593fa56 View commit details
    Browse the repository at this point in the history
  15. Rename Ident to Unquoted

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    c21972d View commit details
    Browse the repository at this point in the history
  16. Support unquoted outside of reserved characters

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    a00c8f6 View commit details
    Browse the repository at this point in the history
  17. Add test for no input to lexer_test.go

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    6f5f8b6 View commit details
    Browse the repository at this point in the history
  18. Add tests for ParseMatcher

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    e7e3223 View commit details
    Browse the repository at this point in the history
  19. Update compliance_test.go

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    546fea5 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2023

  1. Rename TokenNone to TokenEOF

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    af80340 View commit details
    Browse the repository at this point in the history
  2. Update comments in parse.go

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    e5b8cd0 View commit details
    Browse the repository at this point in the history
  3. Rename parseFn to parseFunc

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    0a87da7 View commit details
    Browse the repository at this point in the history
  4. Use correct name for hasOpenParen

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    2614b38 View commit details
    Browse the repository at this point in the history
  5. Rename parseOpenParen and parseCloseParen

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    c950ebe View commit details
    Browse the repository at this point in the history
  6. Better errors when expecting EOF

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    d3f2bfe View commit details
    Browse the repository at this point in the history
  7. Remove input from parse.go

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    0e7617f View commit details
    Browse the repository at this point in the history
  8. Fix lint

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    a371c2a View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2023

  1. Fix lint again

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    0020634 View commit details
    Browse the repository at this point in the history
  2. Add fuzz tests

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    93f876d View commit details
    Browse the repository at this point in the history
  3. Don't skip test with dashes

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    4add08c View commit details
    Browse the repository at this point in the history
  4. Add repl

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    8686688 View commit details
    Browse the repository at this point in the history
  5. Feedback

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    ec244c0 View commit details
    Browse the repository at this point in the history
  6. Add missing license to repl

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    996b3d0 View commit details
    Browse the repository at this point in the history
  7. Use fmt.Println in repl

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    a95d3ce View commit details
    Browse the repository at this point in the history
  8. Use os.Stderr on error

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    a76d9cc View commit details
    Browse the repository at this point in the history
  9. Remove repl for another PR

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    d297917 View commit details
    Browse the repository at this point in the history
  10. Add comments for emit, next, rewind and skip

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    2122180 View commit details
    Browse the repository at this point in the history
  11. Fix bug when skipping two or more columns

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    fad8236 View commit details
    Browse the repository at this point in the history
  12. Feedback

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    2286467 View commit details
    Browse the repository at this point in the history
  13. Fix comment

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    c67a5c1 View commit details
    Browse the repository at this point in the history
  14. Fix comments

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    3fafba3 View commit details
    Browse the repository at this point in the history
  15. Remove duplicated errors from parse.go

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    c24b758 View commit details
    Browse the repository at this point in the history
  16. Remove check for open and closing braces in Matcher

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    ba09503 View commit details
    Browse the repository at this point in the history
  17. Make Unquote a method of Token

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    222f85d View commit details
    Browse the repository at this point in the history
  18. Make all code package private

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    55e2cda View commit details
    Browse the repository at this point in the history
  19. Use position in errors

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    4d7acef View commit details
    Browse the repository at this point in the history
  20. Fix unwrapped errors

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    fca77b0 View commit details
    Browse the repository at this point in the history
  21. Make errors package-private and remove function wrapping

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    c080f9d View commit details
    Browse the repository at this point in the history
  22. recover from panic on fatal error

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    47feed7 View commit details
    Browse the repository at this point in the history
  23. Small non-functional changes to improve code structure and comments

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    ce06d33 View commit details
    Browse the repository at this point in the history
  24. Fix mistake added in previous commit to accept

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    41d4fb6 View commit details
    Browse the repository at this point in the history
  25. Consistent use of t as token variable

    Signed-off-by: George Robinson <george.robinson@grafana.com>
    grobinson-grafana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    28c0d3a View commit details
    Browse the repository at this point in the history