Skip to content

test: branch properties of main and release/* #145

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

Merged
merged 12 commits into from
Mar 17, 2025
Merged

Conversation

ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Feb 17, 2025

Why this should be merged

Safer release process by enforcing invariants of release/* branches as automated in #137 to fulfil #25.

How this works

New test for go_tooling CI job.

If the PR target branch is main then only the params.ReleaseType is checked. If the target is neither main nor a release branch then the test is skipped. The checks performed on release/* branches are described in the test.

How this was tested

Locally against a dummy release branch with deliberate problems created by (a) including this PR's changes in the final commit and (b) not updating the libevm version.

$ go test -v ./... --target_branch="release/v1.13.14-0.1.0.rc.3"
=== RUN   TestCherryPicksFormat
--- PASS: TestCherryPicksFormat (0.39s)
=== RUN   TestBranchProperties
=== RUN   TestBranchProperties/branch_name
    release_test.go:172: 
                Error Trace:    .../ava-labs/libevm/libevm/tooling/release/release_test.go:172
                Error:          Not equal: 
                                expected: "release/v1.13.14-0.1.0.beta"
                                actual  : "release/v1.13.14-0.1.0.rc.3"
                            
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1 @@
                                -release/v1.13.14-0.1.0.beta
                                +release/v1.13.14-0.1.0.rc.3
                Test:           TestBranchProperties/branch_name
    release_test.go:175: On release branch; params.LibEVMReleaseType = "beta", which is unsuitable for release branches
=== RUN   TestBranchProperties/commit_history
    release_test.go:192: Forked from "main" at commit 4c6e50e7d15795d2d435c53b9dcfc2d02325437d (chore: module-renaming workflow inverts between `libevm` and `geth` (#152))
    release_test.go:314: ### History since fork from default branch (8 commits):
    release_test.go:316: internal/build, rpc: add missing HTTP response body Close() calls (#29223) by Shiming Zhang <[email protected]>
    release_test.go:316: core/state: fix bug in statedb.Copy and remove unnecessary preallocation (#29563) by Aaron Chen <[email protected]>
    release_test.go:316: params: print time value instead of pointer in ConfigCompatError (#29514) by Nathan <[email protected]>
    release_test.go:316: eth/gasprice: add query limit for FeeHistory to defend DDOS attack (#29644) by Nathan <[email protected]>
    release_test.go:316: core/state/snapshot: add a missing lock (#30001) by maskpp <[email protected]>
    release_test.go:316: crypto: add IsOnCurve check (#31100) by Felix Lange <[email protected]>
    release_test.go:316: internal/ethapi: fix panic in debug methods (#31157) by Sina M <[email protected]>
    release_test.go:316: x by Arran Schlosberg <[email protected]>
=== RUN   TestBranchProperties/commit_history/cherry_picked_commits
    release_test.go:314: ### Expected cherry-picks (7 commits):
    release_test.go:316: internal/build, rpc: add missing HTTP response body Close() calls (#29223) by Shiming Zhang <[email protected]>
    release_test.go:316: core/state: fix bug in statedb.Copy and remove unnecessary preallocation (#29563) by Aaron Chen <[email protected]>
    release_test.go:316: params: print time value instead of pointer in ConfigCompatError (#29514) by Nathan <[email protected]>
    release_test.go:316: eth/gasprice: add query limit for FeeHistory to defend DDOS attack (#29644) by Nathan <[email protected]>
    release_test.go:316: core/state/snapshot: add a missing lock (#30001) by maskpp <[email protected]>
    release_test.go:316: crypto: add IsOnCurve check (#31100) by Felix Lange <[email protected]>
    release_test.go:316: internal/ethapi: fix panic in debug methods (#31157) by Sina M <[email protected]>
=== RUN   TestBranchProperties/commit_history/final_commit
    release_test.go:365: Modified disallowed file "go.yml"
    release_test.go:365: Modified disallowed file "go.mod"
    release_test.go:365: Modified disallowed file "go.sum"
    release_test.go:365: Modified disallowed file "release_test.go"
--- FAIL: TestBranchProperties (2.07s)
    --- FAIL: TestBranchProperties/branch_name (0.00s)
    --- FAIL: TestBranchProperties/commit_history (2.07s)
        --- PASS: TestBranchProperties/commit_history/cherry_picked_commits (1.81s)
        --- FAIL: TestBranchProperties/commit_history/final_commit (0.01s)
FAIL
FAIL    github.com/ava-labs/libevm/libevm/tooling/release       2.712s
FAIL

@ARR4N ARR4N force-pushed the arr4n/release-branch-checker branch from 6102bbc to 9857259 Compare March 13, 2025 10:52
@ARR4N ARR4N force-pushed the arr4n/release-branch-checker branch from a6f889f to ef5a16e Compare March 13, 2025 11:38
@ARR4N ARR4N marked this pull request as ready for review March 13, 2025 14:07
@ARR4N ARR4N requested a review from a team March 13, 2025 14:19
@ARR4N ARR4N enabled auto-merge March 17, 2025 16:52
@ARR4N ARR4N added this pull request to the merge queue Mar 17, 2025
Merged via the queue into main with commit 08490a9 Mar 17, 2025
11 checks passed
@ARR4N ARR4N deleted the arr4n/release-branch-checker branch March 17, 2025 17:01
ARR4N added a commit that referenced this pull request Mar 17, 2025
## Why this should be merged

The CI job in #145 requires a local (to the runner) `main` branch and
since `actions/checkout` doesn't check it out, the workflow creates the
branch off `origin/main`. However, after merge of a PR to `main`, the
workflow is run on `main` itself and that step [fails because the branch
already
exists](https://github.com/ava-labs/libevm/actions/runs/13908218530/job/38916101218).

## How this works

Only call `git branch main origin/main` if `main` doesn't exist.

## How this was tested

We'll see once it's merged 🤷
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.

2 participants