Skip to content

Commit

Permalink
don't set a description for enum catalog entry. customers were giving…
Browse files Browse the repository at this point in the history
… us feedback that it was unhelpful
  • Loading branch information
aaronsheah committed Aug 18, 2023
1 parent 3d532fb commit 7cfcc54
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions cmd/catalog-importer/cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ func (opt *SyncOptions) Run(ctx context.Context, logger kitlog.Logger, cfg *conf
OUT("⊕ Filtering config to targets (%s)", strings.Join(opt.Targets, ", "))
cfg = cfg.Filter(opt.Targets)
}
var (
outputs, sources int
)
var outputs, sources int
for _, pipeline := range cfg.Pipelines {
outputs += len(pipeline.Outputs)
sources += len(pipeline.Sources)
Expand Down Expand Up @@ -241,9 +239,7 @@ func (opt *SyncOptions) Run(ctx context.Context, logger kitlog.Logger, cfg *conf
for _, outputType := range cfg.Outputs() {
baseModel, enumModels := output.MarshalType(outputType)
for _, model := range append(enumModels, baseModel) {
var (
catalogType = catalogTypesByOutput[model.TypeName]
)
catalogType := catalogTypesByOutput[model.TypeName]

var updatedCatalogType client.CatalogTypeV2
if opt.DryRun {
Expand Down Expand Up @@ -387,26 +383,13 @@ func (opt *SyncOptions) Run(ctx context.Context, logger kitlog.Logger, cfg *conf
}
}

// Create a description so we can attribute this value back to the original
// source. It would look like:
//
// One of the values of 'Plan name' for Customer.
desc := fmt.Sprintf("One of the values of '%s' for %s.",
enumModel.SourceAttribute.Name, outputType.Name)

enumModels := []*output.CatalogEntryModel{}
for value := range valueSet {
enumModels = append(enumModels, &output.CatalogEntryModel{
ExternalID: value,
Name: value,
Aliases: []string{},
AttributeValues: map[string]client.CatalogAttributeBindingPayloadV2{
"description": {
Value: &client.CatalogAttributeValuePayloadV2{
Literal: &desc,
},
},
},
ExternalID: value,
Name: value,
Aliases: []string{},
AttributeValues: map[string]client.CatalogAttributeBindingPayloadV2{},
})
}

Expand Down

0 comments on commit 7cfcc54

Please sign in to comment.