Skip to content

Conversation

@mirkoCrobu
Copy link
Contributor

@mirkoCrobu mirkoCrobu commented Oct 23, 2025

Motivation

To complete the new flow “RUN an app with mandatory configuration”, the mandatory bricks variables should be set before running the app.

Currently, the App Lab to retrieve a mandatory app from an app must do the following:

  • call /v1/apps/{appID}/bricks to list all the instance bricks for the current app(it doesn’t return the bricks variables information)
  • For each brickInstance, it has to call the /v1/apps/{appID}/bricks/{brickID} to check brickInstance variables current value(the response does not contain information about the mandatory requirement of a variable, but just the value).
  • For each brick instance, it has to call the /v1/bricks/{brickID} to check which variable is mandatory.

This set of calls is tedious and inefficient.

Change description

Integrate the /v1/apps/{appID}/bricks/{brickID} and /v1/apps/{appID}/bricks , adding for each brickInstance the config_variables array with the list of variables with their complete information.

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.

@per1234 per1234 added the enhancement New feature or request label Oct 24, 2025
@mirkoCrobu mirkoCrobu self-assigned this Oct 24, 2025
@mirkoCrobu mirkoCrobu requested a review from a team October 24, 2025 07:25
Copy link
Contributor

@dido18 dido18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using a list of variables like this instead of the object with the name of the variable as key?

"variables":[
    {
     "name: "CUSTOM_MODEL_PATH",
      "default_value": "/home/arduino/.arduino-bricks/ei-models",
      "description": "path to the custom model directory",
      "required": false
    },
    {
    "name" "EI_CLASSIFICATION_MODEL",
     "default_value": "/models/ootb/ei/mobilenet-v2-224px.eim",
      "description": "path to the model file",
      "required": false
    }
  ],

@mirkoCrobu
Copy link
Contributor Author

@dido18 I kept the same structure as BrickInstance.Variables for consistency. The only difference is the field default_value becoming value.
But yes, we can use the array that you suggested.
What do you think?

@CLAassistant
Copy link

CLAassistant commented Nov 3, 2025

CLA assistant check
All committers have signed the CLA.

@mirkoCrobu mirkoCrobu force-pushed the issue_809 branch 3 times, most recently from d43f0e5 to 1c1fc7e Compare November 4, 2025 11:31
@mirkoCrobu mirkoCrobu requested review from a team and lucarin91 November 4, 2025 13:13
Copy link
Contributor

@dido18 dido18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Could you add an example of the new json respone in the PR description ?

Thanks

@mirkoCrobu
Copy link
Contributor Author

mirkoCrobu commented Nov 6, 2025

GET http://localhost:8080/v1/apps/ZXhhbXBsZXM6aW1hZ2UtY2xhc3NpZmljYXRpb24/bricks

{
    "bricks": [
        {
            "id": "arduino:web_ui",
            "name": "WebUI - HTML",
            "author": "Arduino",
            "category": "ui",
            "status": "installed"
        },
        {
            "id": "arduino:image_classification",
            "name": "Image Classification",
            "author": "Arduino",
            "category": "video",
            "status": "installed",
            "variables": {
                "CUSTOM_MODEL_PATH": "overidden",
                "EI_CLASSIFICATION_MODEL": "/models/ootb/ei/mobilenet-v2-224px.eim"
            },
            "config_variables": [
                {
                    "name": "CUSTOM_MODEL_PATH",
                    "value": "overidden",
                    "description": "path to the custom model directory",
                    "required": false
                },
                {
                    "name": "EI_CLASSIFICATION_MODEL",
                    "value": "/models/ootb/ei/mobilenet-v2-224px.eim",
                    "description": "path to the model file",
                    "required": false
                }
            ]
        }
    ]
}

@mirkoCrobu
Copy link
Contributor Author

mirkoCrobu commented Nov 6, 2025

GET http://localhost:8080/v1/apps/ZXhhbXBsZXM6aW1hZ2UtY2xhc3NpZmljYXRpb24/bricks/arduino:image_classification

{
    "id": "arduino:image_classification",
    "name": "Image Classification",
    "author": "Arduino",
    "category": "video",
    "status": "installed",
    "variables": {
        "CUSTOM_MODEL_PATH": "overidden",
        "EI_CLASSIFICATION_MODEL": "/models/ootb/ei/mobilenet-v2-224px.eim"
    },
    "config_variables": [
        {
            "name": "CUSTOM_MODEL_PATH",
            "value": "overidden",
            "description": "path to the custom model directory",
            "required": false
        },
        {
            "name": "EI_CLASSIFICATION_MODEL",
            "value": "/models/ootb/ei/mobilenet-v2-224px.eim",
            "description": "path to the model file",
            "required": false
        }
    ],
    "model": "mobilenet-image-classification"
}

@mirkoCrobu mirkoCrobu requested a review from dido18 November 6, 2025 09:07
@mirkoCrobu mirkoCrobu requested a review from dido18 November 6, 2025 10:33
@mirkoCrobu mirkoCrobu requested a review from dido18 November 6, 2025 13:43
@mirkoCrobu mirkoCrobu requested a review from dido18 November 6, 2025 14:06
@mirkoCrobu mirkoCrobu requested a review from dido18 November 6, 2025 14:22
@dido18 dido18 changed the title Integrate bricks details endpoint with variables information feat(api): return variable configurations in /apps/:id/bricks and apps/{appID}/bricks/:id Nov 6, 2025
@dido18 dido18 changed the title feat(api): return variable configurations in /apps/:id/bricks and apps/{appID}/bricks/:id feat(api): return variable configurations in /apps/:id/bricks and apps/:id/bricks/:id Nov 6, 2025
@mirkoCrobu mirkoCrobu requested a review from dido18 November 6, 2025 15:45
Copy link
Contributor

@dido18 dido18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mirkoCrobu mirkoCrobu merged commit c64fbf6 into main Nov 6, 2025
6 checks passed
@mirkoCrobu mirkoCrobu deleted the issue_809 branch November 6, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants