Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = tests/*
48 changes: 32 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: CI
on:
push:
branches:
- main
- release-*
- main
- release-*
pull_request: {}
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -53,22 +53,38 @@ jobs:
# - name: Lint
# run: hatch run lint:check

unit-test:
test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Setup Hatch
run: pipx install hatch==1.14.1

- name: Run Unit Tests
run: hatch run test:unit
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Setup Hatch
run: pipx install hatch==1.14.1

- name: Run Unit Tests
run: hatch run test:ci

- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@v1.1.54
with:
badge-title: Coverage
title: Coverage Report
pytest-xml-coverage-path: reports/pytest-coverage.xml
junitxml-title: Unit Tests
junitxml-path: reports/pytest-junit.xml
#hide-badge: false
#hide-report: false
#create-new-comment: false
#hide-comment: false
#report-only-changed-files: false
#remove-link-from-badge: false
#unique-id-for-comment: python3.8

# We want to build most packages for the amd64 and arm64 architectures. To
# speed this up we build single-platform packages in parallel. We then upload
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
reports/

# Translations
*.mo
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ region = request.observed.composite.resource.spec.region
region = request['observed']['composite']['resource']['spec']['region']
```
Getting values from free form map and list values will not throw
errors for keys that do not exist, but will return an empty placeholder
errors for keys that do not exist, but will return an unknown placeholder
which evaluates as False. For example, the following will evaluate as False
with a just created RunFunctionResponse message:
```python
Expand All @@ -97,7 +97,7 @@ Note that maps or lists that do exist but do not have any members will evaluate
as True, contrary to Python dicts and lists. Use the `len` function to test
if the map or list exists and has members.

When setting fields, all empty intermediary placeholders will automatically
When setting fields, all intermediary unknown placeholders will automatically
be created. For example, this will create all items needed to set the
region on the desired resource:
```python
Expand All @@ -114,6 +114,7 @@ The following functions are provided to create Protobuf structures:
| ----- | ----------- |
| Map | Create a new Protobuf map |
| List | Create a new Protobuf list |
| Unknown | Create a new Protobuf unknown placeholder |
| Yaml | Create a new Protobuf structure from a yaml string |
| Json | Create a new Protobuf structure from a json string |
| Base64Encode | Encode a string into base 64 |
Expand Down
39 changes: 0 additions & 39 deletions examples/function-go-templating/conditions/README.md

This file was deleted.

84 changes: 0 additions & 84 deletions examples/function-go-templating/context/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ spec:
kind: XR
mode: Pipeline
pipeline:

- step: render-templates
functionRef:
name: function-pythonic
Expand All @@ -18,7 +17,7 @@ spec:
composite: |
class Composite(BaseComposite):
def compose(self):
buckets = self.requireds.bucket('s3.aws.upbound.io/v1beta1', 'Bucket', f"my-awesome-{self.spec.environment}-bucket")
buckets = self.requireds.bucket('s3.aws.upbound.io/v1beta1', 'Bucket', name=f"my-awesome-{self.spec.environment}-bucket")
for ix, bucket in enumerate(buckets):
r = self.resources[f"bucket-configmap-{ix}"]('kubernetes.crossplane.io/v1alpha1', 'Object')
r.spec.providerConfigRef.name = 'kubernetes'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ spec:
status:
atProvider:
id: random-bucket-id

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ spec:
s = self.resources.flexServer(apiVersion, 'FlexibleServer')
s.spec.providerConfigRef.name = 'my-provider-cfg'
s.spec.forProvider.storageMb = 32768
if s.status.atProvider.id:
c = self.resources.flexServerConfig(apiVersion, 'FlexibleServerConfiguration')
c.spec.providerConfigRef.name = 'my-provider-cfg'
c.spec.forProvider.serverId = s.status.atProvider.id
c = self.resources.flexServerConfig(apiVersion, 'FlexibleServerConfiguration')
c.spec.providerConfigRef.name = 'my-provider-cfg'
c.spec.forProvider.serverId = s.status.atProvider.id

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions examples/function-go-templating/functions/include/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ spec:
kind: XR
mode: Pipeline
pipeline:

- step: render-templates
functionRef:
name: function-pythonic
Expand Down
Loading