-
Notifications
You must be signed in to change notification settings - Fork 0
chore: format code and fix CI configuration #12
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
Conversation
|
Claude finished @kaze-cow's task —— View job Code Review SummaryI've completed a comprehensive review of this PR focusing on code quality, security, performance, testing, and documentation. OverviewThis PR successfully combines formatting changes with critical infrastructure improvements to enable passing CI for downstream PRs. The changes are well-executed with only minor observations. Key Changes Reviewed✅ Formatting (Commit:
✅ Bug Fix (test/helpers/CowBaseTest.sol:27-28)
✅ Configuration Updates
✅ Documentation
Review FindingsCode Quality: ✅ Excellent
Security: ✅ No Issues
Performance: ✅ No Concerns
Testing:
Documentation: ✅ Good
Recommendations
Final AssessmentApproval Recommendation: ✅ APPROVED This PR is ready to merge. It achieves its stated goal of enabling passing CI for downstream PRs through:
The changes are clean, well-scoped, and will improve the reliability of the test suite. |
| (bool success,) = targets[i].call(datas[i]); | ||
| require(success, "Solver: call failed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional Change Detected
This is not just a formatting change - it adds proper error handling to the call() function.
Before:
targets[i].call(datas[i]);After:
(bool success,) = targets[i].call(datas[i]);
require(success, "Solver: call failed");Impact:
- ✅ Good change: Prevents silent failures in the batch execution
⚠️ Process issue: Should be in a separate PR/commit from formatting changes
Suggestion: Either:
- Keep this change and update the PR description to mention the bug fix
- Revert this change and submit it in a dedicated bug fix PR
This fix is important for correctness, but mixing it with formatting changes makes it harder to review and track in git history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude yep, that makes sense. This PR had a bit of a scope expansion as the purpose is mostly to ensure down stream PRs are able to have a passing CI. can you suggest a commit message/title that would be more appropriate with this in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude finished @kaze-cow's task —— View job
Suggesting appropriate commit message and PR title
- Review all changes in the PR to understand full scope
- Suggest appropriate commit message and PR title options
- Post final recommendations
Analysis
This PR contains two commits with different scopes:
- Commit 1 (
61051cd): Pure formatting viaforge fmt - Commit 2 (
6b12785): "foundry fixes" - includes:- Bug fix: Adding error handling to
Solver.runBatch() - Formatting adjustments (line length compliance)
- CI configuration updates (
foundry.toml+ workflow changes)
- Bug fix: Adding error handling to
Recommendations
Since you have two separate commits, you have a couple of options:
Option A: Keep the two-commit structure (Recommended)
This is the cleanest approach and provides good git history:
Commit 1 (already good):
chore: `forge fmt`
Commit 2 - Rename from "foundry fixes" to:
fix: add error handling to Solver and configure CI
- Add require() check to Solver.runBatch() to catch call failures
- Update foundry.toml line length from 100 to 120
- Configure GitHub Actions to use correct RPC URL
This ensures downstream PRs can pass CI.
Option B: Single descriptive commit message
If you squash the commits, use:
chore: format code and fix CI configuration
- Run `forge fmt` across codebase
- Fix Solver.runBatch() to check call success
- Update foundry.toml line length to 120
- Configure test workflow with proper RPC URL
Enables passing CI for downstream PRs.
PR Title Update
Current: chore: forge fmt
Suggested:
chore: format code and fix CI for downstream PRs
or
chore: apply formatting and CI fixes
Why This Matters
The bug fix (adding require(success, "Solver: call failed")) is a functional change that improves test reliability, not just cosmetic formatting. Documenting it properly helps:
- Future code reviewers understand the change
- Git blame show the intention behind the fix
- Downstream PR authors understand what changed
forge fmt| out = "out" | ||
| libs = ["lib"] | ||
| optimize = true | ||
| optimizer = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configuration Update ✅
Good catch updating optimize to optimizer. This is the correct configuration key for newer Foundry versions.
Verification Recommendation:
Consider verifying the optimizer is actually enabled by checking the compiled contract bytecode size or running:
forge build --sizesThis ensures the optimizer is working as expected after the configuration change.
| function runBatch(address[] memory targets, bytes[] memory datas) external { | ||
| for (uint256 i = 0; i < targets.length; i++) { | ||
| targets[i].call(datas[i]); | ||
| (bool success,) = targets[i].call(datas[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical Bug Fix ✅
Excellent improvement adding proper error handling! This fixes a silent failure bug.
Before: Call failures were silently ignored
After: Call failures now revert with a descriptive error message
Why this matters:
- Debugging: Failed calls will now provide clear error messages
- Test reliability: Tests will catch solver execution failures instead of passing silently
- Production safety: In a real solver scenario, you'd want to know immediately if any call fails
Minor Suggestion:
Consider adding which call index failed for better debugging:
require(success, string.concat("Solver: call ", vm.toString(i), " failed"));This would make it easier to identify which specific call in the batch failed when multiple calls are involved.
| - name: Install Foundry | ||
| uses: foundry-rs/foundry-toolchain@v1 | ||
| with: | ||
| version: v1.4.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foundry Version Pinning ✅
Good practice pinning the Foundry version to v1.4.3. This ensures:
- Reproducible builds: CI will use the same version consistently
- Compatibility: Matches the
optimizerconfig change in foundry.toml - Stability: Prevents unexpected breaks from new Foundry releases
Note: Remember to periodically update this version to benefit from bug fixes and new features. Consider adding a comment in the file noting why this specific version was chosen.
| Provide clear, step-by-step instructions for verifying this change locally. | ||
| Assume the reviewer has no prior context about your setup. | ||
|
|
||
| This section reinforces the scope of the PR by outlining what should be tested and what the expected outcomes are. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Template Addition ✅
Good addition of a PR template to standardize pull request descriptions. The template includes all essential sections:
- Description (what & why)
- Context (background & motivation)
- Out of Scope (prevents scope creep)
- Testing Instructions (verification steps)
Verification Status:
✅ Template structure matches the source from cowprotocol/token-lz
✅ Content is well-organized and clear
✅ Encourages thorough PR descriptions
This will help maintain consistent PR quality across the repository.
| // SPDX-License-Identifier: UNLICENSED | ||
| // !! THIS FILE WAS AUTOGENERATED BY abi-to-sol v0.8.0. SEE SOURCE BELOW. !! | ||
| pragma solidity ^0.8; | ||
| pragma experimental ABIEncoderV2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: this file is actually removed in subsequent PRs, so dont dig too deep in this
Description
Make tool changes and formatting fixes to allow downstream PR's CI to pass.
Context
In detail:
forge fmtacross codebaseoptimizetooptimizer(new name for new version)Testing Instructions
Confirm the CI is passing (verifies
forge fmtwas run as expected)Confirm foundry changes make sense
Confirm Pull request template is the same as previous that it was copied from https://github.com/cowprotocol/token-lz/blob/main/.github/pull_request_template.md