-
-
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
Publishes to random workflow #12
Comments
This seems to be related with this issue we are suffering for scheduled checks. We are now using your latest 1.5 release, where I see support for all kind of events was added. However, it is not working as expected for "schedule" event type... as you mentioned, the check runs are published with the commit ID:
and unfortunately that check gets added to our latest action run for the "push" event but not for the scheduled event we run hourly: This is the output from the step:
But as you mentioned there is not way to provide the run_id when creating the check... |
Thanks for the screenshots and feedback, nice to see the action running in other situations then I envisioned. I'll keep trying to find a solution for this though. |
This is a missing feature in the Actions API and Github developers are aware: https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380. 👀 |
Branch branch-multi-workflows-random-check-suite reproduces this issue. The first workflow runs the unit test action, the second workflow does something else. The check run with unit test results from the first workflow appear on the second workflow: |
My hypothesis is that the result is posted to the workflow that started last. One idea to test this and tackle this issue then is to have the current unit test result workflow sleep a bit and then trigger another workflow that actually runs the unit test result action. That way we increase chances the action is started last and its result is then posted to the same workflow. In #64 @RyanSchw posted a similar setup where the Worth giving it a try. |
We are no longer using EnricoMi/publish-unit-test-result-action for publishing of tests results, due to a known bug in the action, causing wrong association of tests results with workflows (EnricoMi/publish-unit-test-result-action#12). Failing tests still will cause the job to be reported as failed.
This has some problems, namely that it gets confused as to what workflow run to add results to. Related issue: EnricoMi/publish-unit-test-result-action#12 This seems to be a shortcoming of the github API: https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380/7 Signed-off-by: Brian Goff <[email protected]>
The way that Github's Super-Linter does it is by creating a new status check for each language that it lints: Would it make sense to post a separate status check for this altogether? That way the status check would be decoupled from the workflow and prevent assignment to a random workflow. |
An interesting observation is that artifact uploads are workflow run specific, they end up at the right workflow: #165 (comment). I'll look into how that action uses the API to achieve this. |
FYI for artifacts the I'm guessing that doesn't help us here, but thought I'd point it out JIC. |
This has some problems, namely that it gets confused as to what workflow run to add results to. Related issue: EnricoMi/publish-unit-test-result-action#12 This seems to be a shortcoming of the github API: https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380/7 Signed-off-by: Brian Goff <[email protected]>
It'd be nice if you guys could go give a +1 in the communty too so github gives more attention to this issue. https://github.community/t/associate-a-check-run-with-a-workflow/122540/4 |
@bobleujr see also #12 (comment) |
@TWiStErRob just cross-commented. Thanks for bringing it to my attention! |
Hitting this also. |
FYI: might be related slightly community/community#13480 |
With GitHub introducing "job summary", the action now additionally publishes the results at the summary page of the workflow that runs the publish action. From there, a link to the check annotations is provided if failures exists: https://github.com/EnricoMi/publish-unit-test-result-action/tree/v1.35#github-actions-job-summary This make it less urgent for GitHub to fix this randow-workflow issue for checks. |
The "random workflow" issue is not fixed by the new "job summary" feature, but it helps to mitigate the impact. The workflow that runs the publish job now contains the "job summary" with test results. In case test failures exist, the "job summary" contains a link to the test result annotations in the "random workflow". So the location of the test result annotations does not matter as much any more. |
Ping! - still present for my multi workflows pipeline, you guys have any solution? 🙏 |
Only Github can fix this: https://github.com/orgs/community/discussions/24616 |
On other actions I've seen people commenting the only workaround to this epic issue is to publish only the |
I did some tests and it doesn't seem to be completely random, from what I can tell it publishes to the first created workflow for the commit. So what I ended up doing was renaming my workflows to something like:
So far they are all landing on This is the case when all workflows run successfully, If one of them fails early I think they start landing on the failed one (but I still have to validate this scenario). |
@lt-mayonesa I could save you the time as I've seen the issue multiple times during a migration to GH Actions. Long story short it is not random and you can't fix it on your end. The best way to explain it would be with a Same goes if It's either this or internally there's some Anyway... in both cases there isn't much that can be done from the user end point. Feel free to complain here: https://github.com/orgs/community/discussions/24616 Maybe if enough pressure is put the issue will be resolved. |
@steve-todorov , thanks for the info, tho I think we ment the same thing. So far for me, by using the "naming convention" I managed to get that ~90% of the runs the checks get created were they should ( |
You can force the check-run of this action to always use a separate check-suite. To do so, you
result It comes at the cost of not having the published message as part of the GH Actions run - this would otherwise be randomly assigned. Answer in discussion: https://github.com/orgs/community/discussions/24616#discussioncomment-5607870 |
@EnricoMi In order to avoid this issue, will it be possible to add a flag that disables the check run reporting and only keep the comments and/or job summary? I rather have that than see the check appear at a random location |
From what I observed, the workflow reports are attached to the check run referring to the commit that is latest on the branch-from-which-workflow-has-run (in my case I'm using workflow_dispatch). I found that the env var GITHUB_SHA which is defined by GHA has the default value of the latest commit SHA on the triggering branch - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch, so if I change this env variable will the check runs & summary go to the intended place. Also I'm changing this env variable only for Enrico test report step, so are you guys using it anywhere in a way that would create a clashing? |
Apparently, we're now affected by this issue [1] here (tl;dr: the GitHub API is kinda broken) and therefore publishing the test results is failing randomly. I've removed the step, as the workflow already ensures that the tests run. [1]: EnricoMi/publish-unit-test-result-action#12
@EnricoMi I am getting error "Error: Container action is only supported on Linux" when running this on the Self-Hosted Windows runners any suggestions ? |
This comment was marked as off-topic.
This comment was marked as off-topic.
@TWiStErRob i tried that it is giving the error |
@rahulshrivastava-eaton can you please discuss this in a separate issue, this is completely unrelated. |
This feature has been released 19th, Dec. 2023. See README.md for details:
|
I just hit this issue too. The monorepo has 2 projects and 2 builds. When both builds kick off at once, the build summary is on the correct build, but for both the annotations and test results tab, all results are on the first build that finishes. |
When there are multiple GitHub workflows for one commit, the action publishes the commit status to a random workflow. It should be the workflow that contains the action. This is due to GitHub's API not allowing to specify which workflow to add the check run to.
Both REST and GraphQL APIs do not allow to specify the workflow:
The
github.run_id
workflow variable provides the check run id where the action runs.Update 2022-05-14:
With GitHub introducing "job summary", the action now additionally publishes the results at the summary page of the workflow that runs the publish action. From there, a link to the check annotations is provided if failures exists: https://github.com/EnricoMi/publish-unit-test-result-action/tree/v1.35#github-actions-job-summary. However, this is not a proper fix for this issue.
Only Github can fix this issue. Please see this discussion: https://github.com/orgs/community/discussions/24616
Checks can be disabled with
check_run: false
.The text was updated successfully, but these errors were encountered: