Skip to content

Conversation

negz
Copy link
Member

@negz negz commented Jul 19, 2025

Description of your changes

Fixes #162

This PR adds helpers to the Python SDK to make writing operation functions easier. Operation functions use the same FunctionRunnerService RPC as composition functions.

The new request.py module provides functions to get required resources (previously called "extra resources" in composition functions) and includes a helper specifically for accessing watched resources in WatchOperations. The response.py module gets new functions to set operation output and build resource requirements

I have:

@negz negz requested a review from bobh66 as a code owner July 19, 2025 00:20
negz added 3 commits August 4, 2025 19:24
This PR adds helpers to the Python SDK to make writing operation
functions easier. Operation functions use the same FunctionRunnerService
RPC as composition functions, but they have different patterns for
accessing required resources and returning output data.

The new request.py module provides functions to get required resources
(previously called "extra resources" in composition functions) and
includes a helper specifically for accessing watched resources in
WatchOperations. The response.py module gets new functions to set
operation output and build resource requirements

Signed-off-by: Nic Cope <[email protected]>
We still add required_resources though, as the new (preferred) way to do
the same thing.

Signed-off-by: Nic Cope <[email protected]>
Copy link
Collaborator

@bobh66 bobh66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks fine as a baseline, I'm sure there are additional helper methods that will be useful once we know what the usage patterns look like. I'm still stumbling over "required" resources, since they aren't always required, but naming is hard and we have more important things to worry about.

@negz negz merged commit 3972d64 into crossplane:main Aug 5, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add operation function support
2 participants