Make action responses declarative
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
We have 2 issues with the current action system:
- You can't return an object, you must return a dict or a list of dicts otherwise the action runner doesn't deserialise the response correctly. So every action pack has it's own way of acheiving the same thing- mapping iteritems on an instance to a dictionary.
- When writing workflows in Mistral, there is no typeahead or checking for field names in variables, same goes for jinja templates in aliases and rules
What I would really like to see is something like this in .yaml
---
name: balancer_attach_member
runner_type: python-script
description: Attach a member to a load balancer
enabled: true
entry_point: balancer_attach_member.py
parameters:
region:
type: string
description: The region code
default: dd-na
schema:
type: instance|list|dynamic
fields:
id:
type: integer
name:
type: string
Then, the Run method of a BaseAction has a wrapper function which performs a dictionary map based on the schema.
The knock on effects are:
- Mistral can be statically validated
- Jinja templates in rules and aliases can be statically validated instead of the trial and error testing that currently exists
- You can see what the response of an action looks like without having to execute it first, making developing workflows a lot faster
- You don't need to write a mapper function for every action
I appreciate this is very "unpythonic" so the schema type would be dynamic by default for people that don't want to be tied down.
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
Start by tracing the action runner and the BaseAction Run method, then review the proposed action YAML schema and its references to Mistral, Jinja templates, rules, and aliases. Done would mean declarative response schemas support instance, list, and dynamic types, enable validation and response inspection, and retain dynamic behavior by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100