Fix shell script parameter duplication and improve consistency#2622
Fix shell script parameter duplication and improve consistency#2622
Conversation
- server.sh: Remove duplicate argument expansion ($* and "$@") - console.sh: Add ARCADEDB_OPTS_MEMORY initialization for consistency - restore.sh: Fix ARCADEDB_HOME check (console.sh -> restore.sh) - restore.sh: Add ARCADEDB_OPTS_MEMORY initialization - restore.sh: Fix argument expansion ($* -> "$@") Co-authored-by: lvca <[email protected]>
carlos-rodrigues-8x8
left a comment
There was a problem hiding this comment.
Seems pretty good. I'm just wondering if we need $ARGS on scripts.
|
No sure why we have $ARGS, I guess you can use it from docker or managed environment to pass arguments easily? |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
We can use it in any context, docker, k8s, baremetal, my point is if we already have |
* Initial plan * Fix shell script parameter duplication and improve consistency - server.sh: Remove duplicate argument expansion ($* and "$@") - console.sh: Add ARCADEDB_OPTS_MEMORY initialization for consistency - restore.sh: Fix ARCADEDB_HOME check (console.sh -> restore.sh) - restore.sh: Add ARCADEDB_OPTS_MEMORY initialization - restore.sh: Fix argument expansion ($* -> "$@") Co-authored-by: lvca <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: lvca <[email protected]> (cherry picked from commit 0c1618a)
Problem
The
server.shbootup script was duplicating Java command-line arguments, and there were inconsistencies across the shell scripts that could lead to service misconfiguration.Critical Issue: Duplicate Arguments in server.sh
The
server.shscript was using both$*and"$@"together on line 103, causing all command-line arguments to be duplicated when passed to the Java process:Solution
1. Fixed server.sh argument duplication (Line 103)
$*parameter expansion"$@"to pass arguments once2. Added ARCADEDB_OPTS_MEMORY initialization to console.sh
3. Fixed restore.sh ARCADEDB_HOME validation (Line 35)
bin/console.shtobin/restore.sh4. Added ARCADEDB_OPTS_MEMORY initialization to restore.sh
5. Fixed restore.sh argument expansion (Line 70)
$*to"$@"for proper argument handlingImpact
Before:
After:
Testing
All scripts have been validated:
"$@"Backward Compatibility
✅ 100% backward compatible - These changes fix bugs and improve robustness without breaking existing functionality:
No migration, configuration changes, or special deployment steps required.
Files Changed
package/src/main/scripts/server.sh- Fixed duplicate argument expansionpackage/src/main/scripts/console.sh- Added ARCADEDB_OPTS_MEMORY initializationpackage/src/main/scripts/restore.sh- Fixed ARCADEDB_HOME check, added variable initialization, fixed argument expansionTotal: 3 files changed, 12 insertions(+), 3 deletions(-)
Original prompt
Fixes #2621
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.