fix(sdl): preserve service command/args on import instead of forcing sh -c - #3290
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughRefactors SDL command representation from automatic ChangesSDL Command Tokenization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3290 +/- ##
==========================================
- Coverage 68.11% 66.69% -1.43%
==========================================
Files 1073 985 -88
Lines 26272 24063 -2209
Branches 6283 5848 -435
==========================================
- Hits 17896 16048 -1848
+ Misses 7334 7004 -330
+ Partials 1042 1011 -31
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
63310f0 to
80959ee
Compare
Why
The simple SDL builder mangles a service's
command/argson import → preview → deploy. When re-serializing the Command field it forces a hardcodedsh -cwrapper, so any command that isn't exactlysh -cis corrupted. Reported by a user: importingand clicking Preview rewrites it to
command: [sh, -c, "bash\n-lc\n"]— the originalbash -lcis shoved into the script slot of ansh -cwrapper.The round-trip was actually broken for every command shape, not just the reported one:
command:[bash,-lc]+args:[script][sh,-c,"bash\n-lc\n"]+[script]command:[sh,-c]+args:[script]command:[sh,-c,script](no args)args:[""]Since the generated SDL is what gets deployed (form →
generateSdl→ manifest → chain), this is a correctness bug, not just cosmetic.What
Stop forcing a shell wrapper — the Command field is now treated as the literal SDL
commandarray, one token per line, and preserved verbatim.parseSvcCommand(sdlImport.ts): no longer strips a leadingsh -c; all command elements join by newline.buildCommand(sdlGenerator.ts): always returnsstring[]by splitting on newline (trim + drop empties); nosh -cforcing.args:when one is present (fixes the bogusargs: [""]).CommandFormModal.tsx: Command field placeholder updated to teach the one-token-per-line convention.buildCommand/parseSvcCommandspecs for the new behavior and added round-trip coverage proving all shapes survive (including the two that were silently broken).Example SDL to test
Import the following, click Preview, and confirm both services'
command/argsare unchanged:Summary by CodeRabbit
Improvements
Bug Fixes