-
Notifications
You must be signed in to change notification settings - Fork 393
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
[Feature] Add databricks_app
resource
#4099
base: main
Are you sure you want to change the base?
Conversation
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.
small changes in the doc required, otherwise code looks good
apps/resource_app.go
Outdated
return err | ||
} | ||
// now deploy the app, using the source code path | ||
createAppDeployment.AppName = app.Name |
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 think we discussed it offline and agreed that the deployment won't be part of TF configuration. Instead, if an users want to deploy, they use CLI to do that. Otherwise it's confusing because we do the deployments only when source_code_path changed but we need to do deployments when source code is changed.
@pietern wdyt?
apps/resource_app.go
Outdated
if err != nil { | ||
return err | ||
} | ||
if d.HasChanges("source_code_path", "mode") { |
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.
See my comment above, I think we should remove app deployment altogether for now
apps/resource_app.go
Outdated
func (appStruct) CustomizeSchema(s *common.CustomizableSchema) *common.CustomizableSchema { | ||
|
||
// Required fields & validation | ||
s.SchemaPath("name").SetRequired().SetForceNew().SetValidateFunc(validation.StringMatch(regexp.MustCompile("^[a-z-]{2,30}$"), "name must contain only lowercase alphanumeric characters and hyphens, and be between 2 and 30 characters long")) |
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.
Style: this line is very long
"update_time", "updater", "url"} { | ||
s.SchemaPath(p).SetComputed() | ||
} | ||
return s |
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.
Could we add this constraint back, where you cannot have more than one defined per resource?
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've just realised that there's an important piece is missing: we need to supporting setting permissions for app resource as we do for other resources (see ResourcePermissions
). Apps do support this API https://docs.databricks.com/api/workspace/apps/setpermissions
@andrewnester maybe we can do it in a separate PR? |
Just to clarify, I mean app resource needs to be added here so it can be part of the schema and be able to use it by DABs since we rely on generic |
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Test Details: go/deco-tests/11968854526 |
@andrewnester makes sense - I've added |
Changes
databricks_app
resourceResolves #4084
Tests
make test
run locallydocs/
folderinternal/acceptance