Skip to content
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

web action does not have web in the url, resulting in an invalid link #823

Open
shazron opened this issue Dec 4, 2024 · 7 comments · May be fixed by #824
Open

web action does not have web in the url, resulting in an invalid link #823

shazron opened this issue Dec 4, 2024 · 7 comments · May be fixed by #824
Labels
bug Something isn't working

Comments

@shazron
Copy link
Member

shazron commented Dec 4, 2024

Description

A web action does not have web in the url reported by the CLI, thus when calling it, it is treated as a non-web action and requires auth.

Might be relevant:

  1. the web-export annotation is in the wrong place
  2. the web-custom-options annotation is present

Expected

The web action url reported by the CLI has a valid web url.

Actual

The web action url reported by the CLI does not have a valid web url.

Logs for Repro

aio app deploy output:

$ aio app deploy
✔ Built 11 action(s) for 'application'
ℹ No frontend or a build already exists, skipping frontend build for 'application'
✔ Deployed 20 action(s) for 'application'
no frontend, skipping frontend deploy 'application'
Your deployed actions:
web actions:
...
  -> https://foo.adobeioruntime.net/api/v1/bar/init-target
...
non-web actions:
...
  -> https://foo.adobeioruntime.net/api/v1/bar/__init-target
...

manifest.yaml:

packages:
  foobar:
    license: Apache-2.0
    actions:
      __init-target:
        function: actions/init-target/index.js
        runtime: 'nodejs:22'
        limits:
          memorySize: 1024
        annotations:
          require-adobe-auth: false
          final: true

    sequences:
      init-target:
        actions: '__init-target'
        web-export: raw
        annotations:
          web-custom-options: true
@shazron shazron added the bug Something isn't working label Dec 4, 2024
@aiojbot
Copy link
Collaborator

aiojbot commented Dec 4, 2024

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

@jenssingler
Copy link

When using the incorrect config mentioned above, but downgrading the CLI to 9.3.0 it works as expected: web is in web-actions URL, e.g. https://foo.adobeioruntime.net/api/v1/web/bar/init-target.

@shazron
Copy link
Member Author

shazron commented Dec 4, 2024

I see the commit where it was working in 9.3 but not in 10.x cli - web-export must be in annotations as per spec: https://github.com/adobe/aio-lib-runtime/commit/4cec293955ce3dd73331f691495bbbb561d94160#diff-3a11a46e9fc8a91f5f4a114[…]a8573e864966b8f088c46faR1952 (but I don't think it's the whole picture since it did file it under the web actions section)

@jenssingler
Copy link

I poked around with incorrect configs and 10.3.1 CLI versions - I have these 4 permutations of sequences:

      first:
        actions: '__first'
        web-export: raw
        annotations:
          web-custom-options: true
      second:
        actions: '__second'
        web-export: raw
        web: true
        annotations:
          web-custom-options: true
      third:
        actions: '__third'
        annotations:
          web-custom-options: true
          web-export: raw
      fourth:
        actions: '__fourth'
        web: true
        annotations:
          web-custom-options: true
          web-export: raw

This is the CLI output:

web actions:
  -> https://foo.adobeioruntime.net/api/v1/bar/first
  -> https://foo.adobeioruntime.net/api/v1/web/bar/second
  -> https://foo.adobeioruntime.net/api/v1/web/bar/fourth
non-web actions:
  -> https://foo.adobeioruntime.net/api/v1/web/bar/third

Aside from using incorrect configs, there are some oddities in the output:
first is listed under "web-actions", but does not contain the web in the URL.
third is listed under "non-web actions", but does contain the web in the URL.

@shazron
Copy link
Member Author

shazron commented Dec 4, 2024

web-export manifest spec, it should be under the action annotations:
https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_actions.md

Note: even though raw-http in the table from the link above shows as a field, it is actually an annotation:
https://github.com/apache/openwhisk/blob/master/docs/annotations.md

To investigate, update code that is not up to the above spec and write failing tests, then fix:

  1. https://github.com/adobe/aio-lib-runtime/blob/bb534557ce7803b49486da17895baa602c07f991/src/utils.js#L816
  2. https://github.com/adobe/aio-lib-runtime/blob/bb534557ce7803b49486da17895baa602c07f991/src/utils.js#L63
  3. const web = entities.actions.filter(createWebExportFilter(true))
  4. const web = deployedRuntimeEntities.actions.filter(createWebExportFilter(true))

@shazron
Copy link
Member Author

shazron commented Dec 9, 2024

filed apache/openwhisk-wskdeploy#1162

@shazron
Copy link
Member Author

shazron commented Dec 10, 2024

Expected Result

re: #823 (comment)

  • first is a non-web-action (web-export is not in annotations)
  • second is a web-action (web: true)
  • third is a web-action (web-export: raw in annotations)
  • fourth is a web-action (web-export: raw in annotations)

Expected Output

web actions:
  -> https://foo.adobeioruntime.net/api/v1/web/bar/second
  -> https://foo.adobeioruntime.net/api/v1/web/bar/third
  -> https://foo.adobeioruntime.net/api/v1/web/bar/fourth
non-web actions:
  -> https://foo.adobeioruntime.net/api/v1/bar/first

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
3 participants