-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix(solidity-devops): allow verifier fo be omitted for a chain #2659
Conversation
WalkthroughThe recent changes enhance the Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant forgeScriptRun.js
participant chain.js
User->>forgeScriptRun.js: Run script
forgeScriptRun.js->>chain.js: Call isVerifierEnabled(chainName)
chain.js-->>forgeScriptRun.js: Return verifier status
forgeScriptRun.js->>forgeScriptRun.js: Check isBroadcast && isVerifierEnabled
alt Broadcast and Verifier enabled
forgeScriptRun.js->>User: Proceed with verification
else Broadcast or Verifier disabled
forgeScriptRun.js->>User: Skip verification
end
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2659 +/- ##
===================================================
+ Coverage 39.79772% 39.80451% +0.00679%
===================================================
Files 180 180
Lines 14732 14732
Branches 80 80
===================================================
+ Hits 5863 5864 +1
Misses 8102 8102
+ Partials 767 766 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Deploying sanguine-fe with
|
Latest commit: |
c95ecbe
|
Status: | ✅ Deploy successful! |
Preview URL: | https://78db5992.sanguine-fe.pages.dev |
Branch Preview URL: | https://fix-sol-devops-verifier-none.sanguine-fe.pages.dev |
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.
Actionable comments posted: 1
Outside diff range and nitpick comments (1)
packages/solidity-devops/js/utils/chain.js (1)
Line range hint
58-67
: FunctionreadChainVerificationOptions
updated to usetryReadEnv
and handle multiple verifiers. The else clause can be omitted as suggested by static analysis.- default: - return '';
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- packages/solidity-devops/js/forgeScriptRun.js (2 hunks)
- packages/solidity-devops/js/utils/chain.js (5 hunks)
Additional context used
Biome
packages/solidity-devops/js/forgeScriptRun.js
[error] 2-2: A Node.js builtin module should be imported with the node: protocol.
[error] 61-64: Prefer for...of instead of forEach.
packages/solidity-devops/js/utils/chain.js
[error] 100-117: This else clause can be omitted because previous branches break early.
Additional comments not posted (4)
packages/solidity-devops/js/forgeScriptRun.js (2)
4-8
: Import statement updated to includeisVerifierEnabled
. This aligns with the new feature implementation.
49-49
: Conditional logic correctly updated to include verifier check. Ensure thatisVerifierEnabled
function is robust and handles all edge cases.packages/solidity-devops/js/utils/chain.js (2)
10-10
: Import statement updated to includetryReadEnv
. This change supports more robust environment variable handling.
156-156
: Module exports updated to includeisVerifierEnabled
, ensuring it's available for use in other modules.
/** | ||
* Checks if any verifier is enabled for the given chain. | ||
* | ||
* This function determines if a verifier (like Etherscan, Blockscout, or Sourcify) | ||
* is configured and enabled for the specified chain by checking if the verifier | ||
* settings are present in the environment variables. | ||
* | ||
* @param {string} chainName - The name of the chain to check for verifier settings | ||
* @returns {boolean} True if a verifier is enabled, false otherwise | ||
*/ | ||
const isVerifierEnabled = (chainName) => { | ||
return readChainVerificationOptions(chainName).length > 0 | ||
} |
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.
New function isVerifierEnabled
correctly implements the feature to check verifier status. Consider adding logging to trace which verifier is enabled or if none are.
+ logInfo(`Verifier status for ${chainName}: ${result}`);
Committable suggestion was skipped due low confidence.
Description
A clear and concise description of the features you're adding in this pull request.
Additional context
Add any other context about the problem you're solving.
Metadata
Summary by CodeRabbit
New Features
Improvements