StackStorm / StackStorm/st2

Jinja/Yaql values are not evaluated while loading concurrency policy

Open
#4,417 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

SUMMARY

Provide a quick summary of your bug or feature request.

Consider the following concurrency policy with threshold value being referred from datastore

name: my_action.concurrency
description: Limits the concurrent executions for my action.
enabled: true
resource_ref: demo.my_action
policy_type: action.concurrency
parameters:
    action: delay
    threshold: "{{ st2kv.system.action_concurrency }}"

When loading the policy this jinja expression is not evaluated and fails with following error.

MESSAGE: u'{{ st2kv.system.action_concurrency }}' is not of type u'integer' for url: http://127.0.0.1:9101/v1/policies .
ISSUE TYPE

Pick one below and delete the rest:

  • Bug Report
  • Feature Idea
  • Other
STACKSTORM VERSION

st2 2.7.2, on Python 2.7

OS / ENVIRONMENT / INSTALL METHOD
STEPS TO REPRODUCE

EXPECTED RESULTS
ACTUAL RESULTS

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

Reproduce the policy-loading failure through the /v1/policies endpoint using the YAML example and the st2 2.7.2 environment described. Trace where the Jinja or Yaql value is handled during loading and where the integer validation occurs; done means the datastore expression is evaluated before the threshold type check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.