output:
typeInstances:
backend:
id: "123" # backend ref in which TI is stored
abstract: true/false # whether ref. backend is abstract or not
Propagate backend data into TypeInstance output under Action CRD
Update Engine GraphQL to show backend information for output TypeInstance
update Go clients
add unit-test coverage
Update Local Hub GraphQL schemas and examples.
Add TypeInstanceBackend and handle it properly in Cypher. This is a draft implementation but already gives us a huge benefit as it enabled an option to create e2e test and protect current contract. If we rewrite/refactor Local Hub, we can protect ourselves from regressions.
Ensure that core storage is registered when Local Hub starts.
Add support for setting backend based on TypeRefs via Global Policy and Action Policy (support custom merging):
typeInstance:
rules:
- typeRef:
path: "cap.type.aws.auth.credentials"
revision: "0.1.0" # optional, if not provided, applies to any revision
backend:
id: "00fd161c-01bd-47a6-9872-47490e11f996" # Vault backend storage
Pattern matching:
// GetByTypeRef returns storage backend for a given TypeRef.
// If backend for an explicit TypeRef is not found, the pattern matching is used.
//
// For example, if TypeRef is `cap.type.capactio.examples.message:0.1.0`:
// - cap.type.capactio.examples.*:0.1.0
// - cap.type.capactio.examples.*
// - cap.type.capactio.*:0.1.0
// - cap.type.capactio.*
// - cap.type.*:0.1.0
// - cap.type.*
// - cap.*:0.1.0
// - cap.*
//
add Policy validation.
Extends workflow syntax with capact-outputTypeInstance[*].backend
Update Argo renderer to support backends based on TypeRef or capact-outputTypeInstance[*].backend alias. Once rendered the delegated backend storage is deterministic as it's "hardcoded" to a given ID.
Add integration test for:
Success:
Create action with default storage
Empty Policy -> uses builtin storage
Policy with TypeRef defaults -> uses a given backend ID
Create action with Helm storage (requires)
Policy with requires under interface.
Policy with default requires + override with interface specific requires (Will be done in follow-up PR when global default will be implemented)
Other:
now make dev-cluster(-update) accepts COMPONENTS and BUILD_IMAGES_LIST envs. TODO: update dev doc on website.
fix setting Hub manifests during capact install.
Testing
Integration tests prove that it works but here is also a “manual” opt to run a few examples:
Build Capact CLI: make build-tool-cli and use for all below commands.
message: |-
Cannot render given action: while rendering Action: while listing ImplementationRevisions for Interface "cap.interface.capactio.capact.validation.action.passing:": while TypeInstance metadata validation after resolving TypeRefs:
- Metadata for "BackendTypeInstance":
* Type reference ID: "2f856900-1b03-488e-8212-f7d86c2ae3e2", description: "Default Hub backend storage via TypeRef" is not a Hub storage (will retry - 10/15)
Create action without storage injected as requires part
message: 'Cannot render given action: while rendering Action: while picking ImplementationRevision
for Interface "cap.interface.capactio.capact.validation.action.passing:": No
Implementations found with current policy for given Interface (will retry -
3/15)'
Create action with wrong type as storage injected as requires part
message: 'Cannot render given action: while rendering Action: while picking ImplementationRevision
for Interface "cap.interface.capactio.capact.validation.action.passing:": No
Implementations found with current policy for given Interface (will retry -
3/15)'
message: 'Cannot render given action: while rendering Action: while noting output
artifacts: while resolving backend ID for testUpload: TypeInstance with "injected"
alias is not a Hub storage (will retry - 0/15)'
message: 'Cannot render given action: while rendering Action: while noting output
artifacts: while resolving backend ID for testUpload: cannot find backend storage
for specified something alias (will retry - 11/15)'
Description
Changes proposed in this pull request:
Changes
Logger aware Argo Renderer
Update CRD:
Update Engine GraphQL to show backend information for output TypeInstance
Update Local Hub GraphQL schemas and examples.
TypeInstanceBackend
and handle it properly in Cypher. This is a draft implementation but already gives us a huge benefit as it enabled an option to create e2e test and protect current contract. If we rewrite/refactor Local Hub, we can protect ourselves from regressions.Ensure that core storage is registered when Local Hub starts.
Add support for setting backend based on TypeRefs via Global Policy and Action Policy (support custom merging):
Extends workflow syntax with
capact-outputTypeInstance[*].backend
Update Argo renderer to support backends based on TypeRef or
capact-outputTypeInstance[*].backend
alias. Once rendered the delegated backend storage is deterministic as it's "hardcoded" to a given ID.Add integration test for: Success:
Other:
COMPONENTS
andBUILD_IMAGES_LIST
envs. TODO: update dev doc on website.Testing
Integration tests prove that it works but here is also a “manual” opt to run a few examples:
make build-tool-cli
and use for all below commands.Create TypeInstances for update and download:
Scenarios
Success:
Create action with default (built-in) storage as Policy is empty and Implementation doesn't use any
required
backend.Example output:
Create action with default storage based on
typeinstace
Policy.Example output:
Create Action with Helm storage, which is enforced in Implementation
requires
section.Create required TypeInstance:
Update Global Policy:
Create Action input:
Run Action
capact act run & capact act watch
Get Action output TypeInstances:
Example output:
Check with
capact ti get
thatuses
were properly set for a given Storage Backends.Above scenarios can be repeated with Action Policy which will override the Global Policy.
Failures:
Create action with wrong type as storage for TypeRef
Expected output:
Create action without storage injected as requires part
Expected output:
Create action with wrong type as storage injected as requires part
Expected output:
Wrong
capact-outputTypeInstances[].backend
type.injected
in https://github.com/mszostok/os-hub-manifests/blob/policy-syntax/type-instances/manifests/implementation/capactio/capact/validation/action/passing-b.yaml#L73. Next, populate updated manifests.Expected output:
Missing
capact-outputTypeInstances[].backend
type.something
in https://github.com/mszostok/os-hub-manifests/blob/policy-syntax/type-instances/manifests/implementation/capactio/capact/validation/action/passing-b.yaml#L73. Next, populate updated manifests.Expected output:
Related issue(s)