Multiple Policies to Govern a single Action/Workflow
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
I've noticed that it's not possible to have multiple policies for a single action/workflow. This is something that would be really useful. Imagine a workflow that has a user and host input, token example. I'd like to be able to do something like:
policies/my_action_hosts.yaml
name: my_pack.my_action.host.concurrency
description: control concurrency of `my_action` by host
resource_ref: my_pack.my_action
parameters:
action: cancel
threshold: 1
attributes:
- hosts
policies/my_action_user.yaml
name: my_pack.my_action.host.concurrency
description: control concurrency of `my_action` by host
resource_ref: my_pack.my_action
parameters:
action: cancel
threshold: 5
attributes:
- user
@cognifloyd @nzlosh do y'all think this is something that might be useful? I'd be interested in contributing to it, if it's possible. Would need to get a dev environment for st2 proper set up.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names policy YAML files for a single action/workflow and separate host and user attributes, but no source files or tests. Set up a st2 development environment, find the policy-loading and enforcement entry points, and trace how one resource reference is handled. Done means multiple policies can govern one action/workflow with their own thresholds and attributes, with tests covering the examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100