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

Last changes before 1.0.0 #525

Merged
merged 2 commits into from
Jan 28, 2025
Merged

Last changes before 1.0.0 #525

merged 2 commits into from
Jan 28, 2025

Conversation

erenfn
Copy link
Collaborator

@erenfn erenfn commented Jan 27, 2025

As title

  • Solved [vite] hmr update /public/svg/utilityIcons.jsx Files in the public directory are served at the root path. Instead of /public/svg/utilityIcons.jsx, use /svg/utilityIcons.jsx.
  • Added allowed hosts to vite config as in staging server I got Blocked request. This host ("onboarding-demo.bluewavelabs.ca") is not allowed. To allow this host, add "onboarding-demo.bluewavelabs.ca" to preview.allowedHosts in vite.config.js.
  • Added default agent base url

@erenfn erenfn requested a review from swoopertr January 27, 2025 23:52
Copy link
Contributor

coderabbitai bot commented Jan 27, 2025

Walkthrough

This pull request encompasses modifications across multiple files, focusing on environment variable naming, URL configurations, and asset path updates. The changes primarily involve renaming API_BASE_URL to BASE_URL, updating service methods for team creation, and adjusting import paths for icons and SVG assets. These modifications appear to streamline configuration and improve project structure without fundamentally altering core functionality.

Changes

File Change Summary
README.md Environment variable renamed from API_BASE_URL to BASE_URL
backend/src/controllers/team.controller.js Updated method call from createTeam() to createTeamWithAgentUrl()
backend/src/service/team.service.js Added new createTeamWithAgentUrl() method
frontend/src/components/Button/GoogleSignInButton/GoogleSignInButton.jsx Updated SVG import path
frontend/src/templates/GuideMainPageTemplate/...ListItem/ListItem.jsx Modified utility icons import path
frontend/src/utils/constants.js Redefined BASE_URL and API_BASE_URL constants
frontend/vite.config.js Added BASE_URL import and allowedHosts configuration

Possibly Related PRs

Suggested Reviewers

  • swoopertr
  • gorkem-bwl
✨ 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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

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

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

🧹 Nitpick comments (4)
backend/src/service/team.service.js (2)

31-32: Error handling's looking a bit weak in the knees!

The error message doesn't include the original error details, making debugging harder.

- throw new Error("Failed to create team");
+ throw new Error(`Failed to create team: ${err.message}`);

36-36: Extra blank line's making me lose myself!

Remove the extra blank line to maintain consistent spacing.

frontend/src/utils/constants.js (1)

7-8: Consider using environment variables for BASE_URL

Instead of hardcoding URLs and toggling them through comments, consider using environment variables. This would make the configuration more maintainable and less error-prone.

-export const BASE_URL = 'localhost:3000';
-export const API_BASE_URL = `http://${BASE_URL}/api/`;
-
-//staging environment
-// export const BASE_URL = 'onboarding-demo.bluewavelabs.ca';
-// export const API_BASE_URL = `https://${BASE_URL}/api/`;
+export const BASE_URL = process.env.VITE_BASE_URL || 'localhost:3000';
+export const API_BASE_URL = `${process.env.NODE_ENV === 'production' ? 'https' : 'http'}://${BASE_URL}/api/`;
README.md (1)

141-144: Documentation needs some sauce!

A few improvements needed in the environment variables section:

  1. Add language specification to the code block
  2. Provide more context about the BASE_URL usage
 2. Backend Url
 
-```
+```env
 BASE_URL - Backend url

Also, consider adding more details about the BASE_URL:
```diff
-BASE_URL - Backend url
+BASE_URL - Backend url (e.g., 'localhost:3000' for local development or 'your-domain.com' for production)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

143-143: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f4be58 and 9fec4b0.

⛔ Files ignored due to path filters (2)
  • frontend/dist/index.html is excluded by !**/dist/**
  • frontend/src/assets/icons/google-icon.svg is excluded by !**/*.svg
📒 Files selected for processing (7)
  • README.md (1 hunks)
  • backend/src/controllers/team.controller.js (1 hunks)
  • backend/src/service/team.service.js (1 hunks)
  • frontend/src/components/Button/GoogleSignInButton/GoogleSignInButton.jsx (1 hunks)
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx (1 hunks)
  • frontend/src/utils/constants.js (1 hunks)
  • frontend/vite.config.js (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • frontend/src/components/Button/GoogleSignInButton/GoogleSignInButton.jsx
  • frontend/src/templates/GuideMainPageTemplate/GuideMainPageComponents/List/ListItem/ListItem.jsx
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

143-143: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (22.x)
🔇 Additional comments (1)
frontend/src/utils/constants.js (1)

3-4: Yo! Security alert: Local environment using HTTP protocol

The local environment is using non-secure HTTP protocol. While this might be fine for local development, we should ensure this doesn't accidentally get deployed.

Let's check if there are any production builds using this configuration:

@erenfn erenfn mentioned this pull request Jan 28, 2025
@erenfn erenfn merged commit e3cf460 into develop Jan 28, 2025
2 checks passed
@erenfn erenfn mentioned this pull request Jan 28, 2025
@erenfn erenfn deleted the add-allowed-hosts branch March 5, 2025 21:07
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