Add validation for invalid definition IDs in config utilities#1756
Merged
Add validation for invalid definition IDs in config utilities#1756
Conversation
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>
abdurriq
reviewed
Jan 26, 2026
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
…fallback Co-authored-by: abdurriq <137001048+abdurriq@users.noreply.github.com>
abdurriq
approved these changes
Jan 26, 2026
Contributor
There was a problem hiding this comment.
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
approved these changes
Jan 26, 2026
sam-byng
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
push-again.ymlworkflow crashed withTypeError: 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
getDefinitionPath()to checkallDefinitionPaths[definitionId]exists before property accessThrows descriptive error listing available definition IDs:
The workflow now fails fast with actionable feedback when given invalid input.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.