Skip to content

Add manifest validation and improve error handling #586

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

Merged

Conversation

priyagupta108
Copy link
Contributor

Description:
This fix ensures proper validation of the manifest before processing and improves error handling by falling back to a secondary source for unexpected manifest structures.

Related issue:
#580

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@Copilot Copilot AI review requested due to automatic review settings April 23, 2025 11:37
@priyagupta108 priyagupta108 requested a review from a team as a code owner April 23, 2025 11:37
Copy link

@Copilot 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link

@Copilot 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 improves the manifest validation logic and error handling in the installer module.

  • Adds a type guard function (isIToolRelease) to validate manifest objects.
  • Improves error handling in getManifest by providing a fallback mechanism to fetch the manifest via URL.
Comments suppressed due to low confidence (2)

src/installer.ts:308

  • [nitpick] Consider enhancing the error message to include more context about the failure in manifest validation (e.g., indicating that the fetched manifest does not match the expected structure) to ease troubleshooting.
let errorMessage = 'An unexpected error occurred while fetching the manifest.';

src/installer.ts:278

  • [nitpick] Consider renaming 'isIToolRelease' to 'isToolRelease' to better align with naming conventions that avoid prefixed 'I' when used in type guard function names, if consistent with the rest of the codebase.
function isIToolRelease(obj: any): obj is tc.IToolRelease {

@priyagupta108 priyagupta108 self-assigned this Apr 24, 2025
@HarithaVattikuti HarithaVattikuti merged commit 29694d7 into actions:main May 6, 2025
104 checks passed
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