Skip to content
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

feat: add recipe input validation #232

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

nullPointer373
Copy link

Issue #, if available:

Description of changes:
Added recipe input validation to check specific recipe properties and log a warning if any violations are detected.

Why is this change necessary:
This change is necessary to proactively identify and address potential issues during the build stage.

How was this change tested:
New unit tests have been added and all tests passed successfully.

Any additional information or context required to review the change:
The decision to display warnings instead of raising errors is based on the understanding that these issues may not be critical enough to block component deployment or runtime. The warnings are intended to alert customers early in the process, allowing them to be aware of and mitigate potential issues.

An example output for a recipe with potential issues:
[2023-08-18 13:14:36] INFO - Building the component 'com.example.PythonHelloWorld' with the given project configuration.
[2023-08-18 13:14:36] INFO - Using 'zip' build system to build the component.
[2023-08-18 13:14:36] WARNING - This component is identified as using 'zip' build system. If this is incorrect, please exit and specify custom build command in the 'gdk-config.json'.
[2023-08-18 13:14:36] WARNING - It's not recommended to specify the component type in a recipe. AWS IoT Greengrass sets the type for you when you create a component.
[2023-08-18 13:14:36] WARNING - The file name in the script does not match the artifact names in the URI. If this is incorrect, please exit and ensure the artifacts and the script are correct.
[2023-08-18 13:14:36] INFO - Copying over the build artifacts to the greengrass component artifacts build folder.
[2023-08-18 13:14:36] INFO - Updating artifact URIs in the recipe.

Checklist:

  • Updated the README if applicable
  • Updated or added new unit tests
  • Updated or added new integration tests
  • Updated or added new end-to-end tests
  • If your code makes a remote network call, it was tested with a proxy
  • You confirm that the change is backwards compatible

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

❗ No coverage uploaded for pull request base (Yifan-recipe-validation@fe83bfe). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@                    Coverage Diff                     @@
##             Yifan-recipe-validation     #232   +/-   ##
==========================================================
  Coverage                           ?   97.66%           
==========================================================
  Files                              ?       42           
  Lines                              ?     1630           
  Branches                           ?        0           
==========================================================
  Hits                               ?     1592           
  Misses                             ?       38           
  Partials                           ?        0           
Flag Coverage Δ
integ 86.01% <0.00%> (?)
unit 93.98% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nullPointer373 nullPointer373 merged commit d7f3eed into Yifan-recipe-validation Aug 22, 2023
5 checks passed
@nullPointer373 nullPointer373 deleted the Yifan-recipe-input-validation branch August 22, 2023 20:25
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