Remove nonexistent actions from database when upgrading/downgrading a pack
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
SUMMARY
Actions are not removed when upgrading/downgrading packs.
ISSUE TYPE
- Bug Report
STACKSTORM VERSION
Paste the output of st2 --version:
st2 3.0dev (7524cc8), on Python 2.7.12
(on st2cicd037)
OS / ENVIRONMENT / INSTALL METHOD
Ubuntu 16.04.5 LTS
Installed via st2cicd.build-controller
STEPS TO REPRODUCE
- Install most recent version of AWS pack.
- Note all of the actions, specifically the
aws.ec2_describe_instancesaction exists and is runnable from theActionstab in the web UI and from a workflow task. - Install AWS pack from the
v0.10.0orv0.10.1tags usingst2 pack install ...WITHOUT runningst2 pack remove aws. - Note all of the actions, specifically the
aws.ec2_describe_instancesaction still exists, and is even runnable from theActionstab in the web UI. - Create a workflow that calls
aws.ec2_describe_instancesfrom a task. Note the incomprehensible error.
Action metadata:
---
name: remote_windows
runner_type: orquesta
description: ...
enabled: true
entry_point: workflows/remote_windows.yaml
parameters:
instance_id:
type: string
description: EC2 instance ID
Workflow:
---
version: '1.0'
description: Remote into a Windows EC2 instance
input:
- instance_id
tasks:
get_instance:
action: aws.ec2_describe_instances
input:
InstanceIds: <% ctx().instance_id %>
EXPECTED RESULTS
A better error message is desirable, but it is probably easier to simply remove all actions that exist in the database but not in an action metadata file when running st2 pack install ....
ACTUAL RESULTS
An incomprehensible error:
{
"output": null,
"errors": [
{
"message": "SyntaxError: unexpected EOF while parsing (<unknown>, line 0)",
"type": "error",
"task_id": "get_instance"
}
]
}
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 at the st2 pack install entry point and trace how action metadata is handled when upgrading or downgrading a pack. Reproduce with the AWS pack versions described, then verify that actions absent from the installed metadata are removed from the database and that workflows no longer resolve them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, databases, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100