StackStorm / StackStorm/st2

Datastore item access in python code is confusing.

Open
#2,955 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation enhancement
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.