Skip to content

chore(deps): mvdan.cc/sh/v3 (patch → v3.13.1) #197

Open
gh-worker-campaigns-3e9aa4[bot] wants to merge 10 commits intomainfrom
engraver-auto-version-upgrade/minorpatch/go/3-1776949180
Open

chore(deps): mvdan.cc/sh/v3 (patch → v3.13.1) #197
gh-worker-campaigns-3e9aa4[bot] wants to merge 10 commits intomainfrom
engraver-auto-version-upgrade/minorpatch/go/3-1776949180

Conversation

@gh-worker-campaigns-3e9aa4
Copy link
Copy Markdown
Contributor

@gh-worker-campaigns-3e9aa4 gh-worker-campaigns-3e9aa4 Bot commented Apr 23, 2026

Summary: Dependency update — 1 package upgraded (patch changes only)

Manifests changed:

  • . (go)

✅ Action Required: Please review the changes below. If they look good, approve and merge this PR.


Updates

Package From To Type Dep Type Vulnerabilities Fixed
mvdan.cc/sh/v3 v3.13.0 v3.13.1 patch Direct -

Packages marked with "-" are updated due to dependency constraints.


Compatibility note

This PR also includes a small rshell compatibility shim in interp/runner_expand.go because the mvdan.cc/sh/v3 patch upgrade changed expand.Fields behavior for escaped left braces.

With v3.13.0, rshell matched bash for inputs such as:

echo \{
printf '<%s>\n' \{a,b}

After upgrading to v3.13.1, escaped { could be treated as an unmatched brace by syntax.SplitBraces, causing the backslash to be preserved or brace expansion to run when bash would treat the brace as quoted. The shim preserves bash-compatible behavior by protecting odd-backslash-escaped left braces before delegating to expand.Fields.

Coverage added:

  • Unit tests in interp/runner_expand_test.go
  • Bash-compared scenario coverage in tests/scenarios/shell/var_expand/quoting/escaped_left_brace.yaml

Review Checklist

Standard review:

  • Review changes for compatibility with your code
  • Check for breaking changes in release notes
  • Run tests locally or wait for CI
  • Approve and merge this PR

Update Mode: Routine Update

🤖 Generated by DataDog Automated Dependency Management System

@gh-worker-campaigns-3e9aa4
Copy link
Copy Markdown
Contributor Author

gh-worker-campaigns-3e9aa4 Bot commented Apr 28, 2026

Auto-rebase complete

Branch is up to date with main — rebased onto 4a6a947.


Auto-Rebase · Add no-auto-rebase to opt out

@dd-octo-sts-03ec73 dd-octo-sts-03ec73 Bot force-pushed the engraver-auto-version-upgrade/minorpatch/go/3-1776949180 branch from 272844f to 55dfc10 Compare April 28, 2026 07:16
Co-authored-by: dd-octo-sts-03ec73[bot] <256648721+dd-octo-sts-03ec73[bot]@users.noreply.github.com>
@dd-octo-sts-26fcfa dd-octo-sts-26fcfa Bot force-pushed the engraver-auto-version-upgrade/minorpatch/go/3-1776949180 branch from 55dfc10 to 1c5380e Compare April 28, 2026 07:23
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AlexandreYang AlexandreYang self-requested a review April 28, 2026 07:29
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AlexandreYang AlexandreYang marked this pull request as ready for review April 28, 2026 07:42
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f17690cf66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread interp/runner_expand.go Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0c3334880

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread interp/runner_expand.go Outdated
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21df8d6aa4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread interp/runner_expand.go Outdated
AlexandreYang and others added 2 commits April 28, 2026 23:55
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@AlexandreYang
Copy link
Copy Markdown
Member

@codex review this PR

Copy link
Copy Markdown
Member

@AlexandreYang AlexandreYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Reviewed the mvdan.cc/sh bump and the escaped-left-brace compatibility workaround. Overall assessment: needs fixes.

# Priority File Finding
1 P1 Badge interp/runner_expand.go:406 Escaped commas/right braces inside the brace form are treated as syntax, producing output that differs from bash

Coverage

Code path Scenario test Go test Status
escaped left brace disables expansion tests/scenarios/shell/var_expand/quoting/escaped_left_brace.yaml interp/runner_expand_test.go Covered
escaped comma/right brace inside \{{...}} forms Missing

Comment thread interp/runner_expand.go
@AlexandreYang
Copy link
Copy Markdown
Member

Iteration 1 self-review result: P0=0, P1=1, P2=0, P3=0. Summary: found a bash-compatibility regression in the escaped-left-brace workaround when commas or right braces inside the brace candidate are themselves backslash-escaped; requested changes with an inline comment.

Preserve bash quote state for escaped brace metacharacters before mvdan SplitBraces runs, including commas, right braces, and sequence dots. Add regression coverage for escaped delimiters and sequence cases.
@AlexandreYang
Copy link
Copy Markdown
Member

@codex review this PR

Copy link
Copy Markdown
Member

@AlexandreYang AlexandreYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Reviewed the updated escaped brace metacharacter handling after inspecting mvdan/sh master. Overall assessment: safe to merge.

No P0/P1/P2/P3 findings. The workaround now aligns with mvdan/expand's pipeline (FieldsSeq calls syntax.SplitBraces before wordFields quote removal) by quoting backslash-escaped brace metacharacters before SplitBraces, while preserving valid unescaped nested/sequence brace expansions. Regression coverage was added for escaped commas, right braces, sequence dots, and bash comparison passes locally.

Coverage

Code path Scenario test Go test Status
escaped left brace disables expansion tests/scenarios/shell/var_expand/quoting/escaped_left_brace.yaml interp/runner_expand_test.go Covered
escaped delimiter after escaped left brace tests/scenarios/shell/var_expand/quoting/escaped_left_brace_composite.yaml interp/runner_expand_test.go Covered
valid sequence after escaped left brace tests/scenarios/shell/var_expand/quoting/escaped_left_brace_composite.yaml interp/runner_expand_test.go Covered
escaped comma/right brace/dot in regular brace expansion interp/runner_expand_test.go Covered

@AlexandreYang
Copy link
Copy Markdown
Member

Iteration 2 self-review result: P0=0, P1=0, P2=0, P3=0. Summary: reviewed the updated implementation against mvdan/sh master (FieldsSeq/SplitBraces/wordFields) and bash behavior; no findings.

Use strings.Index, which is already allowed for interp, instead of introducing strings.Contains in the escaped brace preprocessor.
@AlexandreYang
Copy link
Copy Markdown
Member

@codex review this PR

Copy link
Copy Markdown
Member

@AlexandreYang AlexandreYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Reviewed the current diff against main, including the mvdan/sh expansion flow (FieldsSeqsyntax.SplitBraceswordFields) and the local escaped-brace preprocessing. Overall assessment: safe to merge.

No P0/P1/P2/P3 findings. The latest CI fix avoids adding a new interp allowlist symbol, and the escaped brace metacharacter tests cover the changed paths.

Coverage

Code path Scenario test Go test Status
escaped left brace disables brace expansion tests/scenarios/shell/var_expand/quoting/escaped_left_brace.yaml interp/runner_expand_test.go Covered
escaped left brace across nested/empty alternatives and parameters tests/scenarios/shell/var_expand/quoting/escaped_left_brace_composite.yaml interp/runner_expand_test.go Covered
escaped comma/right brace/dot metacharacters tests/scenarios/shell/var_expand/quoting/escaped_left_brace_composite.yaml interp/runner_expand_test.go Covered
interp allowed-symbol compliance for string search analysis allowlist tests Covered

@AlexandreYang
Copy link
Copy Markdown
Member

Iteration 3 self-review result: P0=0, P1=0, P2=0, P3=0. Summary: reviewed current HEAD (including the interp allowed-symbol fix) against mvdan/sh expansion flow and bash-compatibility coverage; no findings.

@AlexandreYang
Copy link
Copy Markdown
Member

@codex review this PR

Copy link
Copy Markdown
Member

@AlexandreYang AlexandreYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Iteration 4 self-review of current HEAD. Overall assessment: safe to merge.

No P0/P1/P2/P3 findings. Re-ran targeted coverage for escaped brace expansion and interp allowed-symbol compliance; all passed.

@AlexandreYang
Copy link
Copy Markdown
Member

Iteration 4 self-review result: P0=0, P1=0, P2=0, P3=0. Summary: targeted escaped-brace and allowlist checks passed; no findings.

@AlexandreYang
Copy link
Copy Markdown
Member

@codex review this PR

Copy link
Copy Markdown
Member

@AlexandreYang AlexandreYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Iteration 5 self-review of current HEAD. Overall assessment: safe to merge.

No P0/P1/P2/P3 findings. The diff is unchanged since the previous clean review; escaped brace handling and CI allowlist coverage remain adequate.

@AlexandreYang
Copy link
Copy Markdown
Member

Iteration 5 self-review result: P0=0, P1=0, P2=0, P3=0. Summary: diff unchanged from prior clean review; no findings.

@AlexandreYang
Copy link
Copy Markdown
Member

@codex review this PR

Copy link
Copy Markdown
Member

@AlexandreYang AlexandreYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Iteration 6 self-review of current HEAD. Overall assessment: safe to merge.

No P0/P1/P2/P3 findings. CI is green at the time of review, the branch is unchanged, and prior escaped-brace/allowlist verification remains valid.

@AlexandreYang
Copy link
Copy Markdown
Member

Iteration 6 self-review result: P0=0, P1=0, P2=0, P3=0. Summary: CI is green, branch unchanged, no findings.

@AlexandreYang
Copy link
Copy Markdown
Member

Review-Fix Loop Summary

Iteration log

# Unresolved threads Fixes applied CI status
1 0 1 fixed ([iter 1] Fix escaped brace meta expansion) No failing checks (pending)
2 0 1 fixed ([iter 2] Fix interp symbol allowlist failure) No failing checks (pending)
3 0 No failing checks (pending)
4 0 No failing checks (pending)
5 0 Passing
6 0 Passing

Final state

  • Unresolved threads: 0 (authors: none)
  • CI: Passing (failing checks: none)

Remaining issues (if any)

  • None

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae68608f55

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread interp/runner_expand.go
parts = append(parts, word.Parts[:i]...)
}
if parts != nil {
parts = append(parts, litParts...)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve unchanged literals after protected braces

When a word has a protected escaped brace before a non-literal part and then a normal literal, e.g. X=x; printf '<%s>\n' \{${X}foo, the first literal makes parts non-nil, but the later unchanged foo literal has changed == false and litParts == nil, so this append drops it. Bash expands that word to {xfoo}, while this commit returns {x}, so suffix literals after parameter/quoted/command substitutions are silently lost.

Useful? React with 👍 / 👎.

@AlexandreYang
Copy link
Copy Markdown
Member

Upstream follow-up opened to move the escaped-brace compatibility fix into mvdan/sh itself: mvdan/sh#1330

If that lands in a future mvdan.cc/sh/v3 release, rshell should be able to drop most/all of the local escaped-brace preprocessing shim in interp/runner_expand.go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant