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

refactor(ci): do not run workflows tied to ZcashFoundation infra in forks #9257

Merged
merged 2 commits into from
Feb 18, 2025

Conversation

sellout
Copy link
Contributor

@sellout sellout commented Feb 14, 2025

Motivation

Various workflows fail whenever I push to main on my fork. And one workflow is on a cron job which runs daily and emails me every day.

The failures are generally due to something like needing ZF credentials for some service, like DockerHub or GCP.

Solution

This disables a bunch of CI jobs if they are run outside of the ZcashFoundation org.

There are also two workflows that simply had bugs in them. Those have also been fixed. Both bugs are caught by GitHub’s workflow file checks, so neither workflow gets run (i.e., they are not logic bugs in the steps that are performed, but references from one job to a job that doesn’t exist).

Tests

Basically pushing these changes to main on my fork until I don’t get any failures. Some of the workflows don’t run right away, so it’s possible another failure may show up in a day.

PR Author's Checklist

  • The PR name will make sense to users.
  • The PR provides a CHANGELOG summary.
  • The solution is tested.
  • The documentation is up to date.
  • The PR has a priority label.

PR Reviewer's Checklist

  • The PR Author's checklist is complete.
  • The PR resolves the issue.

There are two workflows that have bugs in them:
- cd-deploy-nodes-gcp is missing a job name, which is then depended-on
  later
- sub-ci-integration-tests-gcp changed the name of a job without
  changing its dependents
There are various GitHub CI jobs that won’t work on forks. E.g., some
need credentials for ZF’s DockerHub or GCP accounts.

Unfortunately, you can’t prevent entire workflows from running this way,
but this disables a minimal number of jobs to keep forks from failing
whenever `main` is pushed to.
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Feb 14, 2025
@gustavovalverde gustavovalverde changed the title Stop GitHub workflows from failing on forks refactor(ci): do not run workflows tied to ZcashFoundation infra in forks Feb 18, 2025
@gustavovalverde gustavovalverde marked this pull request as ready for review February 18, 2025 10:12
@gustavovalverde gustavovalverde requested a review from a team as a code owner February 18, 2025 10:12
@gustavovalverde gustavovalverde added C-bug Category: This is a bug A-devops Area: Pipelines, CI/CD and Dockerfiles I-integration-fail Continuous integration fails, including build and test failures P-Critical 🚑 labels Feb 18, 2025
@gustavovalverde gustavovalverde self-assigned this Feb 18, 2025
Copy link
Member

@gustavovalverde gustavovalverde left a comment

Choose a reason for hiding this comment

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

This is a great suggestion and fix. Thank you @sellout. I'll be adding some extra documentation based on this changes.

LGTM

mergify bot added a commit that referenced this pull request Feb 18, 2025
Copy link
Contributor

mergify bot commented Feb 18, 2025

This pull request has been removed from the queue for the following reason: checks failed.

The merge conditions cannot be satisfied due to failing checks:

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

@mpguerra
Copy link
Contributor

@mergify refresh

Copy link
Contributor

mergify bot commented Feb 18, 2025

refresh

✅ Pull request refreshed

mergify bot added a commit that referenced this pull request Feb 18, 2025
@mergify mergify bot merged commit 5953f8a into ZcashFoundation:main Feb 18, 2025
126 checks passed
@sellout sellout deleted the fix-github-workflows branch February 18, 2025 23:01
sellout added a commit to sellout/zebra that referenced this pull request Feb 19, 2025
Introduced by ZcashFoundation#9257, but overlooked because the workflow runs asynchronously. (Is there a way to get
GitHub to validate workflow files in a PR check, rather than only when the workflow runs?)
elijahhampton pushed a commit to elijahhampton/zebra that referenced this pull request Feb 25, 2025
… forks (ZcashFoundation#9257)

* Fix GitHub workflows

There are two workflows that have bugs in them:
- cd-deploy-nodes-gcp is missing a job name, which is then depended-on
  later
- sub-ci-integration-tests-gcp changed the name of a job without
  changing its dependents

* Stop certain CI jobs from running on forks

There are various GitHub CI jobs that won’t work on forks. E.g., some
need credentials for ZF’s DockerHub or GCP accounts.

Unfortunately, you can’t prevent entire workflows from running this way,
but this disables a minimal number of jobs to keep forks from failing
whenever `main` is pushed to.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-devops Area: Pipelines, CI/CD and Dockerfiles C-bug Category: This is a bug C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG I-integration-fail Continuous integration fails, including build and test failures P-Critical 🚑
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants