Skip to content

Refactor: Convert all relative bot imports to use project aliases #1007

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

Open
PeterDaveHello opened this issue Apr 18, 2025 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@PeterDaveHello
Copy link
Collaborator

PeterDaveHello commented Apr 18, 2025

Suggestion: Use the project's alias (@/bots/openai/...) instead of relative paths to import new bot modules for consistency with other imports. [general, importance: 5]

-import OpenAIAPI41Bot from "./openai/OpenAIAPI41Bot";
-import OpenAIAPI41MiniBot from "./openai/OpenAIAPI41MiniBot";
-import OpenAIAPI41NanoBot from "./openai/OpenAIAPI41NanoBot";
+import OpenAIAPI41Bot from "@/bots/openai/OpenAIAPI41Bot";
+import OpenAIAPI41MiniBot from "@/bots/openai/OpenAIAPI41MiniBot";
+import OpenAIAPI41NanoBot from "@/bots/openai/OpenAIAPI41NanoBot";

Originally posted by @PeterBot in #1005 (comment)

@PeterDaveHello
Copy link
Collaborator Author

@coderabbitai suggest proper issue title please

Copy link
Contributor

coderabbitai bot commented Apr 18, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch details about the issue
gh issue view 1007 --repo ai-shifu/ChatALL

Length of output: 1017


@PeterDaveHello Here are some suggested improved titles for the issue:

  1. "Replace relative paths with project aliases (@/bots/openai/...) in bot module imports"
  2. "Standardize OpenAI bot imports to use project aliases"
  3. "Use project aliases instead of relative paths for OpenAI bot imports"
  4. "Refactor: Convert relative imports to project aliases for OpenAI bots"
  5. "Improve code consistency: Use project aliases for OpenAI bot imports"

The third option provides the best balance of clarity and conciseness while focusing on the action needed.

@PeterDaveHello
Copy link
Collaborator Author

@coderabbitai I think it's not just "OpenAI" bots but all bots in src/bots/index.js

Copy link
Contributor

coderabbitai bot commented Apr 18, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch details about the issue to understand the problem scope
gh issue view 1007 --repo ai-shifu/ChatALL

# Check if the bots/index.js file exists and examine its content
find . -name "index.js" -path "*/bots/*" | xargs cat

Length of output: 10898


@PeterDaveHello You're absolutely right! After examining the code in bots/index.js, I can see that many bots beyond just OpenAI ones are using relative paths. Here are updated title suggestions:

  1. "Standardize all bot imports to use project aliases (@/bots/...) instead of relative paths"
  2. "Replace relative paths with project aliases (@/bots/...) for all bot imports in bots/index.js"
  3. "Improve code consistency: Convert all relative bot imports to use project aliases"
  4. "Refactor: Use project aliases for all bot imports in bots/index.js"
  5. "Convert all bot imports to follow the project alias pattern (@/bots/...) for consistency"

The second option provides good clarity about both the issue and its location while maintaining reasonable length.

(^◡^)っ


✏️ Learnings added
Learnt from: PeterDaveHello
URL: https://github.com/ai-shifu/ChatALL/issues/1007

Timestamp: 2025-04-18T21:28:09.581Z
Learning: In the ChatALL project, the preferred import style is to use project aliases (e.g., "@/bots/openai/OpenAIBot") instead of relative paths (e.g., "./openai/OpenAIBot") for consistency.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@PeterDaveHello PeterDaveHello changed the title **Suggestion:** Use the project's alias (@/bots/openai/...) instead of relative paths to import new bot modules for consistency with other imports. [general, importance: 5] Improve code consistency: Convert all relative bot imports to use project aliases Apr 18, 2025
@PeterDaveHello PeterDaveHello added the enhancement New feature or request label Apr 18, 2025
@PeterDaveHello PeterDaveHello changed the title Improve code consistency: Convert all relative bot imports to use project aliases Refactor: Convert all relative bot imports to use project aliases Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant