Skip to content

Conversation

@dido18
Copy link
Contributor

@dido18 dido18 commented Nov 12, 2025

Motivation

Close #68

When a brick with required variables is added to an app created from scratch the operation fails.
This is because the FE (appLab) does not pass the required variables when the PUT /v1/apps/{appID}/bricks/{brickID} is called.
If the request body does not contain a value for a required variable, the operation fails.

Additionally, the issue is not present when an app is cloned.
This is because a cloned app already has the arduino:arduino_cloud brick configured in the app.yaml. In this scenario, the FE manages the required variables correctly by asking the users to fill in the required variables.

Change description

Do not fail with an error, but log a Warning and put the required variable as an empty string

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@dido18 dido18 changed the title fix(api): add brick allow empry required variable fix(api): allow empty required variable when a brick id added Nov 12, 2025
@dido18 dido18 changed the title fix(api): allow empty required variable when a brick id added fix(api): allow empty required variable when a brick is added Nov 12, 2025
@dido18 dido18 changed the title fix(api): allow empty required variable when a brick is added fix(api): allow missing required variable when a brick is added Nov 12, 2025
@dido18
Copy link
Contributor Author

dido18 commented Nov 12, 2025

Test: create an app from scratch

  1. Create an app from scratch
# app.yaml: The main configuration file for your Arduino App.
# This file describes the application's metadata and properties.

# The user-visible name of the application.
name: from scratch

# A brief description of what the application does.
description: ""

# The icon for the application can be an emoji or a short string.
icon: 😀

# A list of network ports that the application exposes.
# Example: [80, 443]
ports: []

# A list of bricks used by this application.
bricks: []
  1. Add the Arduino Cloud brick
name: from scratch
description: ""
ports: []
bricks:
- arduino:arduino_cloud: {}
icon: 😀
  1. Set the configuration variables
name: from scratch
description: ""
ports: []
bricks:
- arduino:arduino_cloud:
    variables:
      ARDUINO_DEVICE_ID: a
      ARDUINO_SECRET: b
icon: 😀

@dido18 dido18 marked this pull request as ready for review November 12, 2025 17:24
@per1234 per1234 added the bug Something isn't working label Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: it is not possible to add the Arduino Cloud brick into a newly created app

2 participants