aio-cli icon indicating copy to clipboard operation
aio-cli copied to clipboard

aio app deploy is outputting bad urls

Open purplecabbage opened this issue 4 years ago • 4 comments

Expected Behaviour

Url can be loaded after deploy ... (has adobeio-static.net as the domain)

Actual Behaviour

Url is a 404 (has adobeioruntime.net as the domain)

Reproduce Scenario (including but not limited to)

@adobe/aio-cli: 8.2.0

this seems to be a app that was created before extension-points were available (presumably =>) create an application without selecting an extension-point, so you end up with a config like the following ..

aio app info prints an application that looks like:

"application": {
      "app": {
        "hasBackend": true,
        "hasFrontend": true,
        "dist": "/Users/*user*/Projects/*org*/*app-name*/dist/application",
        "defaultHostname": "adobeio-static.net",
        "hostname": "adobeioruntime.net",
        "htmlCacheDuration": "60",
        "jsCacheDuration": "604800",
        "cssCacheDuration": "604800",
        "imageCacheDuration": "604800",
        "name": "content-classification-app",
        "version": "0.0.2"
      },

and aio app deploy prints:

To view your deployed application:
  -> https://<namespace>.adobeioruntime.net/index.html
To view your deployed application in the Experience Cloud shell:
  -> https://experience.adobe.com/?devMode=true#/custom-apps/?localDevUrl=https://<namespace>.adobeioruntime.net/index.html

runtime urls are NEVER the cdn urls for loading the frontend ...

purplecabbage avatar Nov 16 '21 00:11 purplecabbage

For an extension:

   "dx/excshell/1": {
      "app": {
        "hasBackend": true,
        "hasFrontend": true,
        "dist": "/Users/shazron/Desktop/tmp/test-1/dist/dx-excshell-1",
        "defaultHostname": "adobeio-static.net",
        "hostname": "adobeio-static.net",
        "htmlCacheDuration": "60",
        "jsCacheDuration": "604800",
        "cssCacheDuration": "604800",
        "imageCacheDuration": "604800",
        "name": "ShazXRFF4",
        "version": "0.0.2"
      }
}

shazron avatar Nov 16 '21 04:11 shazron

--no-extensions and select default (actions, events, web-assets):

  "application": {
      "app": {
        "hasBackend": true,
        "hasFrontend": true,
        "dist": "/Users/shazron/Desktop/tmp/headless-3/dist/application",
        "defaultHostname": "adobeio-static.net",
        "hostname": "adobeio-static.net",
        "htmlCacheDuration": "60",
        "jsCacheDuration": "604800",
        "cssCacheDuration": "604800",
        "imageCacheDuration": "604800",
        "name": "FooBar",
        "version": "0.0.1"
      }
}

--no-extensions and select only (actions, events) de-select web-assets:

    "application": {
      "app": {
        "hasBackend": true,
        "hasFrontend": false,
        "dist": "/Users/shazron/Desktop/tmp/headless-2/dist/application",
        "defaultHostname": "adobeio-static.net",
        "hostname": "adobeio-static.net",
        "htmlCacheDuration": "60",
        "jsCacheDuration": "604800",
        "cssCacheDuration": "604800",
        "imageCacheDuration": "604800",
        "name": "FooBar",
        "version": "0.0.1"
      }
}

similarly for:

  1. --no-login
  2. --no-login --no-extensions

hostname is never adobeioruntime.net (that domain is only present under the ow key). I asked the person that had the original bug what type of flags they used to create the app so perhaps I can repro, but in the meantime I will inspect the code to see if I can spot anything.

shazron avatar Nov 16 '21 04:11 shazron

For aio app deploy, it's definitely getting it from the config at app.hostname we just need to find out which combination of commands and flags generated the project: https://github.com/adobe/aio-lib-web/blob/697621e0cf3c79db7d43d15889ab82f47e5c7907/src/deploy-web.js#L47

shazron avatar Nov 16 '21 05:11 shazron

The default app.hostname is adobeio-static.net so the dev might have an override in their config: https://github.com/adobe/aio-cli-lib-app-config/blob/17ad2b4202a109f0d9ada8c53cfdf17a381472fd/src/index.js#L22

shazron avatar Nov 16 '21 05:11 shazron