feat(config): add distinct suggested_value to exported config schema#1034
feat(config): add distinct suggested_value to exported config schema#1034c1-squire-dev[bot] wants to merge 3 commits into
Conversation
WithSuggestedValue previously folded its value into the exported schema's default_value (via GetExportedDefaultValue), making a suggested value indistinguishable from a real default. Downstream consumers (c1) then injected it as a default into resolved connector config, so e.g. baton-confluence synced only the narrow suggested noun/verb set instead of falling back to the full runtime default set. Emit suggested values into a separate suggested_value proto field on each typed sub-message (IntField, BoolField, StringSliceField, StringMapField, StringField). default_value now carries only real WithDefaultValue values; suggested_value carries WithSuggestedValue. Consumers can pre-populate a GUI from suggested_value without treating it as a default. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
General PR Review: feat(config): add distinct suggested_value to exported config schemaBlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryThe full PR diff was scanned for security and correctness. This PR adds a distinct Security IssuesNone found. Correctness IssuesNone found. SuggestionsNone. |
The export path (schemaFieldToV1) now sources default_value from GetDefaultValue and suggested_value from GetSuggestedValue, so GetExportedDefaultValue is dead. Remove it and re-point TestSuggestedValuePrecedence at schemaFieldToV1 so the both-values-set case is still covered through the real export path. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Per review, the self-explanatory suggested_value field name doesn't need the per-field pre-population comment. Remove it from all five typed sub-messages and regenerate. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Problem
WithSuggestedValuefolded its value into the exported schema'sdefault_value(viaGetExportedDefaultValue), so a suggested value was byte-identical to a real default in the exportedconfig_schema.json. Downstream, c1 injects schemadefault_valueinto a deployed connector's resolved config when the operator left a field unset — so a suggested value silently became an enforced default.Concretely this regressed baton-confluence:
noun/verbuseWithSuggestedValue(<narrow set>), which exported asdefault_value:["space"], which c1 injected, so existing connectors synced only spaces instead of falling back to the connector's full runtime default set.Change
Add a distinct
suggested_valuefield to each typed sub-message inproto/c1/config/v1/config.proto(IntField,BoolField,StringSliceField,StringMapField,StringField). InschemaFieldToV1:default_valueis now sourced fromGetDefaultValue(realWithDefaultValueonly), andsuggested_valueis sourced separately fromSuggestedValue, only when set.Fields that use only
WithDefaultValueare unchanged (default populated, suggested empty). Fields that useWithSuggestedValuenow export an emptydefault_valueplus a populatedsuggested_value— so consumers can pre-populate a UI from the suggestion without treating it as an injected default.Adds
GetSuggestedValue[T]helper inpkg/field/fields.go.Tests
pkg/field/struct_test.go: aStringSliceFieldbuilt with onlyWithSuggestedValue(["space"])now exportsdefault_value == []andsuggested_value == ["space"]; aWithDefaultValuefield exports the default with empty suggested.Coordinated with
suggested_valueto its internal + public connector-config schema, carries it through the converters for GUI pre-population, and keeps the deployment resolver injectingdefault_valueonly).config_schema.json).🤖 Generated with Claude Code