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

Reinstate rule that avoids posting test reports on non-PR pushes #2862

Closed
lunkwill42 opened this issue Mar 5, 2024 · 1 comment · Fixed by #2914
Closed

Reinstate rule that avoids posting test reports on non-PR pushes #2862

lunkwill42 opened this issue Mar 5, 2024 · 1 comment · Fixed by #2914
Assignees
Labels

Comments

@lunkwill42
Copy link
Member

3e434bc#diff-208a7f7ef0a1174d68708f24502994bd2a136c75128806eb0cf63c0a70679321 removed an if-statement attached to the publish-tests-results workflow whose function was too unclear.

This is now causing the CI suite to fail on pushed directly to branches (like master): https://github.com/Uninett/nav/actions/runs/8155376451/job/22290756342

The point of the original logic was that when a commit is pushed outside of a PR context, there is no place to actually publish the test result report, as the action we use for this will publish the report in a PR comment.

The existing logic relied on the fact that NAV developers mostly fork the NAV repo and post PRs from their forks, instead of adding branches directly to the official repo. The only "author" that creates PRs from branches on the official repo is dependabot.

We should either:

  1. Reinstate the pre-existing logic, but add a comment explaining why it's there

or

  1. Find some way to instead detect if the workflow is running as a result of a PR rather than a plain push to a branch and add that logic instead.
@lunkwill42
Copy link
Member Author

Reposting my comment from #2922:

Actually, I think we should maybe revert #2914 fully, and put #2862 on standby.

It seems that the test result publisher is indeed able to publish test results on the actions page when there is no PR associated with a commit. It's not that we want to avoid the test report, we want the reports - it's just that we thought there was nowhere to actually post it when there was no PR.

The confusing factor here is that the action fails, even if the results are published - apparently as it is trying to find a PR associated with the commit hash of the triggering commit.

Example in question: https://github.com/Uninett/nav/actions/runs/9063635622

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

Successfully merging a pull request may close this issue.

2 participants