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

Updated Next versions and added lint:workspace #4035

Merged
merged 5 commits into from
Jan 27, 2025
Merged

Updated Next versions and added lint:workspace #4035

merged 5 commits into from
Jan 27, 2025

Conversation

yury-dubinin
Copy link
Contributor

@yury-dubinin yury-dubinin commented Jan 27, 2025

What is the purpose of the change:

  • Updated Next versions
  • Updated tanstack version
  • Added lint:workspace job

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
osmosis-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 2:52pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
osmosis-frontend-datadog ⬜️ Ignored (Inspect) Visit Preview Jan 27, 2025 2:52pm
osmosis-frontend-dev ⬜️ Ignored (Inspect) Visit Preview Jan 27, 2025 2:52pm
osmosis-frontend-edgenet ⬜️ Ignored (Inspect) Jan 27, 2025 2:52pm
osmosis-testnet ⬜️ Ignored (Inspect) Visit Preview Jan 27, 2025 2:52pm

@yury-dubinin yury-dubinin changed the title Updated Next versions Updated Next versions and added lint:workspace Jan 27, 2025
Copy link
Contributor

coderabbitai bot commented Jan 27, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/web/pages/api/broadcast-transaction.ts

Oops! Something went wrong! :(

ESLint: 8.50.0

ESLint couldn't find the config "next/core-web-vitals" to extend from. Please check that the name of the config is correct.

The config "next/core-web-vitals" was referenced from the config file in "/packages/web/.eslintrc.json".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

Walkthrough

This pull request focuses on standardizing code formatting across multiple end-to-end (e2e) test files and a page object. The changes primarily involve converting string literals from double quotes to single quotes, removing unnecessary semicolons, and in some cases, prefixing certain variables with underscores. These modifications are purely stylistic and do not alter the functionality of the code, maintaining the existing logic and control flow of the test suites and page objects.

Changes

File Change Summary
packages/e2e/pages/trade-page.ts Formatting changes: single quotes, semicolon removal
packages/e2e/tests/*.spec.ts Consistent formatting across multiple test files:
- Converted double quotes to single quotes
- Removed semicolons
- Prefixed some variables with underscores
- Modified regex in portfolio.wallet.spec.ts to broaden matching criteria

Possibly related PRs

Suggested reviewers

  • JoseRFelix
  • DavideSegullo

📜 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 206712a and 048b778.

📒 Files selected for processing (1)
  • packages/web/pages/api/broadcast-transaction.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/web/pages/api/broadcast-transaction.ts
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: preview-swap-osmo-tests
  • GitHub Check: preview-claim-tests
  • GitHub Check: preview-pools-and-select-pair-tests
  • GitHub Check: preview-portfolio-trx-tests
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Summary

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
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

🔭 Outside diff range comments (1)
packages/e2e/tests/portfolio.wallet.spec.ts (1)

Line range hint 13-13: Improve private key handling.

Using a fallback value 'pk' for the private key could be dangerous if tests accidentally run without proper environment setup. Consider throwing an error if the environment variable is not set.

-  const privateKey = process.env.PRIVATE_KEY ?? 'pk'
+  const privateKey = process.env.PRIVATE_KEY ?? (() => {
+    throw new Error('PRIVATE_KEY environment variable must be set for tests')
+  })()
🧹 Nitpick comments (3)
packages/e2e/tests/portfolio.wallet.spec.ts (3)

Line range hint 54-54: Add meaningful explanations for biome-ignore comments.

The biome-ignore lint/complexity/noForEach comments lack proper explanations. While using forEach for test generation is valid here, document why you're choosing to ignore this lint rule.

-  // biome-ignore lint/complexity/noForEach: <explanation>
+  // biome-ignore lint/complexity/noForEach: Using forEach to generate similar test cases is a common pattern in Playwright

Also applies to: 77-77


Line range hint 67-67: Rename misleading variable.

The variable osmoBalance is used for all token balances, not just OSMO. This could be confusing for maintainers.

-      const osmoBalance = await portfolioPage.getBalanceFor(name)
-      expect(osmoBalance).toMatch(dollarBalanceRegEx)
+      const tokenBalance = await portfolioPage.getBalanceFor(name)
+      expect(tokenBalance).toMatch(dollarBalanceRegEx)

Also applies to: 90-90


Line range hint 28-41: Consider encapsulating wallet setup logic.

The wallet setup process involves multiple steps that could be encapsulated into a helper method for better maintainability and reuse across test files.

Example helper method:

async function setupTestWallet(context: BrowserContext, privateKey: string) {
  const page = context.pages()[1]
  const walletPage = new WalletPage(page)
  await walletPage.importWalletWithPrivateKey(privateKey)
  await walletPage.setWalletNameAndPassword('Test Portfolio')
  await walletPage.selectChainsAndSave()
  await walletPage.finish()
  return context.pages()[0]
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a0f2cc6 and 206712a.

📒 Files selected for processing (1)
  • packages/e2e/tests/portfolio.wallet.spec.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: wait-for-deployment
  • GitHub Check: test (20.x, web)
  • GitHub Check: Summary

@@ -16,7 +16,7 @@ test.describe('Test Portfolio feature', () => {
let context: BrowserContext
const privateKey = process.env.PRIVATE_KEY ?? 'pk'
let portfolioPage: PortfolioPage
const dollarBalanceRegEx = /\$\d+/
const dollarBalanceRegEx = /\d+/
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider using a more specific regular expression pattern.

The current pattern /\d+/ is too permissive and could match any sequence of digits, potentially leading to false positives in balance verification. Consider using a more specific pattern that:

  1. Validates the currency symbol (if expected)
  2. Handles decimal points and cents
  3. Accounts for thousand separators
-  const dollarBalanceRegEx = /\d+/
+  const dollarBalanceRegEx = /\$\d{1,3}(,\d{3})*(\.\d{2})?/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const dollarBalanceRegEx = /\d+/
const dollarBalanceRegEx = /\$\d{1,3}(,\d{3})*(\.\d{2})?/

@yury-dubinin yury-dubinin merged commit b1be6c7 into stage Jan 27, 2025
37 checks passed
@yury-dubinin yury-dubinin deleted the yury/fix branch January 27, 2025 15:04
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