Skip to content

Conversation

@Thaleszh
Copy link
Contributor

@Thaleszh Thaleszh commented Dec 12, 2025

Description

Improve test pipelines by:

  • Reducing spam on unit-tests from iayl debug logger on store.go and mutable_tree.go
  • Adding cache to go mod download on E2E pipelines (reduces build step from ~8min to ~4min)

Type of change

  • New feature (non-breaking change which adds functionality)

Test

Pipeline changes:

@Thaleszh Thaleszh requested a review from jhelison as a code owner December 12, 2025 18:07
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Walkthrough

Two GitHub Actions workflows are modified to optimize CI/CD pipelines. The e2e.yaml workflow adds a new caching step that caches Go build artifacts and module dependencies, using go.mod file hash as part of the cache key. The test.yml workflow modifies the test coverage command to exclude additional files (store.go and mutable_tree.go) from coverage reporting, appending to existing exclusion filters.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the cache paths (~/.cache/go-build and ~/go/pkg/mod) are appropriate for the build environment
  • Confirm the cache key strategy (runner OS + go.mod hash) will provide meaningful cache hits without stale artifacts
  • Ensure the new file exclusion patterns (store.go: and mutable_tree.go:) in test.yml coverage filtering are intentional and correctly placed in the grep/sed pipeline
  • Check that the restore-keys fallback in the cache step provides reasonable fallback behavior across runner OS variations

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Improve pipelines' is vague and generic, using non-descriptive language that doesn't convey the specific improvements being made to the pipelines. Provide a more specific title that references the key changes, such as 'Add Go cache to E2E workflows and reduce test output spam'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly outlines the two main improvements being made: reducing debug logger spam and adding Go module cache to improve build performance.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/reduce-test-flakyness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/test.yml (1)

38-46: Avoid double-caching Go modules/build cache (setup-go cache + actions/cache).

You already have actions/setup-go@v5 with cache: true (keyed by go.sum), and also an explicit actions/cache for ~/go/pkg/mod and ~/.cache/go-build. This is likely redundant and can cause confusing cache behavior; consider keeping just one approach (prefer setup-go’s built-in cache unless you need custom paths/keys).

.github/workflows/e2e.yaml (1)

36-44: Include go.sum in the cache key (go.mod-only can serve stale deps).

Keying solely on **/go.mod can miss dependency changes captured in go.sum. Suggest:

-          key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod') }}
+          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum', '**/go.mod') }}

(or just **/go.sum if you prefer one source of truth).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79bdc96 and f826e47.

📒 Files selected for processing (2)
  • .github/workflows/e2e.yaml (2 hunks)
  • .github/workflows/test.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/e2e.yaml (1)

45-63: Parallel warm-up via go test -run=^$ looks fine; ensure it doesn’t race the module cache.

Given this runs alongside docker builds, caching should help, but if you see occasional flakiness due to concurrent writes into ~/go/pkg/mod/~/.cache/go-build, consider making only one step populate the Go cache (e.g., run go mod download single-threaded before the parallel section).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/e2e.yaml (2)

36-44: Cache key should include go.sum (and ideally Go version) to avoid stale restores.
Right now the key only hashes **/go.mod, so dependency graph changes that only touch go.sum (or different Go versions) can restore an incompatible cache and lead to flakiness.

Suggested tweak:

       - uses: actions/[email protected]
         with:
           path: |
             ~/.cache/go-build
             ~/go/pkg/mod
-          key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod') }}
+          key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.mod', '**/go.sum') }}
           restore-keys: |
-            ${{ runner.os }}-go-
+            ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-
+            ${{ runner.os }}-go-

(You’d need to add id: setup-go to the actions/setup-go@v5 step.)


45-65: Parallel step: consider adding a trap to kill background jobs on failure/timeout.
With set -e, a failure after starting background jobs can leave other jobs running until the runner tears down; a simple trap 'kill $(jobs -p) || true' EXIT makes this more robust.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f60e675 and 150af98.

📒 Files selected for processing (1)
  • .github/workflows/e2e.yaml (2 hunks)
🔇 Additional comments (1)
.github/workflows/e2e.yaml (1)

66-70: No concerns with the E2E invocation gating / env wiring.
SKIP_IBC_TESTS is still evaluated only when env.GIT_DIFF is set, and make test-e2e remains unchanged.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 150af98 and 42b7f18.

📒 Files selected for processing (2)
  • .github/workflows/e2e.yaml (2 hunks)
  • app/app.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: tests
  • GitHub Check: test-e2e
  • GitHub Check: golangci-lint
  • GitHub Check: Analyze
🔇 Additional comments (2)
.github/workflows/e2e.yaml (2)

36-43: LGTM! Caching will speed up CI builds.

The Go module and build cache configuration follows GitHub Actions best practices and should reduce build times as noted in the PR description.


46-46: Verify that E2E steps should always run unconditionally.

The if: env.GIT_DIFF conditions are now commented out, which means the build and test steps will execute on every workflow run regardless of whether Go-related files changed. While this ensures comprehensive testing, it increases CI resource usage.

Confirm this change is intentional, especially since the technote-space/get-diff-action step still runs but its output (GIT_DIFF) is no longer used.

If the intention is to remove these conditions permanently, consider also removing the unused get-diff-action step (lines 24-34) to simplify the workflow.

Also applies to: 67-67

@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/e2e.yaml (1)

66-70: SKIP_IBC_TESTS env assignment looks fine; consider quoting for clarity/consistency.

Not required, but you may prefer always-quoted strings for env values to avoid any YAML ambiguity:

-          SKIP_IBC_TESTS: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}
+          SKIP_IBC_TESTS: "${{ github.event_name == 'pull_request' && 'true' || 'false' }}"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 42b7f18 and b96de67.

📒 Files selected for processing (1)
  • .github/workflows/e2e.yaml (2 hunks)

@Thaleszh Thaleszh merged commit d9a792f into main Dec 12, 2025
6 of 7 checks passed
@Thaleszh Thaleszh deleted the fix/reduce-test-flakyness branch December 12, 2025 19:46
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.

3 participants