adobe / aio-cli-plugin-app

Create, Build and Deploy Cloud Native Applications
Apache License 2.0
19 stars 35 forks source link

`waitForOpenWhiskReadiness` should poll the root path, not the api path #363

Open shazron opened 3 years ago

shazron commented 3 years ago

See: https://github.com/adobe/aio-cli-plugin-app/blob/36027b9ff67bb6473cd6e26360d8baa42fa66e89/src/lib/app-helper.js#L289

The path being polled is /api/v1 which could possibly change in the future thus this call is not future-proof. It's possible that if the path is removed, but the server is still running, our poll will think OW is not ready.

The proper path to poll is the / root path, which returns JSON metadata:

{
    "api_paths": [
        "/api/v1"
    ],
    "description": "OpenWhisk",
    "limits": {
        "actions_per_minute": 60,
        "concurrent_actions": 30,
        "max_action_duration": 300000,
        "max_action_logs": 10485760,
        "max_action_memory": 536870912,
        "min_action_duration": 100,
        "min_action_logs": 0,
        "min_action_memory": 134217728,
        "sequence_length": 50,
        "triggers_per_minute": 60
    },
    "runtimes": {
        "nodejs": [
            {
                "attached": false,
                "default": true,
                "deprecated": false,
                "image": "adobeapiplatform/adobe-action-nodejs-v12:3.0.22",
                "kind": "nodejs:12",
                "requireMain": false
            },
            {
                "attached": false,
                "default": false,
                "deprecated": false,
                "image": "adobeapiplatform/adobe-action-nodejs-v10:3.0.22",
                "kind": "nodejs:10",
                "requireMain": false
            }
        ]
    },
    "support": {
        "github": "https://github.com/apache/openwhisk/issues",
        "slack": "http://slack.openwhisk.org"
    }
}
aiojbot commented 2 years ago

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-1616