Repository navigation
refactor(devcontainer): flatten shell commands - #1052
Conversation
✅ Deploy Preview for images-devsy-sh canceled.
|
✅ Deploy Preview for devsydev canceled.
|
|
Warning Review limit reached
Next review available in: 56 seconds Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 33 |
| Duplication | 0 |
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
Build entrypoint scripts by joining statements with '; ' instead of embedded newlines. Single-line scripts survive log lines and YAML string scalars intact (no more block-scalar '|' with blank lines). Preserves the '$$@' compose-YAML escaping required by docker compose's variable interpolation on the entrypoint round-trip; the prior draft of this refactor had regressed that to a single '$', which would break exec passthrough under compose. Signed-off-by: Samuel K <skevetter@pm.me>
3b82954 to
ea1c06c
Compare
|
Tick the box to add this pull request to the merge queue (same as
|
Why
Devcontainer entrypoint scripts were built as multi-line Go string literals joined
with
\n. In the generateddocker-compose.devcontainer.*.ymlfiles this forcesyaml.v3into block-scalar (|) style, so the entrypoint shows up as severallog lines (with stray blank lines) instead of one, and is more prone to
newline/formatting issues when passed through
sh -c.What
joinShellStatements(...string) string(pkg/devcontainer/single.go),joining shell statements with
;instead of embedded newlines.DefaultEntrypoint,GetStartScript(single.go), andbuildOverrideEntrypoint(compose_up.go) now build their scripts from anexplicit
[]stringof statements and flatten them with the helper, so thescripts — and therefore the compose YAML entrypoint field — render on a
single line.
"echo Container started"/trap "exit 0" 15//bin/shliterals into package constants (startScriptEchoStatement,startScriptTrapStatement,shShellPath) to avoid duplicating them acrosssingle.goandcompose_up.go."$$@"compose-escaping inbuildOverrideEntrypoint: thecompose CLI interpolates
$VAR/${VAR}when it parses the override file,so the literal
$@passthrough must stay doubled to survive thatround-trip (see
composeLabelEscaperin the same file). The result isbehavior-preserving, single-line output.
Tests
single_test.go:TestDefaultEntrypointSingleLine,TestGetStartScriptSingleLine,TestGetStartScriptPreservesStatementOrder,TestGetStartScriptOmitsEmptyStatementForNoCustomEntrypoints.compose_test.go:TestBuildOverrideEntrypointSingleLine,TestBuildOverrideEntrypointComposeEscapesExecPassthrough(regression testfor the
$$@escaping),TestBuildOverrideEntrypointAppendsUserEntrypoint,TestBuildOverrideEntrypointKeepsDefaultEntrypointReachable.Signed-off-by: Samuel K skevetter@pm.me