actions / actions/runner

Problem matcher annotations not showing up - but appear matched in logs

Open
#1,009 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-investigation papercut Runner Bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the bug

Edit: I believe there is a bug at play here for atypical workflows, see my conclusion below. Upshot: If you are using a problem matcher on output from a container, ensure that the working directory you are emitting those logs from within the container is a volume mounted from ${{ github.workspace }} in your GH Action Runner VM.

A gcc-problem-matcher I authored from a Template is working when applied to a simple demonstration project. Working specifically meaning the UI annotates -Wunused-variable in the Files changed UI tab of the Pull Request.

When I apply the same gcc-problem-matcher to my desired project in This PR, no such UI annotation appears (though logs indicate that the matcher did hit on the GCC warnings, more below). The following deltas exist that I'm aware of.

  • On Magma, I am running the build inside a docker container GH Action YML for build_oai job
  • On Magma, paths of the GCC build failures have incorrect prefix for GH expectation
    • Nominal GCC build gives /magma/lte/...
    • So I have am using xo to trim the /mamga/ leaving just lte/... to match repo
    • This appears to me a correct fixup, but I've tried variants with no success

To Reproduce

Steps to reproduce the behavior:

  1. Fork electronjoe/magma
  2. Submit a Pull Request of /magma pr-gh-gcc-problems branch onto /magma master branch
  3. Review the GCC Warnings & Errors check (takes ~an hour to build and run the first time)
    1. Note the gen_build_container job builds the container in which we will compile (~ignore this job?)
    2. Note the build_oai job is the one which actually builds the artifact and uses gcc-problem-matcher
  4. Observe build_oai job logs
    1. Successfully match with log output ##[warning]lte/gateway/c/oai/tasks/nas/emm/Attach.c:206:7: warning: unused variable 'totally_useless' [-Wunused-variable]
    2. But annotation does not appear on Pull Request code review

Expected Behavior

In the prototype Pull Request to my forked Magma repo, I expect the -Wunused-variable annotation to correctly display in the UI for the pull request - applied to the file lte/gateway/c/oai/tasks/nas/emm/Attach.c in line with the following log message that makes it appear to have successfully problem matched.

2021-03-12T17:41:09.6010505Z ##[warning]lte/gateway/c/oai/tasks/nas/emm/Attach.c:206:7: warning: unused variable 'totally_useless' [-Wunused-variable]

This behavior is working in my simple repo Pull Request sanity check which also uses electronjoe/gcc-problem-matcher.

Runner Version and Platform

Pulled from mis-behaving PR build_oai job.

2021-03-12T17:32:32.2587352Z ##[section]Finishing: Request a runner to run this job
2021-03-12T17:32:38.4125097Z Current runner version: '2.277.1'
2021-03-12T17:32:38.4155332Z ##[group]Operating System
2021-03-12T17:32:38.4156339Z Ubuntu
2021-03-12T17:32:38.4156982Z 20.04.2
2021-03-12T17:32:38.4157389Z LTS

Job Log Output

I'm not sure what all is relevant, but here are some bits I thought might be important. Pulled from mis-behaving PR build_oai job. Note that I only observe the ##[warning]when the problem-matcher is firing in GH Action, so that looks good to me.

2021-03-12T17:34:27.9961714Z ##[group]Run electronjoe/gcc-problem-matcher@v1
2021-03-12T17:34:27.9962270Z with:
2021-03-12T17:34:27.9962619Z   action: add
2021-03-12T17:34:27.9962977Z ##[endgroup]
...
2021-03-12T17:41:09.6010505Z ##[warning]lte/gateway/c/oai/tasks/nas/emm/Attach.c:206:7: warning: unused variable 'totally_useless' [-Wunused-variable]
2021-03-12T17:41:09.6026310Z ##[warning]lte/gateway/c/oai/tasks/nas/emm/Attach.c:677:34: warning: unused parameter 'emm_cause' [-Wunused-parameter]
2021-03-12T17:41:09.6035622Z ##[warning]lte/gateway/c/oai/tasks/nas/emm/Attach.c:678:64: warning: unused parameter 'status' [-Wunused-parameter]
2021-03-12T17:41:09.6038602Z ##[warning]lte/gateway/c/oai/tasks/nas/emm/Attach.c:1057:54: warning: unused parameter 'base_proc' [-Wunused-parameter]
2021-03-12T17:41:09.6041389Z ##[warning]lte/gateway/c/oai/tasks/nas/emm/Attach.c:1167:65: warning: unused parameter 'emm_context' [-Wunused-parameter]
...

Runner and Worker's Diagnostic Logs

Perhaps this is an important next step. I had attempted to enable diagnostic logs and it seems I failed (as I see no logs of the shape described in this subsection). I'll attempt to generate another run with diagnostic logs now.

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

Reproduce the build_oai job from the linked Magma workflow and compare it with the simple demonstration project where annotations appear. Start by tracing the runner's problem-matcher annotation handling for container-produced paths, especially the workspace and lte/... mapping. Done means the matched GCC warnings produce pull-request file annotations in the container workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, docker, github-actions
Domain
ci-cd, devops, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.