Repository navigation
Conversation
Add an additional_args map of flag to value for `git clone`, matching the additional_args name used across the registry. Each flag is passed exactly as written (--long or -s, the admin's choice), followed by its value as the next argument; an empty value passes the flag alone. -b and --branch are rejected, since the module sets the branch. extra_args keeps working unchanged and is appended after additional_args; it is marked deprecated, for use only where a map cannot express the arguments (a repeated flag). Bumps to 2.1.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2TMgCPW8SL8kUCB28L4dt
matifali
marked this pull request as draft
October 22, 2026 15:00
This was referenced Oct 22, 2026
The first tests to use the alpine and alpine/git images pull them, which
outlasts bun's 5s default on a cold CI runner ("fails without git" and
"runs with git" timed out). Matches the 60s other modules use.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R2TMgCPW8SL8kUCB28L4dt
Contributor
Module Scorecard Check
|
| Theme | Before | After |
|---|---|---|
| Presentation & Onboarding | 12 / 17 | 12 / 17 |
| Integration | — | — |
| Credential Hygiene | 12 / 20 | 20 / 20 |
| Restricted-Environment | 2 / 2 | 2 / 2 (18 pts N/A) |
| Engineering Quality | 10 / 10 | 10 / 10 |
| Overall | 73 / 100 | 89 / 100 |
Full scorecard for this PR
| Presentation & Onboarding | Credential Hygiene | Restricted-Environment Readiness | Engineering Quality | Overall |
|---|---|---|---|---|
| 12 / 17 | 20 / 20 | 2 / 2 (18 pts N/A) | 10 / 10 | 89 / 100 |
Drilldown
Track: Utility (git helper module; Universal criteria only, normalized per rubric)
Presentation & Onboarding — 12 / 17
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Configuration-mode examples | 12 | 12 | README documents distinct modes with sensible defaults: basic clone, custom base_dir, coder_external_auth integration, branch-via-URL, self-hosted GitHub/GitLab (git_providers), explicit branch_name, folder_name, additional_args, pre_clone_script/post_clone_script. Thorough coverage of major option combinations. |
| Visual preview | 5 | 0 | No image, GIF, or video anywhere in the README. |
Credential Hygiene — 20 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Secrets marked sensitive | 16 | 16 | Module has no secret-bearing inputs (no tokens/passwords/API keys); nothing needs sensitive = true. README examples never inline literal or placeholder secrets. |
| Non-hardcoded auth path | 4 | 4 | README's "Git Authentication" section documents using data.coder_external_auth (Coder's external auth provider) instead of pasting raw credentials. |
Restricted-Environment Readiness — 2 / 2 (18 pts excluded as N/A)
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Mirrorable artifact source | 5 | N/A | Module installs/downloads nothing of its own — it only invokes git already expected on the image and clones a user-supplied URL (explicit example construction in rubric notes). Excluded from denominator. |
| Bring-your-own binary | 10 | N/A | No tool is bundled/installed by this module (script exits with "Git is not installed!" rather than installing it), so disable/skip-install is not an applicable concern. Excluded from denominator. |
| Egress transparency | 3 | N/A | No install/runtime download endpoints exist to enumerate beyond the user-provided repo URL and optional SSH host (ssh-keyscan), which are user-controlled, not module-controlled. Excluded from denominator. |
| Runs without sudo | 2 | 2 | run.sh and the generated coder_script never invoke sudo; all operations (mkdir, git clone, ssh-keyscan, known_hosts writes) run as the invoking user. Verified from script source — no root requirement for any path. |
Engineering Quality — 10 / 10
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Input quality | 6 | 6 | All variables have clear descriptions and sensible defaults (base_dir, branch_name, folder_name default empty; git_providers defaults to github/gitlab). Validations present for git_providers (allowed provider values) and additional_args (rejects newlines and -b/--branch conflicts). |
| Test coverage | 4 | 4 | .tftest.hcl covers business logic (URL parsing, branch extraction, empty/whitespace URL handling, additional_args validation failures). main.test.ts provides extensive e2e coverage in real containers: clone behavior, SSH known_hosts handling across URL formats, pre/post-clone script execution and failure propagation, extra_args/additional_args ordering via a fake-git shim, and logging output. |
Overall — 89 / 100
Raw 42 / 47 → round(42 / 47 × 100) = 89
Tip
You can run this locally by telling your agent: "review this module against .github/scorecard/SCORECARD.md".
Scored against SCORECARD.md with solstice-1. Language-model scores are advisory.
Per review on #1202, a map cannot repeat a flag (a repeated key silently keeps only the last value). additional_args is now a list with one element per argument, passed in order, the same type as the extra_args it replaces, so migrating is a rename. -b and --branch are still rejected, with or without =value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2TMgCPW8SL8kUCB28L4dt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
additional_argstogit-cloneand deprecatesextra_args. The goal is one name for this input across the registry; the AGENTS.md rule is in coder/registry#1202.additional_argsis alist(string)with one element per argument. That's the same type asextra_args, so migrating is just a rename. Each element is passed togit cloneexactly as written and in order, so a flag can repeat and a value can contain spaces.extra_argsstill works exactly as before and is appended afteradditional_args. Its description and the README mark it deprecated.-band--branch, with or without=value, because the module already sets the branch frombranch_nameor the URL. A comment inmain.tfand inrun.shsays to keep this list in sync.alpineandalpine/gitimages and outlasted bun's 5s default on a cold CI runner.An earlier version of this PR used a
map(string)of flag to value. Per review on coder/registry#1202, a map can't repeat a flag, and Terraform silently keeps only the last value of a repeated key. So the input is now a list.Type of Change
Module Information
Path:
registry/coder/modules/git-cloneNew version:
v2.1.0Breaking change: [ ] Yes [x] No —
additional_argsdefaults to[]andextra_argsis unchanged.Testing & Validation
terraform test, 7 passed. Covered:additional_argskeeping order and a repeated-cwithextra_argsappended after; rejecting a newline; rejecting--branch=main.main.test.tscoveradditional_args(a repeated-c) followed byextra_args, and pass in CI.bun fmt);./scripts/terraform_validate.shpassesRelated Issues
None
Generated by Claude Code