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

Multiline Problem Matcher #1540

Open
smorimoto opened this issue Sep 27, 2023 · 3 comments
Open

Multiline Problem Matcher #1540

smorimoto opened this issue Sep 27, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@smorimoto
Copy link
Contributor

In #319 there was a discussion about the multiline "problem matcher" which was closed even though it was not actually fixed on the problem matcher side, so I think it's time to have this discussion again.

For example, OCaml has the following error log, which is very difficult to catch with current problem matcher.

File "bin/main.ml", line 0, characters 0-0:
type t =
  | Foo of string [@ocaml.warn_on_literal_pattern]
  | Bar of string

let no_warning = function
  | Bar "specific value" -> 0
  | _ -> 1

let warning = function
  | Foo "specific value" -> 0
  | _ -> 1
Warning 52 [fragile-literal-pattern]: Code should not depend on the actual values of
this constructor's arguments. They are only for information
and may change in future versions. (See manual section 13.5)

In such a case, it would be a fairly complex regular expression, but you can catch properly with code like the following, but the current implementation just works line-by-line.

^File\s"(.+)",\sline\s(\d+),\scharacters\s(\d+)-(\d+):\n((.|\n)+?)(Error|Warning)\s*(.*):\s((.|\n(?!File\s))+)$

https://regex101.com/r/gP6PEM/1

This means that it's impossible to matching such logs with such a regular expression.
In other words, we can't deal with issues like #319 on the user's end. Do you have any improvement plans for this?

@Emilgardis
Copy link

Emilgardis commented Sep 27, 2023

In such a case, it would be a fairly complex regular expression, but you can catch properly with code like the following, but the current implementation just works line-by-line.

That is, the current problem matcher regexp field does not allow this complex regular expression, because the expression assumes that ., [\S\s] and \n works across multiple lines, but the regexp only matches per line.

It's possible to use loop to go across multiple lines with different errors, but it's not possible to capture a multi-line error message using that strategy.

@smorimoto
Copy link
Contributor Author

Yes, that is exactly the problem. It is hard to understand why the GitHub Actions problem matcher is designed this way 🤷‍♂️

@smorimoto
Copy link
Contributor Author

@joshmgross @dhadka @chrispat @bryanmacfarlane @TingluoHuang Any thoughts on this? Or could you route this topic to the appropriate people?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants