Skip to content

Commit

Permalink
add a no prompt for cases when dsn can be configured individually as …
Browse files Browse the repository at this point in the history
…well
  • Loading branch information
k-anshul committed Jul 17, 2024
1 parent 7a3aec6 commit 956051d
Show file tree
Hide file tree
Showing 14 changed files with 424 additions and 389 deletions.
3 changes: 3 additions & 0 deletions cli/cmd/env/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ func VariablesFlow(ctx context.Context, ch *cmdutil.Helper, projectPath string)

for i := range c.Spec.ConfigProperties {
prop := c.Spec.ConfigProperties[i] // TODO: Move into range and turn into pointer
if prop.NoPrompt {
continue
}

key := fmt.Sprintf("connector.%s.%s", c.Name, prop.Key)
msg := key
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/rill/admin/v1/admin.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3190,7 +3190,7 @@ definitions:
`NullValue` is a singleton enumeration to represent the null value for the
`Value` type union.
The JSON representation for `NullValue` is JSON `null`.
The JSON representation for `NullValue` is JSON `null`.
- NULL_VALUE: Null value.
rpcStatus:
Expand Down
781 changes: 396 additions & 385 deletions proto/gen/rill/runtime/v1/api.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions proto/gen/rill/runtime/v1/api.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion proto/gen/rill/runtime/v1/runtime.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2644,6 +2644,9 @@ definitions:
secret:
type: boolean
title: If true, the property is a secret and should not be displayed in UIs
noPrompt:
type: boolean
title: If true, the property should not be prompted. The expectation is that only advanced users will use it and can set directly in the connector.yaml
title: Property represents the spec of one of the driver's config properties
ConnectorDriverPropertyType:
type: string
Expand Down Expand Up @@ -2902,7 +2905,7 @@ definitions:
`NullValue` is a singleton enumeration to represent the null value for the
`Value` type union.
The JSON representation for `NullValue` is JSON `null`.
The JSON representation for `NullValue` is JSON `null`.
- NULL_VALUE: Null value.
rpcStatus:
Expand Down
2 changes: 2 additions & 0 deletions proto/rill/runtime/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,8 @@ message ConnectorDriver {
string placeholder = 9;
// If true, the property is a secret and should not be displayed in UIs
bool secret = 10;
// If true, the property should not be prompted. The expectation is that only advanced users will use it and can set directly in the connector.yaml
bool no_prompt = 11;
}
// Name is the name of the connector
string name = 1;
Expand Down
1 change: 1 addition & 0 deletions runtime/drivers/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var spec = drivers.Spec{
Required: false,
DisplayName: "Connection string",
Placeholder: "clickhouse://localhost:9000?username=default&password=",
NoPrompt: true,
},
{
Key: "host",
Expand Down
1 change: 1 addition & 0 deletions runtime/drivers/connectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type PropertySpec struct {
Default string
Placeholder string
Secret bool
NoPrompt bool
}

// PropertyType is an enum of types supported for connector properties.
Expand Down
1 change: 1 addition & 0 deletions runtime/drivers/druid/druid.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var spec = drivers.Spec{
DisplayName: "Connection string",
Placeholder: "https://example.com/druid/v2/sql/avatica-protobuf?authentication=BASIC&avaticaUser=username&avaticaPassword=password",
Secret: true,
NoPrompt: true,
},
{
Key: "host",
Expand Down
1 change: 1 addition & 0 deletions runtime/drivers/pinot/pinot.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var spec = drivers.Spec{
DisplayName: "Connection string",
Placeholder: "http(s)://username:password@localhost:9000",
Secret: true,
NoPrompt: true,
},
{
Key: "host",
Expand Down
1 change: 1 addition & 0 deletions runtime/server/connectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func driverPropertySpecToPB(spec *drivers.PropertySpec) *runtimev1.ConnectorDriv
Default: spec.Default,
Placeholder: spec.Placeholder,
Secret: spec.Secret,
NoPrompt: spec.NoPrompt,
}
}

Expand Down
2 changes: 1 addition & 1 deletion web-admin/src/client/gen/index.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ export interface RpcStatus {
* `NullValue` is a singleton enumeration to represent the null value for the
`Value` type union.
The JSON representation for `NullValue` is JSON `null`.
The JSON representation for `NullValue` is JSON `null`.
- NULL_VALUE: Null value.
*/
Expand Down
8 changes: 8 additions & 0 deletions web-common/src/proto/gen/rill/runtime/v1/api_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3215,6 +3215,13 @@ export class ConnectorDriver_Property extends Message<ConnectorDriver_Property>
*/
secret = false;

/**
* If true, the property should not be prompted. The expectation is that only advanced users will use it and can set directly in the connector.yaml
*
* @generated from field: bool no_prompt = 11;
*/
noPrompt = false;

constructor(data?: PartialMessage<ConnectorDriver_Property>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -3233,6 +3240,7 @@ export class ConnectorDriver_Property extends Message<ConnectorDriver_Property>
{ no: 8, name: "default", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 9, name: "placeholder", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 10, name: "secret", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
{ no: 11, name: "no_prompt", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ConnectorDriver_Property {
Expand Down
3 changes: 2 additions & 1 deletion web-common/src/runtime-client/gen/index.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2134,7 +2134,7 @@ export interface Runtimev1Type {
* `NullValue` is a singleton enumeration to represent the null value for the
`Value` type union.
The JSON representation for `NullValue` is JSON `null`.
The JSON representation for `NullValue` is JSON `null`.
- NULL_VALUE: Null value.
*/
Expand Down Expand Up @@ -2329,6 +2329,7 @@ export interface ConnectorDriverProperty {
default?: string;
placeholder?: string;
secret?: boolean;
noPrompt?: boolean;
}

export interface ColumnTimeSeriesRequestBasicMeasure {
Expand Down

0 comments on commit 956051d

Please sign in to comment.