Skip to content

Add validation for invalid definition IDs in config utilities#1756

Merged
abdurriq merged 5 commits intomainfrom
copilot/fix-github-actions-workflow-again
Jan 26, 2026
Merged

Add validation for invalid definition IDs in config utilities#1756
abdurriq merged 5 commits intomainfrom
copilot/fix-github-actions-workflow-again

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

The push-again.yml workflow crashed with TypeError: Cannot read properties of undefined (reading 'path') when given definition ID "base" (which no longer exists - split into base-alpine, base-debian, base-ubuntu).

Changes

  • Added validation in getDefinitionPath() to check allDefinitionPaths[definitionId] exists before property access

Throws descriptive error listing available definition IDs:

// Before: TypeError: Cannot read properties of undefined (reading 'path')

// After:
throw new Error(`Invalid definition ID 'base'. Available definition IDs are: anaconda, base-alpine, base-debian, base-ubuntu, cpp, dotnet, go, java, java-8, javascript-node, jekyll, miniconda, php, python, ruby, rust, typescript-node, universal`);

The workflow now fails fast with actionable feedback when given invalid input.

Original prompt

Fix the failing GitHub Actions workflow Build and push images
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 61482772579
Job URL: https://github.com/devcontainers/images/actions/runs/21361795756/job/61482772579


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 26, 2026 14:53
Co-authored-by: abdurriq <137001048+abdurriq@users.noreply.github.com>
Co-authored-by: abdurriq <137001048+abdurriq@users.noreply.github.com>
Co-authored-by: abdurriq <137001048+abdurriq@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix the failing GitHub Actions workflow for building images Add validation for invalid definition IDs in config utilities Jan 26, 2026
Copilot AI requested a review from abdurriq January 26, 2026 14:58
…fallback

Co-authored-by: abdurriq <137001048+abdurriq@users.noreply.github.com>
Copilot AI requested a review from abdurriq January 26, 2026 15:03
@abdurriq abdurriq marked this pull request as ready for review January 26, 2026 15:12
@abdurriq abdurriq requested a review from a team as a code owner January 26, 2026 15:12
Copilot AI review requested due to automatic review settings January 26, 2026 15:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds input validation to prevent crashes when invalid definition IDs are provided to the getDefinitionPath() function. The issue was discovered when the push-again.yml workflow was invoked with the definition ID "base", which no longer exists after being split into base-alpine, base-debian, and base-ubuntu.

Changes:

  • Added validation in getDefinitionPath() to check if a definition ID exists before accessing its properties
  • Throws a descriptive error message listing all available definition IDs when an invalid ID is provided

@abdurriq abdurriq merged commit c668a57 into main Jan 26, 2026
28 of 36 checks passed
@abdurriq abdurriq deleted the copilot/fix-github-actions-workflow-again branch January 26, 2026 20:28
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.

3 participants