-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add e2e support for setting backend via Policy #630
Add e2e support for setting backend via Policy #630
Conversation
db40490
to
3879e09
Compare
291ef2c
to
99f99f1
Compare
99f99f1
to
c9f0c7f
Compare
e78a8ae
to
9848484
Compare
9848484
to
7066856
Compare
05e7b08
to
5a4a9b9
Compare
0e1ff6b
to
7c8a5e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cf144d8
to
020110a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM - I just posted very last comments as I noticed an improvement with quoting all the names (aliases, type references, etc.).
(remember about switching manifest location to the capactio/hub-manifests#main
for make dev-cluster
)
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:
Build Capact CLI:
make build-tool-cli
and use for all below commands.Create TypeInstances for update and download:
Create Helm storage TypeInstance:
Scenarios
Success:
Create action with default (built-in) storage as Policy is empty and Implementation doesn't use any
required
backend.capact act create cap.interface.capactio.capact.validation.action.passing --name test --type-instances-from-file /tmp/act-input-ti.yaml
Create action with default storage based on
typeinstace
Policy.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.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.Related issue(s)
backend.id
(Policy, Workflow, GraphQL) #624