Skip to content

Consolidate CLI not-found error classification - #52621

Merged
pelikhan merged 6 commits into
mainfrom
copilot/refactor-errorutil-duplicates
Aug 15, 2026
Merged

Consolidate CLI not-found error classification#52621
pelikhan merged 6 commits into
mainfrom
copilot/refactor-errorutil-duplicates

Conversation

Copilot AI commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Several CLI paths duplicated 404/not found detection instead of using errorutil. One case was case-sensitive and missed GitHub’s title-case Not Found output.

  • Shared classification

    • Add errorutil.IsNotFoundOutput(string) for raw CLI output.
    • Reuse the existing case-insensitive matching logic.
  • CLI consolidation

    • Replace five inline predicates with shared classifiers.
    • Remove obsolete helper functions and temporary errors.New wrappers.
    • Preserve specialized repository-resolution handling.
  • Regression coverage

    • Cover raw output variants, including title-case Not Found.
    • Verify missing remote experiments return the specific not-found error.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 8.41 AIC · ⌖ 6.61 AIC · ⊞ 8.5K ·
Comment /souschef to run again

Copilot AI and others added 3 commits August 14, 2026 04:06
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor pkg/errorutil duplicates in pkg/cli Consolidate CLI not-found error classification Aug 14, 2026
Copilot AI requested a review from pelikhan August 14, 2026 04:13
@pelikhan
pelikhan marked this pull request as ready for review August 14, 2026 05:54
Copilot AI balanced review requested due to automatic review settings August 14, 2026 05:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Consolidates CLI not-found detection through errorutil, fixing title-case Not Found handling from issue #52611.

Changes:

  • Adds a case-insensitive raw-output classifier.
  • Replaces duplicated CLI predicates and temporary error wrappers.
  • Adds regression coverage for classifier variants and remote experiments.
Show a summary per file
File Description
pkg/errorutil/errors.go Adds shared raw-output classification.
pkg/errorutil/errors_test.go Tests output variants.
pkg/cli/workflow_run_metadata.go Removes temporary error wrapping.
pkg/cli/setup_repository.go Centralizes repository not-found detection.
pkg/cli/logs_download.go Classifies raw CLI output directly.
pkg/cli/experiments_command.go Fixes case-insensitive experiment detection.
pkg/cli/experiments_command_test.go Adds remote experiment regression coverage.
pkg/cli/evals_branch.go Reuses the shared classifier.
pkg/cli/checks_command.go Replaces inline matching.
pkg/cli/branch_file_reader.go Removes the duplicate output helper.
pkg/cli/add_package_manifest.go Removes the duplicate error helper.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 11/11 changed files
  • Comments generated: 2
  • Review effort level: Balanced

func TestFetchRemoteExperimentDetailsClassifiesTitleCaseNotFound(t *testing.T) {
fakeBinDir := t.TempDir()
fakeGH := filepath.Join(fakeBinDir, "gh")
require.NoError(t, os.WriteFile(fakeGH, []byte("#!/bin/sh\necho 'HTTP 404: Not Found' >&2\nexit 1\n"), 0o755))
Comment thread pkg/errorutil/errors.go
Comment on lines +26 to +29
// IsNotFoundOutput reports whether output represents an HTTP 404 / "not found" response.
// The check is case-insensitive and matches both the numeric literal "404" and
// the phrase "not found".
func IsNotFoundOutput(output string) bool {
@github-actions

Copy link
Copy Markdown
Contributor

Triage: refactor / risk: low

Score: 37/100 (impact+urgency+quality) · Priority: medium · Action: batch_review · Batch: lint-cleanup-cluster

Consolidates CLI not-found error classification into errorutil, fixes case-sensitivity gap. CI green.

Automated PR triage — see full report issue for details.

Generated by 🔧 PR Triage Agent · auto · 48.2 AIC · ⌖ 2.57 AIC · ⊞ 7.8K ·

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage\n\n- Category: refactor\n- Risk: low\n- Priority: medium\n- Score: 48/100 (impact 25 + urgency 15 + quality 8)\n- Recommended action: batch_review\n- Batch: refactor-consolidation-cluster\n

Generated by 🔧 PR Triage Agent · auto · 62.8 AIC · ⌖ 2.76 AIC · ⊞ 7.8K ·

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

  • Category: refactor
  • Risk: medium
  • Priority: medium (score: 41/100)
  • Score breakdown: impact 15/50, urgency 20/30, quality 6/20
  • Recommended action: batch_review
  • Batch: refactor-cleanup-cluster
  • Note: CI failing (Unit tests A-C)

Automated triage by PR Triage Agent.

Generated by 🔧 PR Triage Agent · auto · 64.3 AIC · ⌖ 2.94 AIC · ⊞ 7.8K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please run the pr-finisher skill after addressing the current failure and summarize the maintainer-ready state in one comment.

Failed checks:

Run: https://github.com/github/gh-aw/actions/runs/31833406387

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 8.41 AIC · ⌖ 6.61 AIC · ⊞ 8.5K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

Category: refactor  |  Risk: medium  |  Score: 33/100

Score breakdown

  • Impact: 15/50
  • Urgency: 8/30
  • Quality: 10/20

Recommended action: batch_review

Batch: refactor-cleanup-cluster

12 files touched, only comment-level review so far, no CI data.

Generated by 🔧 PR Triage Agent · auto · 68.2 AIC · ⌖ 10.7 AIC · ⊞ 7.8K ·

@pelikhan
pelikhan merged commit ab48eba into main Aug 15, 2026
27 checks passed
@pelikhan
pelikhan deleted the copilot/refactor-errorutil-duplicates branch August 15, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] errorutil duplicated in 5 pkg/cli sites (one with a case-sensitivity bug); fileutil is clean

4 participants