Arjen10 commented on PR #13862:
URL: https://github.com/apache/apisix/pull/13862#issuecomment-5534683719
> Thanks for fixing the CI lint, however a few points need to be addressed:
>
> 1. CI lint. `apisix/plugins/workflow.lua:144` uses the global `type`
without `local type = type`, so `lj-releng` errors. You can run CI locally
first to check if it passes.
> 2. Empty `actions: []` still crashes at runtime. Schema has `minItems` on
each action but not on actions itself, so the validation loop is a no-op. Admin
API returns passed, then every request on that rule gets 500 at
`workflow.lua:174` (`rule.actions[1]` is nil).
> 3. Non-string action name 500s. `workflow.lua:141` concatenates
`action[1]`, so `[true], [{}], [null]` crash with attempt to concatenate.
> 4. Test gap. New tests only unit-call check_schema. No Admin-API-level
error_code: 400 assertion for the issue's repro, no empty-actions case.
`t/plugin/workflow2.t:316` has the pattern to reuse.
>
> Design: One schema change beats the guard by declaring actions.items as
[string, object] with minItems: 2. WDYT?
Thank you for the code review. i went throuth the [workflow plugin
doc](https://apisix.apache.org/zh/docs/apisix/plugins/workflow/) again. i think
your solution is better. i will fix it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]