feat(ci): add not-in-git-repo guard to ci:run and ci:rerun (W-23597902, #1761) - #3843
Open
heroku-johnny wants to merge 3 commits into
Open
feat(ci): add not-in-git-repo guard to ci:run and ci:rerun (W-23597902, #1761)#3843heroku-johnny wants to merge 3 commits into
heroku-johnny wants to merge 3 commits into
Conversation
Adds an early inGitRepo() check to ci:run and ci:rerun that throws a clear error message when run outside a git repository, preventing confusing failures from createSourceBlob() silently swallowing git errors. Closes #1761 (W-23597902) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 20:13 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 20:13 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 20:13 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 20:13 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 21:45 — with
GitHub Actions
Inactive
heroku-johnny
had a problem deploying
to
AcceptanceTests
July 27, 2026 21:45 — with
GitHub Actions
Error
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 21:45 — with
GitHub Actions
Inactive
heroku-johnny
had a problem deploying
to
AcceptanceTests
July 27, 2026 21:45 — with
GitHub Actions
Failure
michaelmalave
temporarily deployed
to
AcceptanceTests
August 4, 2026 17:35 — with
GitHub Actions
Inactive
michaelmalave
temporarily deployed
to
AcceptanceTests
August 4, 2026 17:35 — with
GitHub Actions
Inactive
michaelmalave
temporarily deployed
to
AcceptanceTests
August 4, 2026 17:35 — with
GitHub Actions
Inactive
michaelmalave
temporarily deployed
to
AcceptanceTests
August 4, 2026 17:35 — with
GitHub Actions
Inactive
michaelmalave
left a comment
Contributor
There was a problem hiding this comment.
@heroku-johnny I think these messages would need CX review since it's new user facing text?
michaelmalave
approved these changes
Aug 4, 2026
michaelmalave
left a comment
Contributor
There was a problem hiding this comment.
Some comments on additional reviews that might be needed. Otherwise, testing passes. LGTM
| const {args, flags} = await this.parse(CiReRun) | ||
|
|
||
| if (!gitService.inGitRepo()) { | ||
| this.error('Not in a git repository. ci:rerun must be run from within your app\'s git repo.') |
Contributor
There was a problem hiding this comment.
IIRC, new user facing text like this and those below should be CX reviewed prior to merge.
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.
Summary
gitService.inGitRepo()guard toci:runandci:rerunthat throws a clear, user-friendly error when run outside a git repositorycreateSourceBlob()with a confusing error; now the user sees: "Not in a git repository. ci:rerun must be run from within your app's git repo."gitServicesingleton (already imported inci:run; newly imported inci:rerun) so the guard is stubbable in testswhen not in a git repositorytest case to bothci:runandci:rerununit testsgitService.inGitRepototruein the existing happy-path tests to keep them isolatedTest plan
ci:run— new test casewhen not in a git repositorypassesci:rerun— new test casewhen not in a git repositorypassesci:runandci:reruntests continue to passnpm run lintreports no errors for touched filesheroku ci:run --pipeline=foooutside a git repo and confirm the error messageCloses #1761 | GUS W-23597902
🤖 Generated with Claude Code