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

feat(ci): validate state version with cached state #4074

Closed
wants to merge 53 commits into from

Conversation

gustavovalverde
Copy link
Member

@gustavovalverde gustavovalverde commented Apr 9, 2022

Motivation

We don't check the state version when updating the cached state, so old PRs can add a new "latest" cached state with the old state version. This won't break CI, but it adds 2.5 hours to the mergify queue.

We can check cached state version vs the version in the current branch being tested. Doing this requires making the cached state version easier to find in CI. One idea is adding the state version as disk image metadata or in the name of the disk, and then doing some Rust test / grep check to compare the latest cached state disk version with the in-branch version, and only using the cached state if they are the same version.

If the cached state version is higher than the branch version, we can not run the test, failing the test until the branch is rebased onto main.

Either way, the goal is that 'old' state versions (older than the version of state on #main) should not be created and pushed to gcloud, where they can be used by other tests.

Fixes #3881
Depends-On: #4073

Solution

  • Before building or running other tests, confirm the local (branch) state version against the cached state version

Review

@dconnolly can review this

Follow Up Work

  • Decide if there's a different behavior to be done when the cached state version is lower than the branch version
  • Creating images when pushing to main to reduce cross-PR contamination

In the Test workflow we were using a different approach than the one being used in the Full sync test.

Also, in the Full sync test the variable was LOWER_NET_NAME, but NETWORK was being used in the disk name, with caps.
Disk states synced to canopy and synced to the chain tip should have different names to reference correctly on actual and coming tests the needed disk.
Before building and pushing new cached states, validate that our local version is not lower than the one available in GCP
@gustavovalverde gustavovalverde added A-infrastructure Area: Infrastructure changes A-devops Area: Pipelines, CI/CD and Dockerfiles P-High 🔥 I-integration-fail Continuous integration fails, including build and test failures labels Apr 9, 2022
@gustavovalverde gustavovalverde self-assigned this Apr 9, 2022
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

I'm not sure I understand exactly what is going on in these tests, happy to catch up for a video call if that would help.

.github/workflows/test-full-sync.yml Outdated Show resolved Hide resolved
.github/workflows/test-full-sync.yml Outdated Show resolved Hide resolved
.github/workflows/test-full-sync.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
@teor2345 teor2345 added the do-not-merge Tells Mergify not to merge this PR label Apr 19, 2022
@gustavovalverde
Copy link
Member Author

@teor2345 I've integrated the considerations from your last comment.

Copy link
Contributor

@teor2345 teor2345 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, but I have a bunch of questions about how it works in detail.

.github/workflows/test-full-sync.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Show resolved Hide resolved
.github/workflows/test.yml Show resolved Hide resolved
.github/workflows/test.yml Show resolved Hide resolved
@teor2345
Copy link
Contributor

Regenerate stateful disks failed with #3991:

unexpected EOF

I'll restart the job.

teor2345
teor2345 previously approved these changes Apr 20, 2022
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Thanks for your patience with this!

@teor2345
Copy link
Contributor

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Apr 20, 2022

update

✅ Branch has been successfully updated

@gustavovalverde
Copy link
Member Author

This can't be merged until we fix #4155

@teor2345
Copy link
Contributor

Please include the clean fix #4206 when next updating this branch.

@teor2345
Copy link
Contributor

This isn't in the critical path for lightwalletd work, we can merge it after we get the lightwalletd integration tests working.

@gustavovalverde gustavovalverde force-pushed the feat-state-versioning branch from 6b1ad4e to c47cccb Compare May 2, 2022 21:57
@gustavovalverde gustavovalverde removed the do-not-merge Tells Mergify not to merge this PR label May 3, 2022
@gustavovalverde
Copy link
Member Author

Obsoleted by #4271

@teor2345 teor2345 deleted the feat-state-versioning branch September 5, 2022 23:07
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 A-infrastructure Area: Infrastructure changes I-integration-fail Continuous integration fails, including build and test failures
Projects
None yet
2 participants