crossplane-contrib / crossplane-contrib/function-kcl
Clearer variable names
- Dominant language
- Go
- Stars
- 87
- Forks
- 44
- Avg merge
- 10h 43m
- Merged PRs (30d)
- 18
Description
### What problem are you facing?
I'm new to KCL, but I'm pretty familiar with Crossplane functions. I'm taking a look at function-kcl for the first time and finding some of the variable names aren't very intuitive.
### How could this Function help solve your problem?
Some early thoughts from my first time working with this function:
* `oxr`, `ocds`, etc are great as optional abbreviations but something like `observed.composite.resource` makes what the variable is a lot clearer. See for example the Python SDK: https://docs.crossplane.io/v1.16/guides/write-a-composition-function-in-python/#edit-the-template-to-add-the-functions-logic
* I believe updating `items` updates the desired resources, right? `items` is a pretty ambiguous name - could it be something that more clearly indicates that it's updating the desired composed resources?
* I don't think any other function has the concept of params, which if I follow correctly can contain user supplied params from the function's input, but also has the observed XR etc injected into it. Would it make sense to break the "fixed" inputs like the observed XR out into top-level variables, rather than injecting them into the params?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the function-kcl entry points that define and consume `oxr`, `ocds`, `items`, and `params`. Clarify the intended naming and whether the proposed restructuring is in scope with maintainers; done means the agreed names and input structure are updated consistently throughout the function.
Written by the indexing model from the issue text.
Assessment
- Domain
- developer-experience
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100