-
Notifications
You must be signed in to change notification settings - Fork 0
fix: clear up maint error messages #401
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 |
|---|---|---|
|
|
@@ -266,10 +266,24 @@ export async function flagNeedsHuman( | |
| return { flagged: true, detail: comment.detail }; | ||
| } | ||
|
|
||
| /** | ||
| * The comment a flagged issue receives. It is deliberately generic: a | ||
| * give-up cause, check output, or error message can carry paths, tokens, | ||
| * or environment details, so the specifics stay in the run's own log and | ||
| * never reach the public issue. | ||
| */ | ||
| export function needsHumanNotice(workflow: string, needsHumanLabel: string): string { | ||
| return [ | ||
| `I ran into a problem while working on this issue.`, | ||
|
Owner
Author
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. This notice drops the only recovery instruction the reader had, "Remove the label to re-queue it." Every other notice in this PR keeps its "...clears it" sentence, and an issue is the one case where a person has to act to recover. Add the re-queue sentence back. Also switch to the "Something went wrong..." wording the other notices use, instead of the first person. EvidenceThe README (ops/maintenance/README.md) still says "removing the label re-queues one". The old issue comments told readers to remove the label, and to dispatch the workflow to override the skip. |
||
| `I've added the \`${needsHumanLabel}\` label for your attention.`, | ||
| ].join('\n'); | ||
| } | ||
|
|
||
| /** | ||
| * The give-up node's action: flag the picked issue waiting on a human | ||
| * because the run ended without a pull request, naming which dead end | ||
| * (`cause`) sent it here so the comment is actionable. The result carries | ||
| * because the run ended without a pull request. The posted comment is | ||
| * {@link needsHumanNotice}; `cause` names which dead end sent the run | ||
| * here and is reported only in the returned `detail`. The result carries | ||
| * `flagged`, which `run.ts` reads into the run's `gave_up` field, so a | ||
| * tried-and-abandoned run reports distinctly from a nothing-to-do one. | ||
| */ | ||
|
|
@@ -280,38 +294,47 @@ export async function giveUpNeedsHuman( | |
| cause: string, | ||
| needsHumanLabel: string, | ||
| options: { token?: string; ops?: FlagNeedsHumanOps } = {}, | ||
| ): Promise<{ flagged: boolean; detail: string }> { | ||
| return flagNeedsHuman(repoRoot, issueNumber, [ | ||
| `${workflow} ended without a pull request — ${cause} — so this issue now carries the \`${needsHumanLabel}\` label and the picker skips it.`, | ||
| 'Remove the label to re-queue it, close the issue if it is already settled, or investigate.', | ||
| ].join('\n'), { label: needsHumanLabel, ...(options.token !== undefined ? { token: options.token } : {}), ...(options.ops !== undefined ? { ops: options.ops } : {}) }); | ||
| ): Promise<{ flagged: boolean; issue_number: number; detail: string }> { | ||
| const result = await flagNeedsHuman(repoRoot, issueNumber, needsHumanNotice(workflow, needsHumanLabel), { | ||
| label: needsHumanLabel, | ||
| ...(options.token !== undefined ? { token: options.token } : {}), | ||
| ...(options.ops !== undefined ? { ops: options.ops } : {}), | ||
| }); | ||
| return { | ||
| flagged: result.flagged, | ||
| issue_number: issueNumber, | ||
| detail: result.flagged ? `flagged #${issueNumber} (${cause}); ${result.detail}` : `${cause}; ${result.detail}`, | ||
| }; | ||
| } | ||
|
|
||
| /** | ||
| * An `onFatal` cleanup that flags the picked issue waiting on a human | ||
| * after an engine-level death (a budget breach) that bypasses the | ||
| * give-up node — without it, the issue stays approved-but-orphaned, its | ||
| * label event already spent, so nothing re-queues it. `getPicked` reads | ||
| * the issue held in the build's closure. | ||
| * the issue held in the build's closure. The error is reported in the | ||
| * returned line only; the issue gets {@link needsHumanNotice}. | ||
| */ | ||
| export function fatalNeedsHuman( | ||
| repoRoot: string, | ||
| getPicked: () => number | undefined, | ||
| workflow: string, | ||
| needsHumanLabel: string, | ||
| token?: string, | ||
| ops?: FlagNeedsHumanOps, | ||
| ): (error: unknown) => Promise<string | undefined> { | ||
| return async (error) => { | ||
| const issue = getPicked(); | ||
| if (issue === undefined) return undefined; | ||
| const reason = error instanceof Error ? error.message : String(error); | ||
| try { | ||
| const reason = error instanceof Error ? error.message : String(error); | ||
| const result = await flagNeedsHuman(repoRoot, issue, [ | ||
| `${workflow} died before finishing (${reason}), so this issue now carries the \`${needsHumanLabel}\` label and the picker skips it.`, | ||
| 'Remove the label to re-queue it, or dispatch the workflow naming this issue to override the skip.', | ||
| ].join('\n'), { label: needsHumanLabel, ...(token !== undefined ? { token } : {}) }); | ||
| const result = await flagNeedsHuman(repoRoot, issue, needsHumanNotice(workflow, needsHumanLabel), { | ||
| label: needsHumanLabel, | ||
| ...(token !== undefined ? { token } : {}), | ||
| ...(ops !== undefined ? { ops } : {}), | ||
| }); | ||
| return result.flagged | ||
| ? `fatal-run cleanup: #${issue} flagged ${needsHumanLabel}` | ||
| ? `fatal-run cleanup: #${issue} flagged ${needsHumanLabel} after: ${reason}` | ||
| : `fatal-run cleanup on #${issue}: ${result.detail}`; | ||
| } catch (cleanupError) { | ||
| return `fatal-run cleanup failed on #${issue}: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exported notice never uses its
workflowparameter. SogiveUpNeedsHuman,fatalNeedsHumanand all six callers pass a workflow name that has no effect. Either put the workflow name into the text (for example "issue-fix ran into a problem..."), or remove the parameter all the way up the chain.Evidence
ESLint only covers
packages/**(eslint.config.mjs), and no tsconfig setsnoUnusedParameters, so lint and the compiler won't catch this.Callers: issue-fix/index.ts:81, implement-ticket/index.ts:76, optimization-apply/index.ts:69, and the three
give-up.tstools.