Datastore item access in python code is confusing.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
User set a datastore item using st2 key set foo bar. Now the user wants to access foo from inside python action. So he did something like
self.action_service.get_value('foo')
This returns None because the default lookup is a namespaced lookup with namespace being pack.class_name (local=True). In addition to local, we also have scope. This confuses users further.
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 with the Python action API around self.action_service.get_value('foo') and compare it with the st2 key set foo bar CLI behavior. Determine where the local and scope lookup rules are documented or exposed, then make the expected access pattern and completion criteria explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100