Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Fixes

When binary downloads fail with fail-on-error: false, the installation exits cleanly but subsequent steps attempt to execute the missing coveralls command, causing "command not found" errors that break CI workflows.

Changes

Installation error handling

  • macOS: Added fail-on-error checks for brew install failures and missing binary
  • Linux: Added fail-on-error check for missing binary after extraction
  • Windows: Wrapped downloads in try-catch, added fail-on-error checks for checksum verification and missing binary

Execution safeguards

  • Split coverage report steps by OS (Unix/Windows) to handle shell differences
  • Added binary existence checks before executing coveralls commands
  • Exit cleanly with code 0 when binary missing and fail-on-error: false

Example

When installation fails:

# Before: Installation fails silently, then coverage step crashes
Failed to download coveralls binary or checksum (Linux).
coveralls: command not found  # Uncaught error breaks CI

# After: Installation fails silently, coverage step detects and exits cleanly
Failed to download coveralls binary or checksum (Linux).
Coveralls binary not found. Skipping coverage report.  # CI continues
Original prompt

This section details on the original issue you should resolve

<issue_title>fail-on-error doesn't work well when download fails</issue_title>
<issue_description>https://github.com/PowerDNS/pdns/actions/runs/19316037365/workflow?pr=16483#L116-L124

https://github.com/PowerDNS/pdns/actions/runs/19316037365/job/55247983411?pr=16483#step:12:145

fail-on-error:

Run coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
```yml
  with:
    flag-name: auth-backend-remote
    path-to-lcov: $GITHUB_WORKSPACE/coverage.lcov
    parallel: true
    allow-empty: true
    fail-on-error: false
    github-token: ***
    coveralls-endpoint: https://coveralls.io/
    debug: false
    measure: false
    coverage-reporter-version: latest
    coverage-reporter-platform: auto-detect
  env:
    COMPILER: clang
    CLANG_VERSION: 13
    REPO_HOME: /__w/pdns/pdns
    BUILDER_VERSION: 0.0.0-git1
    COVERAGE: yes
    LLVM_PROFILE_FILE: /tmp/code-%p.profraw
    OPTIMIZATIONS: yes
    INV_CMD: . ${REPO_HOME}/.venv/bin/activate && inv
    BRANCH_NAME: 16483/merge
    normalized-branch-name: 16483-merge
Run # Enable debugging if 'debug' is true

github-action/action.yml

Lines 189 to 190 in e988b39

echo "Failed to download coveralls binary or checksum (Linux)."
[ "${{ inputs.fail-on-error }}" == "false" ] && exit 0

Failed to download coveralls binary or checksum (Linux).

github-action/action.yml

Lines 293 to 306 in e988b39

- name: Coverage report
if: inputs.parallel-finished != 'true'
shell: ${{ startsWith(runner.os, 'Windows') && 'pwsh' || 'bash' }}
run: >-
coveralls report
${{ inputs.debug == 'true' && '--debug' || '' }}
${{ inputs.measure == 'true' && '--measure' || '' }}
${{ inputs.fail-on-error == 'false' && '--no-fail' || '' }}
${{ inputs.allow-empty == 'true' && '--allow-empty' || '' }}
${{ inputs.base-path && format('--base-path {0}', inputs.base-path) || '' }}
${{ inputs.build-number && format('--build-number {0}', inputs.build-number) || '' }}
${{ inputs.format && format('--format {0}', inputs.format) || '' }}
${{ inputs.file || inputs.path-to-lcov }}
${{ inputs.files }}

Run coveralls report   --no-fail --allow-empty    $GITHUB_WORKSPACE/coverage.lcov 
/__w/_temp/16d91b4a-8e91-488a-abb2-9f38bdb90eed.sh: line 1: coveralls: command not found

</issue_description>

<agent_instructions>Please make sure the fail-on-error behavior wraps all actions that may potentially fail and raise an error that could break the user's CI workflow.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: afinetooth <918667+afinetooth@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix fail-on-error handling for download failures Fix fail-on-error to handle all installation and execution failures Nov 17, 2025
Copilot AI requested a review from afinetooth November 17, 2025 22:45
Copy link

@jsoref jsoref left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practices say that you should not use ${{...}} in a run: block, but instead should use env: for the value and then use that variable in the run: block.

Copy link
Member

@afinetooth afinetooth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good enough to release incremental version for testing.

@afinetooth afinetooth marked this pull request as ready for review November 17, 2025 23:35
@afinetooth afinetooth merged commit 5cbfd81 into main Nov 17, 2025
144 checks passed
@afinetooth afinetooth deleted the copilot/fix-fail-on-error-issue branch November 17, 2025 23:35
@afinetooth
Copy link
Member

OK, will look at that asap.

Did you happen to test v2.3.7?

@afinetooth
Copy link
Member

The main bug reported here has been fixed in PR #254 and will be released Release v2.3.7.

However, there's a remaining enhancement suggestion, which will be tracked in #257.

@jsoref
Copy link

jsoref commented Nov 28, 2025

We're using v2.3.7 PowerDNS/pdns@2182d55

I can't say we've particularly noticed things. There are plenty of problems with instability, but I certainly haven't noticed any problems due to the update.

lfit-replication pushed a commit to lfit/releng-gerrit_to_platform that referenced this pull request Dec 31, 2025
Bumps coverallsapp/github-action from 2.3.6 to 2.3.7.
## Release notes

Sourced from coverallsapp/github-action's releases.

v2.3.7
What's Changed

README.md: Use current actions/setup-node and LTS version of Node.js by @​cclauss in coverallsapp/github-action#247
Update workflow to update and verify release branch by @​afinetooth in coverallsapp/github-action#249
Fix fail-on-error to handle all installation and execution failures by @​Copilot in coverallsapp/github-action#254

New Contributors

@​cclauss made their first contribution in coverallsapp/github-action#247
@​Copilot made their first contribution in coverallsapp/github-action#254

Full Changelog: coverallsapp/github-action@v2...v2.3.7

## Commits

5cbfd81 Fix fail-on-error to handle all installation and execution failures (#254)
e988b39 Update workflow to sync and verify release branch (#249)
e7f4f97 README.md: Use current actions/setup-node and LTS version of Node.js (#247)
See full diff in compare view

![Dependabot compatibility score](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

Change-Id: Iaf83fbb22eabe15211ad3a283edc45aa02e7c322

---

## Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

> **Note**
> Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: lfit.gh2gerrit <releng+lfit-gh2gerrit@linuxfoundation.org>
Change-Id: I0838c4b4a83889a5fa2de03c76e35647dcd9d232
GitHub-PR: #21
GitHub-Hash: 1a12f4b70c7750ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fail-on-error doesn't work well when download fails

3 participants