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

Release v4.0.9 #1918

Merged
merged 7 commits into from
Mar 11, 2025
Merged

Release v4.0.9 #1918

merged 7 commits into from
Mar 11, 2025

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Mar 11, 2025

PR-Codex overview

This PR focuses on updating dependencies and enhancing the dispute resolution process in the application. It includes a version upgrade for subgraph-status, updates to the version in kleros-app, and improvements to the dispute data handling in the context.

Detailed summary

  • Updated subgraph-status from ^1.2.3 to ^1.2.4 in web/package.json and yarn.lock.
  • Changed kleros-app version from 2.0.2 to 2.1.0 in kleros-app/package.json.
  • Added comments in web/src/components/Popup/index.tsx for clarity on popup behavior.
  • Introduced useNewDisputeContext in web/src/pages/Resolver/index.tsx to manage dispute data.
  • Refactored dispute data initialization in web/src/context/NewDisputeContext.tsx to use a function.
  • Updated resetDisputeData to set fresh data in web/src/context/NewDisputeContext.tsx.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • Chores
    • Upgraded platform dependencies and build configurations for improved stability and performance.
  • New Features
    • Enhanced wallet connection flow and voting interface with clearer tooltips.
    • Improved dispute resolution experience with automatic redirection after closing related popups.
  • Refactor
    • Streamlined dispute data initialization and reset, ensuring a consistent and fresh user experience.

@jaybuidl jaybuidl requested review from a team as code owners March 11, 2025 12:14
Copy link
Contributor

coderabbitai bot commented Mar 11, 2025

Walkthrough

This pull request includes extensive maintenance updates across multiple packages and workflows. It bumps version numbers and dependency versions (including Node.js and various packages), upgrades GitHub Actions in CI/CD configurations, and replaces Web3Modal with AppKit for wallet integration. In addition, it refactors dispute data handling and test assertions, applies minor syntax and styling improvements, and introduces new helper functions and styled components. Overall, the changes aim to improve dependency management, wallet configuration, dispute processing, and UI consistency.

Changes

File(s) Change Summary
kleros-app/package.json, web/package.json, contracts/package.json, kleros-sdk/package.json, package.json, subgraph/package.json Version bumps, updated Node.js specification, and dependency upgrades (including wagmi, subgraph-status, @logtail/pino, @reality.eth/reality-eth-lib, node-fetch, and fast-xml-parser); added new dependency elliptic.
web-devtools/package.json Upgraded Node and Yarn versions; updated dependencies (e.g., @wagmi/core, @yornaath/batshit, next, vanilla-jsoneditor, wagmi) and added new dependencies (@reown/appkit, @reown/appkit-adapter-wagmi).
.github/workflows/*.yml (codeql.yml, contracts-testing.yml, dependency-review.yml, deploy-bots.yml, deploy-subgraph.yml, scorecards.yml, sentry-release.yml, sonarcloud.yml) Upgraded GitHub Action versions (e.g., step-security/harden-runner, codeql-related actions, setup-node, cache, foundry-toolchain, ossf/scorecard-action, getsentry/action-release) to newer commits/versions across multiple workflow files.
Wallet & Network Integration (e.g., kleros-app/README.md, kleros-app/src/lib/atlas/providers/AtlasProvider.tsx, web-devtools/src/components/ConnectWallet/index.tsx, web/src/components/ConnectWallet/index.tsx, web-devtools/src/context/Web3Provider.tsx, web/src/context/Web3Provider.tsx, web/src/pages/GetPnk/WalletProvider.tsx, web-devtools/src/consts/chains.ts, web/src/consts/chains.ts, web-devtools/src/utils/getDisputeRequestParamsFromTxn.ts) Replaced Web3Modal hooks with AppKit alternatives (e.g., useConfig, useAppKit) and updated network types from Chain to AppKitNetwork; restructured wallet configuration using a new WagmiAdapter and adjusted adapter-based initialization across components.
Dispute Management & UI Updates (e.g., kleros-sdk/src/dataMappings/utils/populateTemplate.ts, kleros-sdk/test/getDispute.test.ts, web/src/utils/getVoteChoice.ts, web/src/context/NewDisputeContext.tsx, web/src/pages/Resolver/index.tsx, web/src/components/Popup/index.tsx, web/src/pages/Cases/CaseDetails/Voting/Classic/OptionsContainer.tsx, web/src/pages/Cases/CaseDetails/Voting/Classic/Reveal.tsx) Refactored dispute handling by adding helper function findAndUpdateRTA and updating test assertions; amended vote choice logic to handle a zero-value case; refactored dispute data initialization via a new getter function and auto-reset on component mount; enhanced UI through tooltips and new styled wrappers.
Other Code & Style Updates (e.g., web/src/consts/eip712-messages.ts, web/src/styles/global-style.ts) Minor syntax changes in object literal formatting and addition of new CSS rules for toast notifications to improve styling consistency.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UIComponent
    participant AppKit
    participant Blockchain
    User->>UIComponent: Click "Connect Wallet"
    UIComponent->>AppKit: Invoke useAppKit() open() method
    AppKit->>Blockchain: Initialize wallet connection via WagmiAdapter
    Blockchain-->>AppKit: Return connection details
    AppKit-->>UIComponent: Provide connection state and config
    UIComponent->>User: Wallet connected successfully
Loading
sequenceDiagram
    participant ResolverPage
    participant DisputeContext
    ResolverPage->>DisputeContext: Call resetDisputeData() on mount
    DisputeContext->>DisputeContext: Run getInitialDisputeData() to get fresh data
    DisputeContext-->>ResolverPage: Return reset dispute data
    ResolverPage->>User: Render UI with updated data
Loading

Possibly related PRs

Suggested labels

Type: Maintenance :construction:, dependencies, Type: Toolchain ⚒️

Suggested reviewers

  • alcercu

Poem

I'm a bunny with a skip and a hop,
Upgrading code, I just can’t stop!
Dependencies updated with a joyful beat,
Wallets connect in a brand new suite.
Disputes reset, and the UI's in sight,
CodeRabbit cheers deep into the night!
🐰✨ Hop on and commit – it's pure delight!

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit 62e7046
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-neo/deploys/67d0292c71b3c600089a6ca8
😎 Deploy Preview https://deploy-preview-1918--kleros-v2-neo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit 62e7046
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-testnet/deploys/67d0292c4f1423000888f146
😎 Deploy Preview https://deploy-preview-1918--kleros-v2-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for kleros-v2-testnet-devtools ready!

Name Link
🔨 Latest commit 62e7046
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-testnet-devtools/deploys/67d0292c56da79000824700f
😎 Deploy Preview https://deploy-preview-1918--kleros-v2-testnet-devtools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for kleros-v2-neo-devtools ready!

Name Link
🔨 Latest commit 62e7046
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-neo-devtools/deploys/67d0292c57afee0008d4ce7a
😎 Deploy Preview https://deploy-preview-1918--kleros-v2-neo-devtools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for kleros-v2-university ready!

Name Link
🔨 Latest commit 62e7046
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-university/deploys/67d0292c55d40d0008eb5477
😎 Deploy Preview https://deploy-preview-1918--kleros-v2-university.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jaybuidl jaybuidl merged commit 06b174a into master Mar 11, 2025
29 of 33 checks passed
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.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🧹 Nitpick comments (10)
.github/workflows/deploy-bots.yml (1)

10-14: Harden Runner and Egress Policy Note

The Harden Runner action now uses the updated version 4d991eb9b905ef189e4c376166672c3f2f230481 (v2.11.0). Please note the TODO on line 13 regarding switching the egress-policy from audit to block after several runs. If testing is conclusive, consider updating this setting to tighten security.

.github/workflows/sentry-release.yml (1)

47-51: Trailing Spaces in Node.js Setup Configuration

There are trailing spaces on the node-version configuration (line 49) and on the following blank line (line 51). Removing these extra spaces will clean up the YAML formatting and eliminate static analysis warnings.

-        node-version: 20.x   
+        node-version: 20.x
-  
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 49-49: trailing spaces

(trailing-spaces)


[error] 51-51: trailing spaces

(trailing-spaces)

.github/workflows/contracts-testing.yml (1)

53-57: Bump Setup Node.js Action to v4.2.0 and Remove Trailing Whitespaces
The Node.js setup action is updated to v4.2.0. Also, please remove any trailing spaces on the configuration lines to conform with YAML lint standards. For example, modify:

-         node-version: 20.x   
+         node-version: 20.x

and ensure the blank line (line 57) does not contain trailing spaces.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 55-55: trailing spaces

(trailing-spaces)


[error] 57-57: trailing spaces

(trailing-spaces)

web/src/styles/global-style.ts (1)

128-131: Toast notification positioning adjustment.

The added CSS rule for Toastify containers improves the toast notification placement with consistent padding. The !important flag is necessary here to override Toastify's default styles.

Consider documenting this toast customization in a comment to explain the positioning rationale, as it overrides the default behavior.

kleros-app/src/lib/atlas/providers/AtlasProvider.tsx (2)

56-56: Validate optional vs. required property.

If wagmiConfig is meant to be optional in your use case, consider marking it optional in the interface (e.g., wagmiConfig?: Config). Otherwise, ensuring it's always provided is fine.


60-61: Handle missing or invalid config scenario.

The calls to useAccount and useChainId rely on config.wagmiConfig. Consider implementing a fallback or error handling if wagmiConfig could be undefined or malformed.

web/src/pages/GetPnk/WalletProvider.tsx (3)

22-28: Validate correctness of the WagmiAdapter instantiation.

You're storing a single adapter instance in a ref. This is good for preserving state across renders, but make sure to handle re-initialization logic carefully if you ever need multiple network adapters or dynamic state updates.


36-47: Check for potential overlapping providers.

You’re calling createAppKit with a single adapter array, which is straightforward. If in the future you add multiple adapters, ensure no conflicts or race conditions when working with multiple providers.


50-51: Provide clarity on reconnect behavior.

Here, reconnectOnMount={false} ensures the app doesn't automatically re-initiate wallets. If you want users to stay connected across reloads, consider toggling it. Evaluate user preferences on repeated sign-in prompts.

web/src/pages/Cases/CaseDetails/Voting/Classic/OptionsContainer.tsx (1)

86-103: Consider using a more unique key.
Using answer.title as the key risks collisions.

Here’s how you could make the key more unique:

-<Tooltip text={answer.description} key={answer.title}>
+<Tooltip text={answer.description} key={answer.id}>
🛑 Comments failed to post (1)
web/src/consts/chains.ts (1)

9-9: 🛠️ Refactor suggestion

Verify usage of updated types for SUPPORTED_CHAINS and QUERY_CHAINS.

Switching from Record<number, Chain> to Record<number, AppKitNetwork> might cause subtle typing or runtime issues if other parts of the code assume a Chain type. Please cross-check all references to these constants.

Also applies to: 14-14

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