Skip to content

Commit 2e3f007

Browse files
WIP
1 parent 91abe61 commit 2e3f007

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

src/wayscript/context/__init__.py

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
import os
2+
3+
import integration_service
4+
5+
16
def hello_world():
27
"""No-op to test linting/testing CI"""
3-
return "hello, world"
8+
return "hello, world"
9+
10+
def get_process():
11+
"""
12+
Return metadata about the current execution process
13+
14+
This could include things like start time, calculated run time, state, the "execution user", etc.
15+
"""
16+
process_uuid = os.environ["WS_SCRIPT_PROCESS_UUID"]
17+
process_data = integration_service.get_process(process_uuid)
18+
return process_data
19+
20+
21+
# are half of these just pass through calls to the integration service? what value does wayscript.context provide as a wrapper? where do we draw the line?
22+
def get_event():
23+
"""Returns the event object of the execution context"""
24+
pass
25+
26+
27+
def get_trigger():
28+
"""Returns information about the trigger that launched the event"""
29+
pass
30+
31+
32+
def get_lair():
33+
"""Returns lair metadata"""
34+
pass
35+
36+
37+
def get_workspace():
38+
"""Return workspace metadata"""
39+
pass
40+
41+
42+
def get_execution_user():
43+
"""Do we want to create a notion of a "user that this script is being executed as"? Or should we just allow people to look up the lair owner?
44+
45+
I think we need to establish a notion of an execution user because we need to be able to communicate to developers
46+
who api calls will be made on behalf of against wayscript endpoints.
47+
48+
For now, this can just proxy the lair owner. But I think having this layer of abstraction (might?) help us in future when we have more sophisticated execution models?
49+
"""

0 commit comments

Comments
 (0)