adobe / adobe/aio-cli-plugin-runtime

`aio rt trigger create` fails to create a trigger with a feed from /whisk.system/alarms package

Đang mở
#269 13 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
JavaScript
Star
21
Fork
33
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Describe the bug**
Creating a trigger that has a feed (any of the alarms package feeds) fails with a `Feed name is not valid` error.

**Example command failing with an error**
```
$ aio rt trigger create my-trigger -f /whisk.system/alarms/once -p date "2022-10-26T11:00:00.000Z" -v
2022-10-26T10:25:23.920Z aio-cli-plugin-runtime {
apiversion: 'v1',
apihost: 'https://adobeioruntime.net',
namespace: '******************',
api_key: ''******************'
}
2022-10-26T10:25:23.920Z @adobe/aio-lib-runtime:RuntimeAPI:debug init options: {
"apiversion": "v1",
"apihost": "https://adobeioruntime.net",
"namespace": "'******************",
"api_key": "'******************"
}
2022-10-26T10:25:23.922Z @adobe/aio-lib-runtime:RuntimeAPI:debug proxy settings not found
2022-10-26T10:25:25.344Z aio-cli-plugin-runtime OpenWhiskError: PUT https://adobeioruntime.net/api/v1/namespaces/******************/triggers/my-trigger Returned HTTP 400 (Bad Request) --> "Feed name is not valid"
at (...)
» Error: failed to create the trigger: feed name is not valid (400 Bad
» Request)
» specify --verbose flag for more information
```
_namespace and APi key obfuscated_

This looks like related to a leading slash, as the same command executed with `wsk cli` works:
```
$ wsk trigger create my-trigger -f whisk.system/alarms/once -p date "2022-10-26T11:00:00.000Z"
ok: invoked /whisk.system/alarms/once with id 3de991f748c94834a991f748c9783431
{
"actionHost": "10.216.0.50",
"activationId": "3de991f748c94834a991f748c9783431",
"annotations": [
{
"key": "path",
"value": "whisk.system/alarms/once"
},
{
"key": "waitTime",
"value": 128
},
{
"key": "kind",
"value": "nodejs:10"
},
{
"key": "timeout",
"value": false
},
{
"key": "limits",
"value": {
"concurrency": 1,
"logs": 10,
"memory": 256,
"timeout": 60000
}
},
{
"key": "initTime",
"value": 158
}
],
"duration": 2277,
"end": 1666781688181,
"invokerInstanceId": {
"instance": 4,
"instanceType": "invoker",
"uniqueName": "rt-invoker-4",
"userMemory": "1500000000000000 B"
},
"logs": [],
"name": "once",
"namespace": "******************",
"podName": "wskrt-invoker-44-370593-prewarm-nodejs10",
"publish": false,
"response": {
"result": {
"status": "success"
},
"size": 20,
"status": "success",
"success": true
},
"start": 1666781685904,
"subject": "******************",
"version": "0.0.245"
}
ok: created trigger my-trigger
```

Trying to use `aio cli trigger create` without the leading slash generates another error `The requested resource does not exist`
```
$ aio rt trigger create my-trigger -f whisk.system/alarms/once -p date "2022-10-26T11:00:00.000Z" -v
(...)
2022-10-26T10:40:22.974Z @adobe/aio-lib-runtime:RuntimeAPI:debug proxy settings not found
2022-10-26T10:40:26.448Z aio-cli-plugin-runtime OpenWhiskError: POST https://adobeioruntime.net/api/v1/namespaces/******************/actions/alarms/once Returned HTTP 404 (Not Found) --> "The requested resource does not exist."
at (...)
» Error: failed to create the trigger: the requested resource does not
» exist. (404 Not Found)
» specify --verbose flag for more information

```

Note that in addition the working command does not align with the documentation which instructs to provide leading slash.
Documentation examples:
* [creating trigger using wsk cli](https://developer.adobe.com/runtime/docs/guides/reference/prepackages/)
* [creating trigger using app builder manifest file](https://developer.adobe.com/app-builder/docs/resources/cron-jobs/lesson2/)

**Expected behavior**
The `aio cli trigger create ` works as documented.
The App Builder app deployment (`aio app run`) works as well and allows to create triggers along actions during deployment.

**Versions:**
- OS: Windows 10 Pro
- aio cli: 9.1.0
- wsk cli: 1.2.0-windows-386
- node: 14.17.0

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách theo dõi lệnh `aio rt trigger create` và cách xử lý feed của lệnh, sử dụng ví dụ không thành công `/whisk.system/alarms/once` và lệnh `wsk` đang hoạt động để so sánh. Xác minh hành vi đối với tên feed có và không có dấu gạch chéo ở đầu, sau đó xác nhận rằng lệnh được tài liệu hóa hoạt động và hành vi deployment của App Builder vẫn được giữ nguyên.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.