-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Qbd direct run and setup env changes #1051
Conversation
WalkthroughThe changes in this pull request involve modifications to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR description must contain a link to a ClickUp (case-insensitive) |
1 similar comment
PR description must contain a link to a ClickUp (case-insensitive) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
run.sh (2)
11-11
: LGTM! Consider adding input validation.The new QBD Direct API URL substitution follows the established pattern correctly. However, consider adding input validation for environment variables to prevent potential issues with special characters.
Example validation function:
validate_env_var() { local var_name="$1" local var_value="$2" if [[ "$var_value" =~ [^a-zA-Z0-9:/_.-] ]]; then echo "Error: $var_name contains invalid characters" >&2 exit 1 fi } # Usage before substitutions validate_env_var "QBD_DIRECT_API_URL" "$QBD_DIRECT_API_URL"🧰 Tools
🪛 Shellcheck
[warning] 11-11: Quotes/backslashes in this variable will not be respected.
(SC2090)
Line range hint
1-47
: Consider refactoring repetitive sed commands.The script has numerous similar sed commands which could be simplified using a helper function to improve maintainability.
Here's a suggested refactor:
replace_placeholder() { local file="$1" local placeholder="$2" local value="$3" sed -i $SED_EXTRA_ARGS "s?{{$placeholder}}?${value}?g" "$file" } # Usage example: for f in /usr/share/nginx/html/*; do echo "Substituting Environment variables and other stuff in $f ..." replace_placeholder "$f" "QBD_DIRECT_API_URL" "${QBD_DIRECT_API_URL}" replace_placeholder "$f" "QBD_API_URL" "${QBD_API_URL}" # ... other replacements doneThis refactor:
- Reduces code duplication
- Makes the script more maintainable
- Centralizes the substitution logic
- Makes it easier to add new replacements
🧰 Tools
🪛 Shellcheck
[warning] 9-9: Quotes/backslashes in this variable will not be respected.
(SC2090)
[warning] 10-10: Quotes/backslashes in this variable will not be respected.
(SC2090)
[warning] 11-11: Quotes/backslashes in this variable will not be respected.
(SC2090)
[warning] 12-12: Quotes/backslashes in this variable will not be respected.
(SC2090)
[warning] 13-13: Quotes/backslashes in this variable will not be respected.
(SC2090)
[warning] 14-14: Quotes/backslashes in this variable will not be respected.
(SC2090)
scripts/setup_env.js (1)
7-9
: Consider documenting API URL purposes.With the addition of
qbd_direct_api_url
alongside existingqbd_api_url
, it would be helpful to document the distinct purposes and use cases for each URL. This will help future maintainers understand when to use each endpoint.Consider adding comments in the configuration or updating the project's documentation to explain:
- The purpose of each QBD API URL
- When each endpoint should be used
- Any differences in functionality or behavior
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- run.sh (1 hunks)
- scripts/setup_env.js (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-export-settings/qbd-direct-export-settings.component.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-export-settings/qbd-direct-export-settings.component.ts
🧰 Additional context used
🪛 Shellcheck
run.sh
[warning] 11-11: Quotes/backslashes in this variable will not be respected.
(SC2090)
🔇 Additional comments (1)
scripts/setup_env.js (1)
8-8
: LGTM! Verify placeholder substitution.The addition follows the established configuration pattern and is positioned logically near related QBD configurations.
Let's verify that the placeholder is properly handled in the run script:
✅ Verification successful
Placeholder substitution verified and properly handled
The
{{QBD_DIRECT_API_URL}}
placeholder is correctly handled inrun.sh
with proper substitution using the environment variable${QBD_DIRECT_API_URL}
. The implementation follows the same pattern as other API URL configurations in the system.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if the placeholder is properly handled in run.sh rg -l "{{QBD_DIRECT_API_URL}}" | grep -i "run.sh"Length of output: 147
Script:
#!/bin/bash # Let's try a different approach to search for the placeholder rg -F "{{QBD_DIRECT_API_URL}}" -l # Also check run.sh files in the repository fd "run.sh$" # And let's see the content of run.sh files to verify placeholder substitution fd "run.sh$" -x cat {}Length of output: 3810
@DhaaraniCIT I've added this #1052 here, pls check if all changes from here are present there, re-open PR if required |
Description
feat: Qbd direct run and setup env changes
Clickup
Please add link here
Summary by CodeRabbit
New Features
qbd_direct_api_url
for enhanced API integration.QBD_DIRECT_API_URL
variable.Bug Fixes
These updates improve configuration options and prepare the application for future enhancements.