Skip to content

Commit

Permalink
Update json schema to the actual parameters of script_env
Browse files Browse the repository at this point in the history
  • Loading branch information
motus committed Nov 1, 2023
1 parent 6c937d0 commit d890bdd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,35 +88,24 @@
},

"shell_param_type": {
"description": "All parameters must be valid shell variable names, else use shell_env_params_mapping.",
"description": "All parameters must be valid shell variable names, else use shell_env_params_rename.",
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]+$"
},
"shell_env_params_config": {
"type": "object",
"properties": {
"shell_env_params_match": {
"description": "A list of regexes to match against the environment parameters. All matches will be exposed to shell commands as environment variables.",
"type": "array",
"items": {
"type": "string",
"format": "regex",
"examples": [
"^MLOS_[a-zA-Z0-9_]+$"
]
}
},
"shell_env_params": {
"description": "An explicit list of parameters (and their values) to pass to the shell as environment variables. These will override any parameters matched by shell_env_params_match.",
"description": "An explicit list of parameters (and their values) to pass to the shell as environment variables.",
"type": "array",
"items": {
"$ref": "#/$defs/shell_param_type"
},
"uniqueItems": true,
"minItems": 1
},
"shell_env_params_mapping": {
"description": "An explicit mapping of environment variable names from params to be populated with the parameter values and passed to the shell commands. These will override any parameters matched by shell_env_params_match.",
"shell_env_params_rename": {
"description": "An explicit mapping of environment variable names from params to be populated with the parameter values and passed to the shell commands.",
"type": "object",
"propertyNames": {
"$ref": "#/$defs/shell_param_type"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"run": [
"/bin/true"
],
"shell_env_params_mapping": {
"shell_env_params_rename": {
"invalid.target.name": "/source/param/name"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"run": [
"/bin/true"
],
"shell_env_params_mapping": {
"shell_env_params_rename": {
"source_param_num_invalid": 0,
"source_param_bool_invalid": true,
"source_param_null_invalid": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@
"read_results_file": "/tmp/results.csv",
"read_telemetry_file": "/tmp/telemetry.csv",

"shell_env_params_match": [
"^MLOS_[a-zA-Z0-9_]+$"
],
"shell_env_params": [
"foo"
],
"shell_env_params_mapping": {
"shell_env_params_rename": {
"gets_mapped_to_this_env_name": "/source/param/name/that/is/otherwise/invalid/env/name"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@

"results_stdout_pattern": "(\\w+),([0-9.]+)",

"shell_env_params_match": [
"^MLOS_[a-zA-Z0-9_]+$"
],
"shell_env_params": [
"foo"
],
"shell_env_params_mapping": {
"shell_env_params_rename": {
"gets_mapped_to_this_env_name": "/source/param/name/that/is/otherwise/invalid/env/name"
}
}
Expand Down

0 comments on commit d890bdd

Please sign in to comment.