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

Fix/backend url #798

Merged
merged 15 commits into from
Feb 13, 2025
Merged

Fix/backend url #798

merged 15 commits into from
Feb 13, 2025

Conversation

fonstack
Copy link
Member

@fonstack fonstack commented Feb 12, 2025

Summary by CodeRabbit

  • Chores

    • Updated blockchain configuration with a new multisig wallet address.
    • Revised service URLs for both staging and production.
  • New Features

    • Enhanced vault processing logic to ensure proper registration for a specific vault.
    • Introduced a new user message indicating when a vault is inactive.
    • Improved navigation and status checks in vault actions for a better user experience.
  • Refactor

    • Removed the display of internal commit hash information from vault details.

Copy link
Contributor

coderabbitai bot commented Feb 12, 2025

Walkthrough

This pull request updates configuration and user interface elements across multiple parts of the project. The changes include updating blockchain configuration values, revising service URLs, enhancing vault-related functionalities (such as vault registration and UI messaging), and modifying navigation flows in vault claim actions. A new translation entry is also added, while one line retrieving a commit hash is commented out.

Changes

File(s) Change Summary
packages/shared/src/config/chains.ts Updated growthMultisig address for the oasis chain.
packages/web/src/constants/constants.ts Replaced URLs for both stagingServiceUrl and prodServiceUrl with new endpoints.
packages/web/src/hooks/subgraph/vaults/parser.ts,
packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultScopeSection/InScopeSection/InScopeSection.tsx,
packages/web/src/languages/en.json,
packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultSubmissionsSection/PublicSubmissionCard/components/SplitPointsActions.tsx
Vault-related changes: added logic to mark a specific (DAOSIS) vault as registered; commented out commit hash extraction in the UI; added a translation key for inactive vaults; and incorporated vault live checks with navigation in claim actions.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant SPA as SplitPointsActions Component
    participant R as Router

    U->>SPA: Click "Claim Issue"
    SPA->>SPA: Check vault live status (isVaultLive)
    alt Vault is not live
        SPA-->>U: Return failure message
    else Vault is live
        SPA->>SPA: Verify current user as claimer
        SPA->>R: Navigate to vulnerability page with vault ID
        R-->>SPA: Navigation complete
        SPA-->>U: Render updated page
    end
Loading
sequenceDiagram
    participant F as fixVaultsData Function
    participant V as Vault Object

    F->>V: Iterate over newVaults
    alt Vault address equals "0x8ef21ecb2af12ce9cc0e475eec25f90a9622b4f4"
        F->>V: Set property registered = true
    else 
        F->>V: No modification
    end
Loading

Possibly related PRs

Suggested reviewers

  • shayzluf

Poem

I'm a rabbit in the code, so spry and keen,
Hopping through updates with a joyful scene.
A multisig address and URLs renewed,
Vaults registered and paths so shrewd.
With checks in place and functions bright,
I hop away, coding into the night!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ef281c and a0faad2.

📒 Files selected for processing (6)
  • packages/shared/src/config/chains.ts (1 hunks)
  • packages/web/src/constants/constants.ts (1 hunks)
  • packages/web/src/hooks/subgraph/vaults/parser.ts (1 hunks)
  • packages/web/src/languages/en.json (1 hunks)
  • packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultScopeSection/InScopeSection/InScopeSection.tsx (1 hunks)
  • packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultSubmissionsSection/PublicSubmissionCard/components/SplitPointsActions.tsx (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (9)
packages/web/src/constants/constants.ts (1)

30-31: Verify the new service URLs are properly configured and accessible.

The migration from Heroku to custom domain looks good, maintaining the same API version path.

Let's verify the new endpoints are accessible and properly configured:

❌ Verification inconclusive

🏁 Script executed:

#!/bin/bash
# Description: Check if the new service URLs are accessible and properly configured with HTTPS

# Test staging URL
echo "Testing staging URL..."
curl -I https://dev.hats.finance/v1

# Test production URL
echo "Testing production URL..."
curl -I https://prod.hats.finance/v1

# Verify SSL certificates
echo "Verifying SSL certificates..."
echo | openssl s_client -connect dev.hats.finance:443 2>/dev/null | openssl x509 -noout -dates
echo | openssl s_client -connect prod.hats.finance:443 2>/dev/null | openssl x509 -noout -dates

Length of output: 3306


Action Required: Verify Endpoint Response Expectations

The endpoints are reachable via HTTPS but both return an HTTP 404 response. This suggests that while the custom domain configuration is in place (and the migration from Heroku seems reflected), the base /v1 route isn’t returning an expected successful response—unless a 404 is the intended outcome for these base paths. Additionally, the SSL certificate verification step did not run due to the absence of the openssl command in the testing environment.

  • Confirm whether a 404 response on a GET request to /v1 is expected or if a different path/HTTP method should be used for health checks.
  • Verify the intended routing and behavior of the API endpoints under the new URLs.
packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultSubmissionsSection/PublicSubmissionCard/components/SplitPointsActions.tsx (4)

9-9: LGTM! Required imports for navigation functionality.

The imports are correctly added for routing capabilities.

Also applies to: 13-13


42-42: LGTM! Added vault status check.

The vault status check is correctly implemented using the dateStatus property.


77-77: LGTM! Proper validation for vault status.

The vault status check is correctly integrated into the action validation logic.


146-149: LGTM! Enhanced navigation for claimed issues.

The navigation logic correctly redirects users to the vulnerability page with the appropriate vault ID.

packages/shared/src/config/chains.ts (1)

186-186: Verify the new growth multisig address.

The multisig address has been updated for the oasis chain. This is a sensitive change that requires verification.

Let's verify the new multisig address:

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Verify the new growth multisig address on oasis chain

# Search for any other occurrences of the old or new address
echo "Searching for other occurrences of the addresses..."
rg -i "0xf2935671015c896D5E1fE4c97caF111F5eEe2b3c\|0x64792e23DfeDA2d153CF058507d71672aC1d09A0"

# Search for any deployment or migration scripts that might reference these addresses
echo "Searching for deployment/migration scripts..."
fd -t f -e js -e ts "deploy|migrate"

Length of output: 349


Multisig address update verified

The search shows that the new address is only found in the updated location with no conflicting references elsewhere in the codebase. No extraneous occurrences were found in deployment or migration scripts.

packages/web/src/hooks/subgraph/vaults/parser.ts (1)

119-121: LGTM! Added DAOSIS vault override.

The implementation follows the established pattern for vault overrides and correctly sets the registration status.

packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultScopeSection/InScopeSection/InScopeSection.tsx (1)

81-81: Verify the impact of removing the commit hash.

The commit hash retrieval for the main repository has been commented out. This could affect version tracking and repository identification.

Let's check if the commit hash is still needed or used elsewhere in the codebase:

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Check if commitHash is used in repository links or version tracking

# Search for commitHash usage in repository links
rg -A 3 'commitHash.*tree|commitHash.*compare'

# Search for commitHash in repository information handling
ast-grep --pattern 'commitHash'

Length of output: 248


Subject: Confirmed Removal Impact for Commit Hash Retrieval

After reviewing the commit hash usage, we found that the only direct reference is the utility function checkCommitHash in packages/web/src/utils/yup.utils.ts. There are no indications that the commit hash retrieved in VaultDetailsPage is required for repository links or version tracking elsewhere in the codebase.

  • commitHash is validated via checkCommitHash, but its source from the main repository was not used in any linking or tracking functionality.
  • The removal (commenting out) in InScopeSection.tsx appears isolated to that component without affecting global functionality.

Thus, within the current scope, removing the commit hash retrieval in VaultDetailsPage does not show any negative impact.

packages/web/src/languages/en.json (1)

755-755: LGTM! New translation entry added.

The new translation entry for vault status is properly formatted and follows the existing structure.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ Share
🪧 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. (Beta)
  • @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 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

Deploying dapp with  Cloudflare Pages  Cloudflare Pages

Latest commit: a0faad2
Status: ✅  Deploy successful!
Preview URL: https://a9c3d624.dapp-a9y.pages.dev
Branch Preview URL: https://fix-backend-url.dapp-a9y.pages.dev

View logs

@shayzluf shayzluf merged commit 1577c7b into develop Feb 13, 2025
4 checks passed
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