-
Notifications
You must be signed in to change notification settings - Fork 1
review: check-consumer-config fails loudly on a nonexistent --repo path #372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "review": patch | ||
| --- | ||
|
|
||
| check-consumer-config: fail loudly when `--repo` names a path that does not exist. The flag takes a path to the consumer checkout, but an `owner/name` argument parses fine and resolves as a relative path, so every check reported missing and the report read as a catastrophically broken install instead of a typo (hit live during the 2026-08-20 rollout; the review-consumer-bump skill documents the footgun). The checker now throws naming the bad path. Also deduplicates parseArgs's twice-declared inline arg type into one `CliArgs` alias to stay under the max-lines cap the file already sits at. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -362,6 +362,13 @@ export const checkConsumerConfig = ( | |
| options: CheckOptions = {}, | ||
| ): ConsumerConfigReport => { | ||
| const repoRoot = options.repoRoot ?? "."; | ||
| // `--repo` takes a path to the consumer checkout; an owner/name arg | ||
| // resolves as a relative path and every check would report missing. | ||
| if (repoRoot !== "." && !fs.existsSync(repoRoot)) { | ||
| throw new Error( | ||
| `--repo path does not exist: ${repoRoot} (a path to the consumer checkout, not an owner/name)`, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question (non-blocking): Existence is a narrower predicate than the problem the description states. The description frames the problem as "the report read as a catastrophically broken install instead of a typo," but existence only separates typos that fail to resolve; an existing-but-wrong root reproduces the original symptom, and review detailsfound by first-principles |
||
| ); | ||
| } | ||
| const at = (p: string): string => | ||
| repoRoot === "." ? p : `${repoRoot}/${p}`; | ||
| const issues: ConfigIssue[] = []; | ||
|
|
@@ -875,25 +882,18 @@ export {renderReport}; | |
| /* CLI */ | ||
| /* -------------------------------------------------------------------------- */ | ||
|
|
||
| /** Parse `--flag value` arguments. Unknown flags are an error, not ignored. */ | ||
| export const parseArgs = ( | ||
| argv: readonly string[], | ||
| ): { | ||
| type CliArgs = { | ||
| repoRoot?: string; | ||
| filesFrom?: string; | ||
| explainPath?: string; | ||
| workflowPath?: string; | ||
| json: boolean; | ||
| strict: boolean; | ||
| } => { | ||
| const out = {json: false, strict: false} as { | ||
| repoRoot?: string; | ||
| filesFrom?: string; | ||
| explainPath?: string; | ||
| workflowPath?: string; | ||
| json: boolean; | ||
| strict: boolean; | ||
| }; | ||
| }; | ||
|
|
||
| /** Parse `--flag value` arguments. Unknown flags are an error, not ignored. */ | ||
| export const parseArgs = (argv: readonly string[]): CliArgs => { | ||
| const out = {json: false, strict: false} as CliArgs; | ||
| for (let i = 0; i < argv.length; i++) { | ||
| const arg = argv[i]; | ||
| switch (arg) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.