actions / actions/runner

matchers: `fromPath` could be a literal (an actual path instead of a integer), or sibling to `owner`

Open
#461 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Runner Feature
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

@ericsciple this may be of your interest. I am trying to create a matcher for CMake. This is a sample of an error reported by CMake:

>cmake .
CMake Error at subdir2/CMakeLists.txt:7:
  Parse error.  Expected "(", got newline with text "

  ".


-- Configuring incomplete, errors occurred!

As you see the output does not contain the main CMakeLists.txt, but it contains a relative path to it.
Now if the main CMakeLists.txt file is not in the root of the repository, the path "root/subdir1/subdir2/CMakeLists.txt' will not be rooted by this code.

To make a matcher to work I think i need one of the following:
1- the fromPath property should be sibling to owner, a string that specifies the path to the main CMakeLists.txt;
2- the pattern[0].fromPath accepts either an integer, or a string, where the latter is the path to the main CMakeLists.txt;

This is a sample of the matcher that my run-cmake action is creating on the fly, but of course since 'fromPath' is not an integer, it will fail:

"problemMatcher":[
   {
      "owner":"cmake",
      "pattern":[
         {
            "regexp":"^\\s*CMake (Error|Warning) at (.+):(\\d+):",
            "severity":1,
            "file":2,
            "line":3,
            "fromPath":"/home/runner/work/CppBuildTasks-Validation/CppBuildTasks-Validation/matchers/cmake_error"
         },
         {
            "regexp":"^\\s+(.*)$",
            "message":1
         }
      ]
   }
]

Would one of those solution acceptable/feasible? I can add this feature.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/Runner.Worker/Handlers/OutputManager.cs at the linked path and trace how problem matcher fromPath values are interpreted. Compare the two proposed configuration shapes against the CMake example, then define and test the supported path behavior so relative CMake file paths are rooted correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, csharp
Domain
ci-cd, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.