hiero-ledger / hiero-ledger/hiero-consensus-node
Add retry job to `zxc-validate-state` workflow
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
Currently if an attempt to download the validator jar fails, the whole workflow fails as well. Occasionally `Download Validator jar` fails with
```
Your credentials are invalid. Please run
$ gcloud auth login
```
This error is intermittent, a retry could have helped. However, we need to retry the whole job because we need to re-run `Authenticate to Google Cloud` step.
To achieve that we can use the following trick:
```
validate-state:
[...]
steps:
[...]
retry-on-failure:
runs-on: state-validator-linux-${{ inputs.runner-type}}
if: ${{ failure() && fromJSON(github.run_attempt) < 3 }} # Only run on failure and if under max attempts
needs: validate-state
steps:
- name: Rerun failed jobs
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.reRunWorkflowFailedJobs({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId
});
```
This `retry-on-failure` job will try a couple more time before the workflow fails. If __this__ job fails, the whole workflow should fail as well.
Contributor guide
Research direction
Search the GitHub Actions workflow containing the `zxc-validate-state` job and read its existing authentication and validator-download steps. Add the requested retry job using the shown failure and run-attempt conditions, then verify that failed validation runs retry up to the limit and that a failed retry job still fails the workflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions
- Domain
- ci-cd, devops
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100