StackStorm / StackStorm/st2

dynamic sensors/rules

Open
#4,389 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

SUMMARY

Trying to find a way to implement dynamic sensors/rules

ISSUE TYPE

The kubernetes pack has a sensor that watches for the creation of third party resources (TPR - a type of resource within kubernetes that makes the api extensible). When a TPR is created, a new API endpoint is created within kubernetes, and the stackstorm kubernetes pack creates a new sensor to watch that endpoint.

When an instance of a TPR is created, we have a second pack thats specific to our platform that watches these new sensors via rules/triggers, and reacts to additions to them.

The problem lies in the ordering. When a trigger is fired, a rule should spot it. That rule needs to exist before the trigger is fired, otherwise it misses the event, and a sensor restart is required (after the rule has been created) to re-emit the trigger automatically.

So the question becomes how can I create a rule that kicks off a workflow based on a generated sensor, when the sensor doesn't exist when stackstorm is started?

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 with the Kubernetes pack's generated sensors and the rules/triggers that consume them, then trace how workflows are registered and how sensor events are emitted. The issue names no files or tests, so first clarify the intended lifecycle and ordering behavior with maintainers. Done means an agreed design and corresponding coverage for rules reacting to sensors created after startup.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, python
Domain
backend-api-design, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.