-
Notifications
You must be signed in to change notification settings - Fork 60
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 'experimental/python' support #2052
base: main
Are you sure you want to change the base?
Conversation
@@ -441,9 +547,9 @@ func createInitOverrideVisitor(ctx context.Context) merge.OverrideVisitor { | |||
} | |||
|
|||
func isOmitemptyDelete(left dyn.Value) bool { | |||
// PyDABs can omit empty sequences/mappings in output, because we don't track them as optional, | |||
// Python can omit empty sequences/mappings in output, because we don't track them as optional, |
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.
I find the original sentence more clear, "Python can omit empty sequences/mappings in output" does not make sense, as I assume Python is CPython binary.
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.
👍 We are getting rid of "PyDABs" name, so we can't use it anymore. I've rephrased it the same way as it was in the unit test.
"pattern": "\\$\\{(var(\\.[a-zA-Z]+([-_]?[a-zA-Z0-9]+)*(\\[[0-9]+\\])*)+)\\}" | ||
} | ||
] | ||
}, |
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.
Please execute "make schema" to update this.
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.
Minor comments, otherwise LGTM
## Changes I noticed a diff in the schema in #2052. This check should be performed automatically. ## Tests This PR includes a commit that changes the schema to check that the workflow actually fails.
673b7fd
to
29d5da2
Compare
@@ -137,7 +225,7 @@ func createCacheDir(ctx context.Context) (string, error) { | |||
// support the same env variable as in b.CacheDir | |||
if tempDir, exists := env.TempDir(ctx); exists { | |||
// use 'default' as target name | |||
cacheDir := filepath.Join(tempDir, "default", "pydabs") | |||
cacheDir := filepath.Join(tempDir, "default", "python") |
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.
For later:
// b.CacheDir doesn't work because target isn't yet selected
This no longer holds in the new world and can be cleaned up.
case PythonMutatorPhaseLoadResources: | ||
return createLoadResourcesOverrideVisitor(ctx), nil | ||
case PythonMutatorPhaseApplyMutators: | ||
return createInitOverrideVisitor(ctx, insertResourceModeDisallow), nil |
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.
For later: include comments how the first 2 apply to the deprecated mode and the last 2 to the new mode.
An issue with the linter prevents the merge. @kanterov I'm updating the PR to let it merge. |
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Changes
Add
experimental/python
section replacingexperimental/pydabs
.Add 2 new mutators into existing pipeline:
ApplyPythonMutator(load_resources)
- loads resources from Python codeApplyPythonMutator(apply_mutators)
- transforms existing resources defined in Python/YAMLExample:
Tests
Unit tests and manually