StackStorm / StackStorm/st2

action alias parser, URL interpreted as key value pair

Open
#3,882 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

chatops stale
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

When an alias ends with a string that contains a = character (like an URL), this string is interpreted as key value pair, even it's not meant to be one. Wrapping the string in brackets or quotes does not change the behaviour.
Example:
In the alias definition:

formats:
    - "get status( from)? {{url='http://localhost:8080/api/1.0/list?state=ready'}}"

Chatops command:

!get status from 'http://otherhost:8080/api/1.0/list?state=ready'

Parsing result: {'url': 'http://localhost:8080/api/1.0/list?state=ready', "'http://otherhost:8080/api/1.0/list?state": "ready'"}

If the format is changed to:

formats:
    - "get status( from)? {{url='http://localhost:8080/api/1.0/list?state=ready'}} now"

Then the key value pair detection is skipped and the parsing result is as expected:
{'url': 'http://otherhost:8080/api/1.0/list?state=ready'}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the action alias parser and reproduce the YAML alias and ChatOps command examples from this issue. The fix is done when a trailing URL containing = remains a single value, while genuine key-value pairs continue to be detected correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.