Skip to content
Open
26 changes: 13 additions & 13 deletions bundle/config/mutator/initialize_urls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,39 @@ func TestInitializeURLs(t *testing.T) {
Resources: config.Resources{
Jobs: map[string]*resources.Job{
"job1": {
BaseResource: resources.BaseResource{ID: "1"},
JobSettings: jobs.JobSettings{Name: "job1"},
ID: "1",
JobSettings: jobs.JobSettings{Name: "job1"},
},
},
Pipelines: map[string]*resources.Pipeline{
"pipeline1": {
BaseResource: resources.BaseResource{ID: "3"},
ID: "3",
CreatePipeline: pipelines.CreatePipeline{Name: "pipeline1"},
},
},
Experiments: map[string]*resources.MlflowExperiment{
"experiment1": {
BaseResource: resources.BaseResource{ID: "4"},
ID: "4",
CreateExperiment: ml.CreateExperiment{Name: "experiment1"},
},
},
Models: map[string]*resources.MlflowModel{
"model1": {
BaseResource: resources.BaseResource{ID: "a model uses its name for identifier"},
ID: "a model uses its name for identifier",
CreateModelRequest: ml.CreateModelRequest{Name: "a model uses its name for identifier"},
},
},
ModelServingEndpoints: map[string]*resources.ModelServingEndpoint{
"servingendpoint1": {
BaseResource: resources.BaseResource{ID: "my_serving_endpoint"},
ID: "my_serving_endpoint",
CreateServingEndpoint: serving.CreateServingEndpoint{
Name: "my_serving_endpoint",
},
},
},
RegisteredModels: map[string]*resources.RegisteredModel{
"registeredmodel1": {
BaseResource: resources.BaseResource{ID: "8"},
ID: "8",
CreateRegisteredModelRequest: catalog.CreateRegisteredModelRequest{
Name: "my_registered_model",
},
Expand All @@ -71,31 +71,31 @@ func TestInitializeURLs(t *testing.T) {
},
VectorSearchIndexes: map[string]*resources.VectorSearchIndex{
"vectorsearchindex1": {
BaseResource: resources.BaseResource{ID: "catalog.schema.vectorsearchindex1"},
ID: "catalog.schema.vectorsearchindex1",
CreateVectorIndexRequest: vectorsearch.CreateVectorIndexRequest{
Name: "catalog.schema.vectorsearchindex1",
},
},
},
Schemas: map[string]*resources.Schema{
"schema1": {
BaseResource: resources.BaseResource{ID: "catalog.schema"},
ID: "catalog.schema",
CreateSchema: catalog.CreateSchema{
Name: "schema",
},
},
},
Clusters: map[string]*resources.Cluster{
"cluster1": {
BaseResource: resources.BaseResource{ID: "1017-103929-vlr7jzcf"},
ID: "1017-103929-vlr7jzcf",
ClusterSpec: compute.ClusterSpec{
ClusterName: "cluster1",
},
},
},
Dashboards: map[string]*resources.Dashboard{
"dashboard1": {
BaseResource: resources.BaseResource{ID: "01ef8d56871e1d50ae30ce7375e42478"},
ID: "01ef8d56871e1d50ae30ce7375e42478",
DashboardConfig: resources.DashboardConfig{
DisplayName: "My special dashboard",
},
Expand Down Expand Up @@ -136,8 +136,8 @@ func TestInitializeURLsWithoutOrgId(t *testing.T) {
Resources: config.Resources{
Jobs: map[string]*resources.Job{
"job1": {
BaseResource: resources.BaseResource{ID: "1"},
JobSettings: jobs.JobSettings{Name: "job1"},
ID: "1",
JobSettings: jobs.JobSettings{Name: "job1"},
},
},
},
Expand Down
3 changes: 2 additions & 1 deletion bundle/config/resources/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (

type Alert struct {
BaseResource
sql.AlertV2 //nolint AlertV2 also defines Id and URL field with the same json tag "id" and "url"
sql.AlertV2 //nolint:govet // AlertV2.Id and our depth-0 ID field both carry json:"id"; the depth-0 field wins
ID string `json:"id,omitempty" bundle:"readonly"`

Permissions []Permission `json:"permissions,omitempty"`

Expand Down
5 changes: 4 additions & 1 deletion bundle/config/resources/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ type AppEnvVar struct {

type App struct {
BaseResource
apps.App // nolint App struct also defines Id and URL field with the same json tag "id" and "url"
apps.App //nolint:govet // apps.App.{Id,Url} and our depth-0 {ID,URL} fields carry the same json names; the depth-0 fields win
ID string `json:"id,omitempty" bundle:"readonly"`
URL string `json:"url,omitempty" bundle:"internal"`

// Note: apps.App already includes GitRepository field from the SDK

// Lifecycle shadows BaseResource.Lifecycle to add support for lifecycle.started.
Expand Down
3 changes: 1 addition & 2 deletions bundle/config/resources/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package resources

// BaseResource is a struct that contains the base settings for a resource.
type BaseResource struct {
ID string `json:"id,omitempty" bundle:"readonly"`
ModifiedStatus ModifiedStatus `json:"modified_status,omitempty" bundle:"internal"`
URL string `json:"url,omitempty" bundle:"internal"`
ModifiedStatus ModifiedStatus `json:"modified_status,omitempty" bundle:"internal"`
Lifecycle Lifecycle `json:"lifecycle,omitempty"`
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

type Catalog struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
catalog.CreateCatalog

// List of grants to apply on this catalog.
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/cluster_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

type ClusterPolicy struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
compute.CreatePolicy

// Shadows the embedded compute.CreatePolicy.Definition (a string). `any` lets the
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

type Cluster struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
compute.ClusterSpec

// Lifecycle shadows BaseResource.Lifecycle to add support for lifecycle.started.
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (c DashboardConfig) MarshalJSON() ([]byte, error) {

type Dashboard struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
DashboardConfig

Permissions []Permission `json:"permissions,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/database_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

type DatabaseCatalog struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
database.DatabaseCatalog
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/database_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

type DatabaseInstance struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
database.DatabaseInstance

Permissions []Permission `json:"permissions,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/genie_space.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (c GenieSpaceConfig) MarshalJSON() ([]byte, error) {

type GenieSpace struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
GenieSpaceConfig

Permissions []Permission `json:"permissions,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/instance_pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

type InstancePool struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
compute.CreateInstancePool
Permissions []InstancePoolPermission `json:"permissions,omitempty"`
}
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

type Job struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
jobs.JobSettings

Permissions []JobPermission `json:"permissions,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/job_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
// own configuration changes; lifecycle.triggers can add further conditions.
type JobRun struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
jobs.RunNow

// Lifecycle shadows BaseResource.Lifecycle so job_runs can set triggers.
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/mlflow_experiment.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

type MlflowExperiment struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
ml.CreateExperiment

Permissions []MlflowExperimentPermission `json:"permissions,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/mlflow_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

type MlflowModel struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
ml.CreateModelRequest

Permissions []MlflowModelPermission `json:"permissions,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/model_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (c ModelServiceConfig) MarshalJSON() ([]byte, error) {

type ModelService struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
ModelServiceConfig
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/model_serving_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

type ModelServingEndpoint struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`

// This represents the input args for terraform, and will get converted
// to a HCL representation for CRUD
Expand Down
3 changes: 2 additions & 1 deletion bundle/config/resources/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (

type Pipeline struct {
BaseResource
pipelines.CreatePipeline //nolint CreatePipeline also defines Id field with the same json tag "id"
pipelines.CreatePipeline //nolint:govet // CreatePipeline.Id and our depth-0 ID field both carry json:"id"; the depth-0 field wins
ID string `json:"id,omitempty" bundle:"readonly"`

Permissions []PipelinePermission `json:"permissions,omitempty"`

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/postgres_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func (c PostgresBranchConfig) MarshalJSON() ([]byte, error) {

type PostgresBranch struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
PostgresBranchConfig
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/postgres_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (c PostgresCatalogConfig) MarshalJSON() ([]byte, error) {

type PostgresCatalog struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
PostgresCatalogConfig
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/postgres_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (c PostgresDatabaseConfig) MarshalJSON() ([]byte, error) {

type PostgresDatabase struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
PostgresDatabaseConfig
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/postgres_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func (c PostgresEndpointConfig) MarshalJSON() ([]byte, error) {

type PostgresEndpoint struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
PostgresEndpointConfig
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/postgres_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func (c PostgresProjectConfig) MarshalJSON() ([]byte, error) {

type PostgresProject struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
PostgresProjectConfig

Permissions []Permission `json:"permissions,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/postgres_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (c PostgresRoleConfig) MarshalJSON() ([]byte, error) {

type PostgresRole struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
PostgresRoleConfig
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/postgres_snapshot_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (c PostgresSnapshotScheduleConfig) MarshalJSON() ([]byte, error) {

type PostgresSnapshotSchedule struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
PostgresSnapshotScheduleConfig
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/postgres_synced_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func (c PostgresSyncedTableConfig) MarshalJSON() ([]byte, error) {

type PostgresSyncedTable struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
PostgresSyncedTableConfig
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/quality_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

type QualityMonitor struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`

// This struct defines the creation payload for a monitor.
catalog.CreateMonitor
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/registered_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

type RegisteredModel struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`

// This represents the input args for terraform, and will get converted
// to a HCL representation for CRUD
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

type Schema struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
catalog.CreateSchema
// List of grants to apply on this schema.
Grants []catalog.PrivilegeAssignment `json:"grants,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

type Secret struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
catalog.Secret

// List of grants to apply on this secret.
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/secret_scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type SecretScopePermission struct {

type SecretScope struct { //nolint:recvcheck // pointer receiver needed for UnmarshalJSON, value for other methods
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`

// A unique name to identify the secret scope.
Name string `json:"name"`
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/sql_warehouses.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

type SqlWarehouse struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
sql.CreateWarehouseRequest

// Lifecycle shadows BaseResource.Lifecycle to add support for lifecycle.started.
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/synced_database_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

type SyncedDatabaseTable struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
database.SyncedDatabaseTable
}

Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/vector_search_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

type VectorSearchEndpoint struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
vectorsearch.CreateEndpoint

Permissions []VectorSearchEndpointPermission `json:"permissions,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/vector_search_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

type VectorSearchIndex struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
vectorsearch.CreateVectorIndexRequest

// List of grants to apply on this vector search index.
Expand Down
1 change: 1 addition & 0 deletions bundle/config/resources/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

type Volume struct {
BaseResource
ID string `json:"id,omitempty" bundle:"readonly"`
catalog.CreateVolumeRequestContent

// VolumePath is /Volumes/{catalog}/{schema}/{name}. Populated during initialize; not user-configurable.
Expand Down
Loading
Loading