Skip to content

feat(coder/modules/git-clone): add support for extra_args and drop depth#893

Merged
35C4n0r merged 15 commits into
mainfrom
35C4n0r/git-recurse-submodule
May 27, 2026
Merged

feat(coder/modules/git-clone): add support for extra_args and drop depth#893
35C4n0r merged 15 commits into
mainfrom
35C4n0r/git-recurse-submodule

Conversation

@35C4n0r
Copy link
Copy Markdown
Collaborator

@35C4n0r 35C4n0r commented May 19, 2026

Description

  • add support for extra_args and drop depth

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/git-clone
New version: v2.0.0
Breaking change: [x] Yes [ ] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun fmt)
  • Changes tested locally

Related Issues

Closes #74

Comment thread registry/coder/modules/git-clone/README.md Outdated
…th extra_args for flexible git clone options
Copy link
Copy Markdown
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

Assuming you have tested it. Great addition.

@matifali matifali added the version:minor Add to PRs requiring a minor version upgrade label May 19, 2026
@matifali
Copy link
Copy Markdown
Member

/coder-agents-review

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

The design decision to replace depth with a generic extra_args passthrough is good. It prevents flag-proliferation and the encoding scheme (base64 + newline-split into bash array) is sound. The test suite is real infrastructure (Terraform + Docker), not mocks. Two new tests cover the happy path.

Severity summary: 1 P1, 3 P2, 2 P3, 2 Nit, 4 Note.

The P1 is the version bump: 9 of 16 reviewers independently flagged that a self-identified breaking change (checkbox checked in the PR template) ships under a minor version (1.4.0 instead of 2.0.0). Multiple in-tree templates use ~> 1.0 constraints and would auto-upgrade into a broken terraform plan. The P2s are a bash <4.4 compatibility regression on the default code path, missing migration guidance for the removed depth variable, and a gap in the test suite for space-containing arguments (the entire reason the base64+array encoding exists).

Process note: the PR title ("add support for recursive submodule cloning and parallel jobs") describes the abandoned typed-variable approach from commit 6117692, not the shipped extra_args passthrough from 9d2e19d. Worth updating before squash-merge so the changelog entry matches what shipped.

"The old code had depth as a one-off knob with branching logic in the shell script. Adding recurse_submodules, jobs, filter, etc. as separate variables would be classic feature creep." (Luffy)

🤖 This review was automatically generated with Coder Agents.

Comment thread registry/coder/modules/git-clone/main.tf
Comment thread registry/coder/modules/git-clone/run.sh Outdated
Comment thread registry/coder/modules/git-clone/README.md
Comment thread registry/coder/modules/git-clone/main.test.ts
Comment thread registry/coder/modules/git-clone/main.test.ts Outdated
Comment thread registry/coder/modules/git-clone/run.sh Outdated
Comment thread registry/coder/modules/git-clone/main.tf Outdated
Comment thread registry/coder/modules/git-clone/run.sh Outdated
Comment thread registry/coder/modules/git-clone/README.md Outdated
Comment thread registry/coder/modules/git-clone/run.sh Outdated
@35C4n0r 35C4n0r changed the title feat(coder/modules/git-clone): add support for recursive submodule cloning and parallel jobs feat(coder/modules/git-clone): add support for extra_args and drop depth May 19, 2026
@35C4n0r
Copy link
Copy Markdown
Collaborator Author

35C4n0r commented May 19, 2026

/coder-agents-review

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

11 of 13 R1 findings addressed and verified by the panel. The fixes are thorough: the installFakeGit shim is a particularly good testing pattern that proves argv boundary integrity where the echo output cannot. The bash <4.4 set -u fix uses the standard ${arr[@]+"${arr[@]}"} idiom. All naming, documentation, and cosmetic fixes confirmed correct.

Two contested findings re-evaluated by the panel and upheld:

DEREM-5 (P1): Version bump. 5 reviewers evaluated the author's defense ("one variable removed, one added"). 4/5 rated P1, 1/5 P2. The panel concluded that the author's description of the change is itself the CONTRIBUTING.md definition of a breaking change: "removing inputs, changing types." The defense does not cite any policy that overrides CONTRIBUTING.md. Version should be 2.0.0. This needs a human decision from a maintainer.

DEREM-7 (P2): Migration guidance. 5 reviewers evaluated the author's defense ("minimal change"). 4/5 rated P2, 1/5 P3. "Minimal" describes the diff size, not the user's recovery effort. One sentence in the README prevents every affected user from independently debugging the same Terraform error.

No new findings. The code and tests are in good shape.

"'One variable has been removed' is exactly the behavior that CONTRIBUTING.md defines as major." (Leorio)

🤖 This review was automatically generated with Coder Agents.

@35C4n0r 35C4n0r enabled auto-merge (squash) May 19, 2026 10:30
@35C4n0r 35C4n0r self-assigned this May 19, 2026
@35C4n0r
Copy link
Copy Markdown
Collaborator Author

35C4n0r commented May 25, 2026

/coder-agents-review

@coder-agents-review
Copy link
Copy Markdown

coder-agents-review Bot commented May 25, 2026

Review posted | Chat
Requested: 2026-05-25 13:47 UTC by @35C4n0r
Spend: $49.65 / $100.00

Review history
  • R3 (2026-05-25), 2 Nit, 4 Note, 1 P1, 3 P2, 3 P3, COMMENT. Review
  • R4 (2026-05-25): 5 reviewers, 3 Nit, 5 Note, 1 P1, 3 P2, 6 P3, REQUEST_CHANGES. Review

deep-review v0.5.0 | Round 4 | f980245..e679ef8

Last posted: Round 4, 18 findings (1 P1, 3 P2, 6 P3, 3 Nit, 5 Note), REQUEST_CHANGES. Review

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
DEREM-1 Nit Author fixed (cf98844) README.md:192 Em-dash (U+2014) in new text R1 Netero Yes
DEREM-2 P3 Author fixed (cf98844) main.test.ts:328 No test for extra_args combined with branch_name R1 Netero Yes
DEREM-3 P3 Dropped by orchestrator (local override solves bash bootstrap problem shared utility cannot handle; confirmed by Pariston, Robin, Mafu-san) main.test.ts:13 Local executeScriptInContainer reimplements shared utility R1 Netero No
DEREM-4 P3 Author fixed (cf98844) run.sh:62 Double space in "Running:" echo when no extra_args R1 Netero, Mafu-san P2 Yes
DEREM-5 P1 Author fixed (e679ef8) main.tf:59 Version 1.4.0 for self-identified breaking change; should be 2.0.0 R1 Mafuuu P1, Chopper P1, Meruem P1, Knov P1, Razor P1, Pariston P2, Kite P2, Luffy P2, Zoro P2 Yes
DEREM-6 P2 Author fixed (cf98844) run.sh:62 Empty CLONE_FLAGS array crashes bash < 4.4 under set -u on default path R1 Hisoka P2, Mafuuu P2, Kite P3, Meruem P3 Yes
DEREM-7 P2 Author contested; panel re-raised R4 (4/4 P2) README.md:188 No migration guidance from depth to extra_args R1 Mafu-san P2, Leorio P2, Razor P2, Kite P3 Yes
DEREM-8 P2 Author fixed (cf98844) main.test.ts:328 No test for extra_args with space-containing values R1 Bisky P2 Yes
DEREM-9 P3 Author fixed (cf98844) (PR metadata) PR title describes abandoned approach, not shipped change R1 Mafu-san P2, Leorio P3 Yes
DEREM-10 P3 Dropped by orchestrator (conscious design trade-off endorsed by Pariston, Luffy, Robin; generic passthrough is standard pattern in infra tooling) main.tf:59 Validation lost when switching from typed to generic passthrough R1 Knov No
DEREM-11 Nit Author fixed (cf98844) run.sh:10 EXTRA_ARGS_B64 has B64 suffix other base64 vars lack R1 Gon Yes
DEREM-12 Note Author fixed (cf98844) run.sh:50 CLONE_FLAGS renames data called extra_args everywhere else in module R1 Gon Yes
DEREM-13 Note Author fixed (cf98844) run.sh:62 Echo uses [*] (flat string), git uses [@] (split); tests cannot verify argument boundaries for space-containing args R1 Bisky, Razor Yes
DEREM-14 Note Author fixed (cf98844) main.tf:101 Newline separator in encoding silently splits args containing literal newlines R1 Hisoka P3, Meruem Note, Razor Note Yes
DEREM-15 Note Author fixed (cf98844) run.sh:62 Secrets passed via extra_args appear in plaintext in workspace startup log R1 Hisoka Yes
CRF-1 P3 Open main.tf:103 Fixed module directory path creates race between multiple git-clone instances R4 Pariston Yes
CRF-2 P3 Open run.sh:62 Running echo misleads operators for space-containing extra_args R4 Chopper Yes
CRF-3 P3 Open README.md:261 Log file location undocumented R4 Leorio Yes
CRF-4 Nit Open main.test.ts:351 Regex extracts base64 by matching wrapper exact syntax; fragile coupling R4 Bisky Yes
CRF-5 Note Open main.test.ts:64 runs with git test does not assert expected non-zero exit code R4 Chopper Yes

Contested and acknowledged

DEREM-5 (P1, main.tf:59) - Version 1.4.0 for self-identified breaking change

  • Finding: Removing depth (number) and adding extra_args (list(string)) is "removing inputs, changing types" per CONTRIBUTING.md, requiring a major bump. Templates with ~> 1.0 constraints auto-upgrade and break.
  • Author defense: "No, this should be a minor bump. One variable has been removed and one new variable has been added."
  • Panel re-raised R2 (4/5 P1, 1/5 P2): Mafuuu, Pariston, Leorio, Knov all rated P1; Kite rated P2. The author's description ("one removed, one added") is exactly the CONTRIBUTING.md definition of a breaking change. The defense describes the mechanism without addressing the consequence or citing any policy that overrides CONTRIBUTING.md. Finding stands.

DEREM-7 (P2, README.md:188) - No migration guidance from depth to extra_args

  • Finding: Users upgrading from 1.3.x with depth = 1 get a Terraform error with no guidance on the replacement.
  • Author defense: "Minimal change, migration guide not needed."
  • Panel re-raised R2 (4/5 P2, 1/5 P3): Mafuuu, Pariston, Leorio, Knov all rated P2; Kite rated P3. "Minimal" describes the diff size, not the user's recovery effort. One sentence eliminates every user's debugging cycle. Finding stands.

Round log

Round 1

Panel (16 reviewers: Bisky, Hisoka, Mafu-san, Mafuuu, Pariston, Chopper, Gon, Leorio, Ging-TS, Kite, Meruem, Robin, Luffy, Zoro, Knov, Razor). Netero first pass: 3 P3, 1 Nit. Panel: 1 P1, 3 P2, 2 Nit, 4 Note new. 2 dropped. Reviewed against ee219a8..9d2e19d.

Round 2

Panel (6 reviewers: Mafuuu, Pariston, Bisky, Leorio, Kite, Knov). 11 findings verified fixed. DEREM-5 contested, panel re-raised (4/5 P1). DEREM-7 contested, panel re-raised (4/5 P2). No new findings. Reviewed against ee219a8..cf98844.

Round 3

BLOCKED. DEREM-5 and DEREM-7 silent. Maintainer @matifali confirmed DEREM-5 should be a major bump but no code change pushed. No review.

Round 4

DEREM-5 fixed (version bumped to 2.0.0). DEREM-7 contested again with same defense, panel upheld 4/4 P2. 1 P3, 1 P3, 1 P3, 1 Nit, 1 Note new from R4 infrastructure changes. Reviewed against f980245..e679ef8.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Kurapika security
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

Review blocked. Two findings from R1 remain unaddressed after 2 rounds of panel review.

DEREM-5 (P1): Version should be 2.0.0, not 1.4.0. Maintainer @matifali confirmed in the thread: "that was by mistake. I missed the variable removal. This should be a major version bump." No code change has been pushed. All 12 README version references still read 1.4.0.

DEREM-7 (P2): No migration guidance from depth to extra_args. No response from the author after the R2 panel re-raise. No changes to the README.

Further review is blocked until these two findings are addressed or explicitly deferred with a ticket.

🤖 This review was automatically generated with Coder Agents.

@35C4n0r
Copy link
Copy Markdown
Collaborator Author

35C4n0r commented May 25, 2026

DEREM-5 (P1): Version should be 2.0.0, not 1.4.0. Maintainer @matifali confirmed in the thread: "that was by mistake. I missed the variable removal. This should be a major version bump." No code change has been pushed. All 12 README version references still read 1.4.0.

addressed version bumped to 2.0.0

DEREM-7 (P2): No migration guidance from depth to extra_args. No response from the author after the R2 panel re-raise. No changes to the README.

The change seems too trivial to be given a migration guide.

@35C4n0r
Copy link
Copy Markdown
Collaborator Author

35C4n0r commented May 25, 2026

/coder-agents-review

35C4n0r added 2 commits May 25, 2026 13:52
…nvention

- Add pre_clone_log_path and post_clone_log_path locals in main.tf
- Pass log paths to run.sh as template variables
- Pipe pre/post clone script execution through tee to dedicated log files
Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

DEREM-5 (P1, version bump) verified fixed: all README examples now read 2.0.0.

DEREM-7 (P2, migration guidance) upheld for the third time. Author's R4 defense ("too trivial") is the same argument the panel rejected in R2. 4/4 reviewers in this round re-raised at P2. The project's own CONTRIBUTING.md says: "Don't remove existing variables without clear migration path" and "Document any breaking changes clearly." This needs a maintainer decision from @matifali: add the one-sentence migration note, or explicitly accept the gap.

R4 also introduced infrastructure changes (wrapper script, directory scaffolding, tee-based logging) that the panel flagged 3 P3, 1 Nit, 1 Note. The most notable is the fixed module directory path ($HOME/.coder-modules/coder/git-clone/) which creates a collision when a template uses two git-clone module instances.

CI note: "Validate Terraform output" is failing. All local mechanical checks (terraform validate, shellcheck) pass.

Process note: commit e679ef8's subject reads feat(git-clone): update version from 1.4.0 to 2.0.0 across all modules. Updating version strings is docs or chore, not feat; "across all modules" is misleading since only one README was changed.

"'Trivial' describes the effort to write the migration note. It does not describe the effort a user spends debugging without one." (Leorio)


registry/coder/modules/git-clone/README.md:261

P3 [CRF-3] The new log file path (~/.coder-modules/coder/git-clone/logs/clone.log) is not documented.

"The claude-code module documents its log paths in a troubleshooting section with explicit cat commands. Same convention should apply here." (Leorio)

Suggested addition:

## Troubleshooting

Clone output is logged to `~/.coder-modules/coder/git-clone/logs/clone.log`:

    cat ~/.coder-modules/coder/git-clone/logs/clone.log

(Leorio P3)

🤖

registry/coder/modules/git-clone/main.test.ts:64

Note [CRF-5] The "runs with git" test does not assert the expected non-zero exit code. Every other failure test in this file asserts exitCode (line 60: === 1, line 337: === 42, line 448: === 43). This test only checks stdout for "fatal". Adding expect(output.exitCode).not.toBe(0) would prove that git clone errors propagate, consistent with the pattern in the rest of the file.

(Chopper)

🤖

🤖 This review was automatically generated with Coder Agents.

Comment thread registry/coder/modules/git-clone/main.tf Outdated
Comment thread registry/coder/modules/git-clone/run.sh Outdated
Comment thread registry/coder/modules/git-clone/main.test.ts Outdated
@matifali
Copy link
Copy Markdown
Member

@35C4n0r can you resolve threads and merge this when ready? thanks

Jay Kumar added 2 commits May 26, 2026 11:04
- Add migration guidance for depth -> extra_args (DEREM-7)
- Use folder_name in module_dir to avoid multi-instance collisions (CRF-1)
- Remove diagnostic 'Running:' echo lines (CRF-2)
- Add Troubleshooting section documenting log paths (CRF-3)
- Use robust base64 regex in test (CRF-4)
- Add exit code assertion to 'runs with git' test (CRF-5)
… improve test

- Quote all path interpolations in coder_script heredoc to handle
  spaces and shell metacharacters in folder_name
- Update README secrets warning to cite actual exposure vectors
  (script on disk, Terraform state) after removing echo lines
- Replace mechanism-coupled extra_args test with behavioral check
  using the fake-git shim
- Remove stray blank line in log test
- Add note about -b/--branch conflict with branch_name
Comment thread registry/coder/modules/git-clone/README.md
Comment thread registry/coder/modules/git-clone/README.md Outdated
Comment thread registry/coder/modules/git-clone/README.md Outdated
@35C4n0r
Copy link
Copy Markdown
Collaborator Author

35C4n0r commented May 26, 2026

@matifali also this is what the path would look like for git-clone module

image

@35C4n0r 35C4n0r added version:major Add to PRs requiring a major version upgrade and removed version:minor Add to PRs requiring a minor version upgrade labels May 26, 2026
@35C4n0r 35C4n0r disabled auto-merge May 27, 2026 02:46
@35C4n0r 35C4n0r enabled auto-merge (squash) May 27, 2026 02:46
@35C4n0r 35C4n0r merged commit 76c7371 into main May 27, 2026
4 checks passed
@35C4n0r 35C4n0r deleted the 35C4n0r/git-recurse-submodule branch May 27, 2026 02:48
35C4n0r added a commit that referenced this pull request May 27, 2026
#902)

## Description
Fix the troubleshooting section placeholder from `<instance>` to
`<folder_name>` to match the actual path component used in `module_dir`
(`${local.folder_name}`).

## Type of Change
- [x] Documentation

## Module Information
**Path:** `registry/coder/modules/git-clone`

Follow-up to #893.

> 🤖 Generated with [Coder Agents](https://coder.com)

Co-authored-by: Jay Kumar <jay.kumar@coder.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version:major Add to PRs requiring a major version upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(git-clone): add ability to recurse submodules

2 participants