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

test-coverage.yaml should fail on error #947

Open
Moohan opened this issue Nov 19, 2024 · 3 comments
Open

test-coverage.yaml should fail on error #947

Moohan opened this issue Nov 19, 2024 · 3 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@Moohan
Copy link

Moohan commented Nov 19, 2024

debendabot recommended updating the codecov action from 4 to 5 in our test-coverage.yaml. In the release notes, there are some breaking changes that will affect the current r-lib example: file: becomes files: and plugin: becomes plugins: I was surprised to see the workflow had passed on the PR though... Looking at the job details - https://github.com/Public-Health-Scotland/phsopendata/actions/runs/11883091545/job/33109379336 we can see that the action reported a warning and an error but the overall workflow still reported passing for some reason.

I'm not sure if this is something you can update or if it's part of the codecov action itself.

@Moohan Moohan added the bug an unexpected problem or unintended behavior label Nov 19, 2024
@gaborcsardi
Copy link
Member

gaborcsardi commented Nov 22, 2024

Well, you modified our example, and actually ended up with a broken step, so I am not sure where to go from here.

I am also not sure behind the intent of

          fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}

which I would think is the same as

          fail_ci_if_error: ${{ github.event_name != 'pull_request' }}

but maybe I am missing something.
Cf. https://github.com/Public-Health-Scotland/phsopendata/actions/runs/11883091545/workflow#L43

We have

          fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}

in the example workflow, because in a pull request there might not be a token in open source projects, so if we don't do this, then all such PRs will fail.

In any case, the workflows in the examples folder are just that, examples. If you don't like them, modify them as you like. But marking this as a bug because you don't like the default seems a bit excessive to me. :)

@Moohan
Copy link
Author

Moohan commented Nov 25, 2024

Hey, sorry if this came across wrong. I was sure I hadn't edited the workflow, so I didn't check it where I might have noticed the fail_ci_if_error param!

I looked back at the blame, and I must have taken the example at this point in history: 76c974b. I'll update our workflow with the current content.

I guess, as with this issue: codecov/codecov-action#1348, I'd expect it to fail by default and was surprised that it hadn't. When posting an issue, the templates only allow Bug / Feature Request / Security Vulnerability, and choosing the 'Bug' template will automatically tag it as a bug.

@gaborcsardi
Copy link
Member

I'd expect it to fail by default and was surprised that it hadn't.

It fails by default, except in PRs without a token.

only allow Bug / Feature Request / Security Vulnerability

Ah, right, makes sense, I'll update the template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants