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

ref(workflow): move most scripts to their own executables #8005

Merged
merged 22 commits into from
Dec 12, 2023

Conversation

gustavovalverde
Copy link
Member

@gustavovalverde gustavovalverde commented Nov 27, 2023

Motivation

Some CI files are hard/understand as they have bash scripts included, some of this scripts are also hard to maintain or lint considering they're inside a .yml and not in an actual .sh

Some of these scripts might also be useful as a separate file to run independently for specific use cases, like searching for disks in GCP (but that's not part of the scope of this PR)/

Fixes #6168

Depends-On: #8083

PR Author Checklist

Check before marking the PR as ready for review:

  • Will the PR name make sense to users?
  • Does the PR have a priority label?
  • Have you added or updated tests?
  • Is the documentation up to date?
For significant changes:
  • Is there a summary in the CHANGELOG?
  • Can these changes be split into multiple PRs?

If a checkbox isn't relevant to the PR, mark it as done.

Complex Code or Requirements

Some scripts required refactoring for consistency and better use outside the workflow YAML

Solution

  • Move most scripts to the ./github/workflows/scripts directory
  • Lint the scripts to comply with bash linting
  • Refactor the scripts so it's easier to make further updates.

Review

We need to confirm the right disk are being pulled, comparing with recent PRs

Reviewer Checklist

Check before approving the PR:

  • Does the PR scope match the ticket?
  • Are there enough tests to make sure it works? Do the tests cover the PR motivation?
  • Are all the PR blockers dealt with?
    PR blockers can be dealt with in new tickets or PRs.

And check the PR Author checklist is complete.

Follow Up Work

Make this scripts usable as a standalone script

@gustavovalverde gustavovalverde added A-devops Area: Pipelines, CI/CD and Dockerfiles C-enhancement Category: This is an improvement P-Medium ⚡ I-usability Zebra is hard to understand or use labels Nov 27, 2023
@gustavovalverde gustavovalverde self-assigned this Nov 27, 2023
@gustavovalverde gustavovalverde requested a review from a team as a code owner November 27, 2023 09:52
@gustavovalverde gustavovalverde requested review from oxarbitrage and removed request for a team November 27, 2023 09:52
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Nov 27, 2023
@oxarbitrage
Copy link
Contributor

G-cloud issues, i am updating the branch to run everything again and check if that was temporal or already resolved.

@oxarbitrage
Copy link
Contributor

G-cloud issues, i am updating the branch to run everything again and check if that was temporal or already resolved.

Unfortunately this seems to be a bug in the refactor. https://github.com/ZcashFoundation/zebra/actions/runs/7023238162/job/19109744164?pr=8005

@gustavovalverde
Copy link
Member Author

Unfortunately this seems to be a bug in the refactor.

Some fixes were applied. This should be good now

@oxarbitrage
Copy link
Contributor

ERROR: (gcloud.compute.ssh) Could not fetch resource:
 - The resource 'projects/zfnd-dev-zebra/zones/us-east1-c/instances/lwd-send-transactions-8005-merge-bf708ec' was not found

https://github.com/ZcashFoundation/zebra/actions/runs/7094975945/job/19311396467

Updating branch to re run the CI.

Copy link
Contributor

@oxarbitrage oxarbitrage left a comment

Choose a reason for hiding this comment

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

I think this PR simplifies the CI by a lot so i will like to see it merged. However, it seems there is a problem in the changes.

The CI is stuck here:
https://github.com/ZcashFoundation/zebra/actions/runs/7101877538/job/19331501819?pr=8005

What i am most afraid of if that it seems to not be picking the right disks. @gustavovalverde can you take a look and clarify ?

@teor2345
Copy link
Collaborator

teor2345 commented Dec 5, 2023

I think this PR simplifies the CI by a lot so i will like to see it merged. However, it seems there is a problem in the changes.

The CI is stuck here: ZcashFoundation/zebra/actions/runs/7101877538/job/19331501819?pr=8005

What i am most afraid of if that it seems to not be picking the right disks. @gustavovalverde can you take a look and clarify ?

This seems to be the same bug with the runners, I can do the same temporary fix if Gustavo isn't around.

@teor2345
Copy link
Collaborator

teor2345 commented Dec 5, 2023

This seems to be maybe finding the incorrect GCP resource?

@gustavovalverde
Copy link
Member Author

This seems to be maybe finding the incorrect GCP resource?

That's correct. But it's actually because a wrong assignment was being made, and previously the disk was not matching correctly, so @oxarbitrage was right being afraid with CI failing.

There's just a missing fix which I'll end up doing tomorrow.

@gustavovalverde
Copy link
Member Author

@oxarbitrage this is finally good!

The PR is failing as codespell is failing to build, but that's unrelated: https://github.com/ZcashFoundation/zebra/actions/runs/7143157187/job/19454023893?pr=8005

@arya2 arya2 added the do-not-merge Tells Mergify not to merge this PR label Dec 11, 2023
@teor2345 teor2345 removed the do-not-merge Tells Mergify not to merge this PR label Dec 12, 2023
teor2345
teor2345 previously approved these changes Dec 12, 2023
@teor2345
Copy link
Collaborator

I've scheduled this after the scanner tests merge, because they are blocking other work.

Co-authored-by: Marek <mail@marek.onl>
Co-authored-by: teor <teor@riseup.net>
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-enhancement Category: This is an improvement C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG I-usability Zebra is hard to understand or use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add short descriptions at the top of the workflow files actions: keep scripts out of the workflow scope
4 participants