-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add plugin commands #110
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
base: main
Are you sure you want to change the base?
Changes from all commits
aeb6370
f593d8f
ff60caf
01c25e7
182bb8e
1bd1f6f
9f60455
733b703
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,24 +168,6 @@ | |
| "enum": ["CAN_USE"], | ||
| "description": "Permission for Databricks App resources" | ||
| }, | ||
| "resourcePermission": { | ||
| "type": "string", | ||
| "description": "Permission level required for the resource. Valid values depend on resource type.", | ||
| "oneOf": [ | ||
| { "$ref": "#/$defs/secretPermission" }, | ||
| { "$ref": "#/$defs/jobPermission" }, | ||
| { "$ref": "#/$defs/sqlWarehousePermission" }, | ||
| { "$ref": "#/$defs/servingEndpointPermission" }, | ||
| { "$ref": "#/$defs/volumePermission" }, | ||
| { "$ref": "#/$defs/vectorSearchIndexPermission" }, | ||
| { "$ref": "#/$defs/ucFunctionPermission" }, | ||
| { "$ref": "#/$defs/ucConnectionPermission" }, | ||
| { "$ref": "#/$defs/databasePermission" }, | ||
| { "$ref": "#/$defs/genieSpacePermission" }, | ||
| { "$ref": "#/$defs/experimentPermission" }, | ||
| { "$ref": "#/$defs/appPermission" } | ||
| ] | ||
| }, | ||
| "resourceFieldEntry": { | ||
| "type": "object", | ||
| "required": ["env"], | ||
|
|
@@ -219,13 +201,13 @@ | |
| }, | ||
| "alias": { | ||
| "type": "string", | ||
| "pattern": "^[a-z][a-zA-Z0-9_]*$", | ||
| "minLength": 1, | ||
| "description": "Human-readable label for UI/display only. Deduplication uses resourceKey, not alias.", | ||
| "examples": ["SQL Warehouse", "Secret", "Vector search index"] | ||
| }, | ||
| "resourceKey": { | ||
| "type": "string", | ||
| "pattern": "^[a-z][a-zA-Z0-9_]*$", | ||
| "pattern": "^[a-z][a-z0-9-]*$", | ||
| "description": "Stable key for machine use: deduplication, env naming, composite keys, app.yaml. Required for registry lookup.", | ||
| "examples": ["sql-warehouse", "database", "secret"] | ||
| }, | ||
|
|
@@ -235,7 +217,8 @@ | |
| "description": "Human-readable description of why this resource is needed" | ||
| }, | ||
| "permission": { | ||
| "$ref": "#/$defs/resourcePermission" | ||
| "type": "string", | ||
| "description": "Required permission level. Validated per resource type by the allOf/if-then rules below." | ||
| }, | ||
| "fields": { | ||
| "type": "object", | ||
|
|
@@ -246,7 +229,137 @@ | |
| "description": "Map of field name to env and optional description. Single-value types use one key (e.g. id); multi-value (database, secret) use multiple (e.g. instance_name, database_name or scope, key)." | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| "additionalProperties": false, | ||
| "allOf": [ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh man, this is getting super complicated 🤔 We could use "additionalProperties": true,
"oneOf": [
{
"properties": {
"type": { "const": "secret" },
"permission": { "$ref": "#/$defs/secretPermission" }
}
},
{
"properties": {
"type": { "const": "job" },
"permission": { "$ref": "#/$defs/jobPermission" }
}
}
// ... etc
]WDYT? is much simpler without ifs - but requires allowed additional properties (IMO that's not an issue as we validate the fields we need anyway)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it makes it simpler in terms of the schema, but when running validation is much better having the allOf, I'll see if I can achieve the same behavior using oneOf |
||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "secret" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "permission": { "$ref": "#/$defs/secretPermission" } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "job" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { "permission": { "$ref": "#/$defs/jobPermission" } } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "sql_warehouse" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "permission": { "$ref": "#/$defs/sqlWarehousePermission" } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "serving_endpoint" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "permission": { "$ref": "#/$defs/servingEndpointPermission" } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "volume" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "permission": { "$ref": "#/$defs/volumePermission" } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "vector_search_index" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "permission": { "$ref": "#/$defs/vectorSearchIndexPermission" } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "uc_function" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "permission": { "$ref": "#/$defs/ucFunctionPermission" } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "uc_connection" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "permission": { "$ref": "#/$defs/ucConnectionPermission" } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "database" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "permission": { "$ref": "#/$defs/databasePermission" } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "genie_space" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "permission": { "$ref": "#/$defs/genieSpacePermission" } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "experiment" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "permission": { "$ref": "#/$defs/experimentPermission" } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "properties": { "type": { "const": "app" } }, | ||
| "required": ["type"] | ||
| }, | ||
| "then": { | ||
| "properties": { "permission": { "$ref": "#/$defs/appPermission" } } | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| "configSchemaProperty": { | ||
| "type": "object", | ||
|
|
||
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.
BTW IMO much clearer label would be
displayName- but not sure if that's the best moment to change it 😄