-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Missing report with manually triggered job #165
Comments
Can you run the action with:
and point me to a run that works and one that fails (if in a public repo)? |
Same problem here, I've set up a simple example with debugging enabled. |
@ralfstuckert it looks like the manually started run published its report to the The push run started 7:52 CEST and finished before 7:56 CEST, where its report was added (overwritten) 5:59 CEST. The manual run started 5:58 CEST and finished 5:59 CEST, which fits with the report's publish time. These check results (reports) are added via a GitHub API call, which does not know which workflow run does the call, so GitHub decides where to put those check results (probably the oldest one). See #12. |
Showing the log's timestamps, I see the following: Manually: This fits the order in the history. Where did you see 7:52 CEST? |
I have a very similar setup as @ralfstuckert; I noticed that if any new commits occur in the repo where the tests run then a new result will be created. But if no new commits exist in the repo, any subsequent test results overwrite the results from the one run (as @EnricoMi pointed out)
I interpreted this series of events (perhaps mistakenly) as; this publishes the results to the last run where a commit occurred. Is that what's happening here? |
I also noticed that when the publish overwrites a previous run's results (instead of the proper run where the results were generated), there doesn't seem to be a similar problem occurring when artifacts are uploaded to that same run. (It's possible I just haven't seen it happen yet?) Granted, I know nothing of how the github API works but I wonder if there is a work-around there? |
Very interesting observation, I will try o reproduce this. If that is the case, then the work-around would be to add an artifact to your workflow. |
I'm sorry, I was not clear. There isn't any sort of interaction between the artifacts and the results. I only noticed that artifacts don't appear to suffer from the same issue that results do. Which is a little puzzling to me; they both attach info to a run. I have two runs. The first run happens just after a commit. The second run occurs after the first run is finished (no new commits). Both have artifacts but only the first run will have results. As you've noted the first run will contain the second run's results which overwrite the first's results. This pattern will continue to occur (new runs overwriting the first run's results) until a new commit happens, at which point the run immediately after the new commit will now hold a new set of results. And yet, every one of those runs will contain their own artifacts. My curiosity is about what allows the artifacts to post to the proper run; whereas results can't? Does https://github.com/actions/upload-artifact not use the same API, perhaps? |
Hey @MarcelWilson, that is an excellent question. I'll have a look into the artifact upload action to find out which API it uses and how it resolves the workflow run. I suspect that the artifact upload API is workflow run specific and the check run API is commit-centered, which internally picks a workflow run (the first per commit). Thanks for sharing the observation. |
I started to read up on check-run/check-suite and I suspect you're right. Which has me wondering, could a workflow run add a commit prior to when the publish action step is triggered? Would this even work from an order of events standpoint? While it might be slightly annoying to have essentially empty commits, it wouldn't be the end of the world in my case. (at least until github updates the API) |
Automatically generating a commit at the start of the workflow run sorta works but there are some timing caveats. It's by no means a perfect work-around. Executing two runs concurrently can still end up with the results overwriting a different run depending on the timing. As long as runs are triggered in serial it will work. |
As I read more about
Secondly, I noticed the concurrency: automated_regression
jobs:
use_our_action:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: 'main'
- run: echo "GITHUB_SHA_LATEST=$(/usr/bin/git log -1 --format='%H')" >> $GITHUB_ENV
# "dummy" commit occurs here
# tests run here
- uses: EnricoMi/[email protected]
with:
files: ${{inputs.OUTPUT_DIR}}*.xml
report_individual_runs: "true"
hide_comments: off
check_run_annotations: all tests
comment_mode: create new
commit: ${{env.GITHUB_SHA_LATEST}} This doesn't appear to fix the issue and I don't really understand why. When
From what I can piece together from the above and jwgmeligmeyling's explanation, check-suite is our problem but I don't seem to understand how exactly. I figured the commit occurring in run |
Oh! there are multiple check-suites on the same SHA!! One gets created for SHA#1 by run When Run So the problem with my attempt at cleverness appears to be foiled by the fact that when a workflow is triggered it sets the SHA and creates a |
I consider the original question as answered and the follow up question a duplicate of #12. Please reopen if that is not the case. Thanks for your thoughts. |
I have a setup where I trigger a job manually, and that job actually checks out another repository that is runs for testing.
I still would like to see the report attached to the outcome of the github actions job. However, in the logs I can see:
And in most cases I don't see any results. Interestingly, sometimes I do.
The text was updated successfully, but these errors were encountered: