Comments (3)
I was able to reproduce the problem and have had the time to dig into this issue a little deeper. The err-stackstorm plugin calls match
via StackStorm's API and reports the actionalias doesn't exist. The bug on the plugins side is, it should have reported duplicate matches found. It should be a minor change to fix it so it reports the correct error.
Here is the test environment configuration and execution output: https://gist.github.com/nzlosh/c6d357f7891ee4080977536071dda296. You can see in the end of the gist that even st2
CLI fails to match when 4 variables are supplied.
I used the actionalias code from StackStorm to make a test script which helps visualise the matching logic.
Action Alias Tester
-------------------
Format: 'test {{arg1}}'
Text: 'test hello'
Result: {'arg1': 'hello'}
Format: 'test {{key1}} {{value1}}'
Text: 'test hello world'
Result: {'key1': 'hello', 'value1': 'world'}
Format: 'test {{key1}} {{value1}}'
Text: 'test k1 v1 k2 v2'
Result: {'key1': 'k1', 'value1': 'v1 k2 v2'}
Format: 'test {{key1}} {{value1}} {{ key2 }} {{ value2 }}'
Text: 'test k1 v1 k2 v2'
Result: {'key2': 'k2', 'key1': 'k1', 'value2': 'v2', 'value1': 'v1'}
Format: 'test {{key1}} {{value1}} {{ key2 }} {{ value2 }}'
Text: 'test k1 v1 k2 v2 k3=v3'
Result: {'k3': 'v3', 'key2': 'k2', 'key1': 'k1', 'value2': 'v2', 'value1': 'v1'}
Do you think it's possible to use extra Key-Value Parameters as describe here and just have a single format? E.g.
format: get ip {{tag_key}} {{tag_value}}
User input: 'get ip ec2_tag_cluster qa-blue tag_key2=a tag_value2=b'
Another option would be to use a fixed keyword between the two tags:
Format: 'test {{key1}} {{value1}} and {{ key2 }} {{ value2 }}'
Text: 'test k1 v1 and k2 v2'
Result: {'key2': 'k2', 'key1': 'k1', 'value2': 'v2', 'value1': 'v1'}
from err-stackstorm.
After thinking on it a bit more the 2nd option will still generate two matches, so adding the and keyword isn't a solution. It looks like Key-Value Parameters is the reliable way to setup the action alias.
from err-stackstorm.
Closing this issue since action aliases are working as designed.
from err-stackstorm.
Related Issues (17)
- user not mentioned with reply HOT 2
- MESSAGE_SIZE_LIMIT not honoured HOT 3
- Implement unit tests HOT 1
- Proposal: Out of Band chat backend user authentication HOT 1
- Action alias keyword arguments aren't cleared correctly.
- Support mention for the bot to trigger action-aliases
- Setup issues HOT 6
- Missing step in guide: change post_message.yaml default route HOT 1
- Honour action-alias definition correctly HOT 1
- Rocketchat - error install plugin and callback HOT 6
- Is this repo under active maintenance? HOT 4
- ack.enabled related error while running st2 commands HOT 1
- Possibility of adding threading? HOT 1
- Action-aliases changes in StackStorm aren't being updated in errbot
- Installation documentation missing chatops pack step
- Fix SSL certificate verification. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from err-stackstorm.