-
Notifications
You must be signed in to change notification settings - Fork 608
Fix for Candidate Not Iterable Error #1082
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
Fix for Candidate Not Iterable Error #1082
Conversation
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.
Pull Request Overview
This PR addresses the "Candidate Not Iterable Error" by adding comprehensive safety checks to ensure that candidate objects are iterable before processing. The changes include adding a type guard (isIToolRelease) to validate manifest entries, introducing a safeguard to check for empty release file arrays, and updating tests and workflow configurations to align with these modifications.
- Added a type guard function to confirm manifest entries adhere to IToolRelease.
- Introduced an explicit check for empty release.files in installCpythonFromRelease.
- Updated unit tests and workflow configuration to support validation and error scenarios.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/install-python.ts | Added type guard, validations for manifest and release files, and adjusted error handling logic. |
tests/install-python.test.ts | Updated mock manifest and testing configuration to align with new validations. |
.github/workflows/e2e-cache.yml | Added a new workflow step for an additional OS configuration. |
Comments suppressed due to low confidence (3)
src/install-python.ts:124
- Ensure that there are corresponding tests covering the scenario where release.files is empty to confirm this safety check behaves as expected.
if (!release.files || release.files.length === 0) {
src/install-python.ts:35
- Consider adding tests to cover edge cases for the isIToolRelease function, especially when manifest objects contain incomplete or unexpected data.
function isIToolRelease(obj: any): obj is IToolRelease {
tests/install-python.test.ts:30
- Add tests verifying that an invalid manifest (e.g., missing required properties) correctly triggers the error thrown in getManifest.
beforeEach(() => { jest.resetAllMocks(); });
Description:
Handled issue 'Candidates Is Not Iterable Error' by adding a safety check to ensure that the candidate object is iterable before processing it.
Related issue:
# 903