Skip to content

Fail fast with a descriptive error when an updater image is missing from the catalog - #1781

Merged
v-thavaahariharangit merged 1 commit into
mainfrom
copilot/conda-support-mismatch-fix
Sep 18, 2026
Merged

v-thavaahariharangit merged 1 commit into
mainfrom
copilot/conda-support-mismatch-fix

Conversation

Copilot AI commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

GHES release bundles can pin a Dependabot action whose docker/containers.json predates an ecosystem the backend already accepts (e.g. Conda in GHES 3.21.X). When that happens, updaterImageName() returns undefined, which reaches validImageRepository()'s .startsWith() call and throws an uncaught TypeError, surfaced only as a generic Error fetching updater images.

Changes

  • Guard against undefined updater images — in src/main.ts, immediately after resolving updaterImage (from params.updaterImage or updaterImageName(details['package-manager'])), fail the job early with a descriptive error naming the unsupported package manager if no image was resolved, instead of proceeding into the pull/registry-validation path.
  • Regression test — added a case in __tests__/main.test.ts covering a package manager with no catalog entry, asserting the job fails without attempting any image pulls and reports a descriptive error to the Dependabot service.

Example

let updaterImage =
  params.updaterImage || updaterImageName(details['package-manager'])

if (!updaterImage) {
  await failJob(
    apiClient,
    'Error fetching updater images',
    new Error(
      `No updater image is configured for package manager '${details['package-manager']}' in this action revision`
    ),
    DependabotErrorType.Image
  )
  return
}

This turns an opaque, uncaught TypeError into a clear, actionable diagnostic that identifies the affected package manager, without changing behavior for any ecosystem already present in the image catalog.

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.

🟢 Approval recommended

The focused change correctly handles the missing catalog entry and includes appropriate regression coverage.

Pull request overview

Adds clear handling when no updater image exists for a package manager.

Changes:

  • Fails early with a descriptive image error.
  • Adds regression coverage.
  • Regenerates the bundled action.
File summaries
File Description
src/main.ts Adds the missing-image guard.
__tests__/main.test.ts Tests failure reporting and prevents image pulls.
dist/main.js Updates the bundled runtime.
Review details
  • Files reviewed: 2/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

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

@v-thavaahariharangit
v-thavaahariharangit merged commit 23858da into main Sep 18, 2026
12 checks passed
@v-thavaahariharangit
v-thavaahariharangit deleted the copilot/conda-support-mismatch-fix branch September 18, 2026 13:17
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.

4 participants