-
Notifications
You must be signed in to change notification settings - Fork 5
fix(api): allow missing required variable when a brick is added + app validation #74
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
Conversation
…ate test data feat: add AppFromExample configuration and Python main file for testing
… update test cases
…Create and update test case descriptions
…app descriptor test
…ty and consistency
…responding constant
…d omitted variables
…cases for validation scenarios
… and adjust related tests
…errors instead of the first one
…ted tests for consistency
|
Running this script to test the validation of the example 0.5.0 |
Doesn't this approach risk assigning a non-compatible value for a mandatory variable? What happens in this case? The result is that the required variable is set as an empty string in the app.yaml (see the tests "do not fail if a mandatory variable is not present"). |
…for better clarity
Co-authored-by: mirkoCrobu <[email protected]>
Motivation
When a brick with required variables is added to an app created from scratch the operation fails.
This is because the BE returns an error if the required variables are not set when the
PUT /v1/apps/{appID}/bricks/{brickID}is called. For example, the brickarduino:arduino_cloudhas theARDUINO_DEVICE_IDandARDUINO_SECRETrequired.Additionally, the issue does not occur when an app with a brick already added is cloned.
This is because when an app is cloned the backend does not check if the required variables are missing.
Change description
PATCH /v1/apps/{appID}/bricks/{brickID}) endpointAdditional notes
arduino_cloud. Starting an app that uses the arduino_cloud without specifying the required variablesARDUINO_SECRETandARDUINO_DEVICE_IDwill raise an error.Examples of errors
Example:
Given the following
app-yaml, where the requiredARDUINO_SECRETvariable ofarduino:arduino_cloudis missing:When an app is started
When an app is restarted
Additional Notes
Reviewer checklist
main.