Skip to content

remove simple git#6976

Merged
ryancbahan merged 3 commits intomainfrom
remove-simple-git
Mar 12, 2026
Merged

remove simple git#6976
ryancbahan merged 3 commits intomainfrom
remove-simple-git

Conversation

@ryancbahan
Copy link
Contributor

@ryancbahan ryancbahan commented Mar 11, 2026

WHY are these changes introduced?

This change removes the dependency on the simple-git library and replaces it with direct git command execution using execa. This PR is part of an assertion I believe to be true: with the rise of agentic development and parallel rise of supply chain attacks, external dependencies have become less valuable and higher risk. We should be looking at our dependencies with a critical eye and removing ones that don't have a very clear value proposition.

Testing

  • shopify app init
  • shopify theme init
  • shopify app generate extension

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ryancbahan ryancbahan marked this pull request as ready for review March 11, 2026 14:38
@ryancbahan ryancbahan requested a review from a team as a code owner March 11, 2026 14:38
@binks-code-reviewer
Copy link

🤖 Code Review · #projects-dev-ai for questions
React with 👍/👎 or reply — all feedback helps improve the agent.

Complete - 5 findings

📋 History

✅ 5 findings

@github-actions
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2026

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 79.19% 14601/18437
🟡 Branches 73.44% 7258/9883
🟡 Functions 79.36% 3706/4670
🟡 Lines 79.52% 13803/17357

Test suite run success

3822 tests passing in 1464 suites.

Report generated by 🧪jest coverage report action from 9384aee

Copy link
Contributor

@dmerand dmerand left a comment

Choose a reason for hiding this comment

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

I'm aligned with this approach. AI pair review found some bugs worth double-checking.


Review assisted by pair-review

Copy link
Contributor

Choose a reason for hiding this comment

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

(Ref Line 152) 🐛 Bug: The progressUpdater parameter is still declared in the GitCloneOptions interface but is no longer used in the implementation (removed at line 160). This is a silent breaking change - callers can pass this parameter expecting progress updates, but it will be ignored without any error or warning. While no code in the codebase currently uses this parameter, it's still part of the public API contract.

Suggestion: Either remove the parameter from the interface to accurately reflect the implementation, or add a deprecation notice:

Suggested change
/** @deprecated Progress updates are no longer supported after removing simple-git dependency */
progressUpdater?: (statusString: string) => void

Alternatively, implement progress tracking using execa's stdio events, or remove it entirely with a migration note.

ryancbahan and others added 3 commits March 12, 2026 08:37
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Preserve exitCode in gitCommand when wrapping errors in AbortError
- Use null byte delimiter in getLatestGitCommit to handle multiline bodies
- Narrow error handling in checkIfIgnoredInGitRepository (exitCode === 1)
- Narrow error handling in insideGitDirectory (exitCode === 128)
- Narrow error handling in getLatestTag (exitCode === 128)
- Remove unused progressUpdater from GitCloneOptions interface
- Add error message matcher to latestTag test assertion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/git.d.ts
@@ -1,5 +1,13 @@
 import { AbortError } from './error.js';
-import { DefaultLogFields, ListLogLine } from 'simple-git';
+export interface GitLogEntry {
+    hash: string;
+    date: string;
+    message: string;
+    refs: string;
+    body: string;
+    author_name: string;
+    author_email: string;
+}
 /**
  * Initialize a git repository at the given directory.
  *
@@ -40,14 +48,12 @@ export declare function addToGitIgnore(root: string, entry: string): void;
  *
  * @param repoUrl - The URL of the repository to clone.
  * @param destination - The directory where the repository will be cloned.
- * @param progressUpdater - A function that will be called with the progress of the clone.
  * @param shallow - Whether to clone the repository shallowly.
  * @param latestTag - Whether to clone the latest tag instead of the default branch.
  */
 export interface GitCloneOptions {
     repoUrl: string;
     destination: string;
-    progressUpdater?: (statusString: string) => void;
     shallow?: boolean;
     latestTag?: boolean;
 }
@@ -64,7 +70,7 @@ export declare function downloadGitRepository(cloneOptions: GitCloneOptions): Pr
  * @param directory - The directory of the git repository.
  * @returns The latest commit of the repository.
  */
-export declare function getLatestGitCommit(directory?: string): Promise<DefaultLogFields & ListLogLine>;
+export declare function getLatestGitCommit(directory?: string): Promise<GitLogEntry>;
 /**
  * Add all files to the git index from the given directory.
  *

@ryancbahan ryancbahan requested a review from dmerand March 12, 2026 15:25
Copy link
Contributor

@dmerand dmerand left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! Tophat LGTM.

@ryancbahan ryancbahan added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit 2fb48a9 Mar 12, 2026
27 checks passed
@ryancbahan ryancbahan deleted the remove-simple-git branch March 12, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants