Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: optimize new user flow (#20889)
ecmadaof3c6ba8d2184
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yamlindex 4863e370a5..ecdcaf71ef 100644--- a/backend/api/mcp/gen/openapi.yaml+++ b/backend/api/mcp/gen/openapi.yaml@@ -9709,6 +9709,12 @@ components:type: booleantitle: validate_onlydescription: Validate only also tests the data source connection.+ project:+ type: string+ title: project+ description: |-+ The project to assign newly discovered databases to during initial sync.+ Format: projects/{project}title: CreateInstanceRequestadditionalProperties: falsebytebase.v1.CreateIssueCommentRequest:diff --git a/backend/api/v1/acl.go b/backend/api/v1/acl.goindex ca6c81a143..469cf72e11 100644--- a/backend/api/v1/acl.go+++ b/backend/api/v1/acl.go@@ -429,6 +429,10 @@ func getResourceFromRequest(ctx context.Context, request any, method string) ([]}shortMethod := methodTokens[2]+ if r, ok := request.(*v1pb.ListInstanceDatabaseRequest); ok && r.GetInstance() != nil {+ return []string{""}, nil+ }+var resources []stringif r, ok := request.(*v1pb.ListInstanceDatabaseRequest); ok && r.GetInstance() != nil {diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.goindex ccea23093b..515d0d5664 100644--- a/backend/api/v1/instance_service.go+++ b/backend/api/v1/instance_service.go@@ -11,6 +11,7 @@ import ("log/slog""path/filepath""strings"+ "time""connectrpc.com/connect""github.com/pkg/errors"@@ -43,6 +44,118 @@ type InstanceService struct {sampleInstanceManager *sampleinstance.Manager}+const (+ connectionCategoryHeader = "bytebase-connection-failure-category"+ connectionCategoryNetworkUnreachable = "network_unreachable"+ connectionCategoryAuthFailed = "auth_failed"+ connectionCategoryPermissionDenied = "permission_denied"+ connectionCategorySSLTLSFailed = "ssl_tls_failed"+ connectionCategoryTimeout = "timeout"+ connectionCategoryUnsupportedEngine = "unsupported_engine"+ connectionCategoryUnknown = "unknown"+ connectionCategorySuccess = "success"+)++func newConnectionTestErrorWithCategory(code connect.Code, err error, category string, format string, args ...any) *connect.Error {+ connectErr := connect.NewError(code, errors.Wrapf(err, format, args...))+ connectErr.Meta().Set(connectionCategoryHeader, category)+ return connectErr+}++func classifyConnectionFailure(err error) string {+ if err == nil {+ return connectionCategoryUnknown+ }+ text := strings.ToLower(err.Error())+ switch {+ case strings.Contains(text, "timeout"),+ strings.Contains(text, "timed out"),+ strings.Contains(text, "deadline exceeded"):+ return connectionCategoryTimeout+ case strings.Contains(text, "ssl"),+ strings.Contains(text, "tls"),+ strings.Contains(text, "certificate"),+ strings.Contains(text, "x509"):+ return connectionCategorySSLTLSFailed+ case strings.Contains(text, "permission denied"),+ strings.Contains(text, "insufficient permission"),+ strings.Contains(text, "insufficient privilege"),+ strings.Contains(text, "not authorized"):+ return connectionCategoryPermissionDenied+ case strings.Contains(text, "password"),+ strings.Contains(text, "authentication"),+ strings.Contains(text, "auth failed"),+ strings.Contains(text, "login failed"),+ strings.Contains(text, "invalid credential"),+ strings.Contains(text, "invalid password"),+ strings.Contains(text, "access denied"):+ return connectionCategoryAuthFailed+ case strings.Contains(text, "unsupported"):+ return connectionCategoryUnsupportedEngine+ case strings.Contains(text, "network"),+ strings.Contains(text, "unreachable"),+ strings.Contains(text, "no route"),+ strings.Contains(text, "no such host"),+ strings.Contains(text, "unknown host"),+ strings.Contains(text, "enotfound"),+ strings.Contains(text, "econnrefused"),+ strings.Contains(text, "connection refused"),+ strings.Contains(text, "connection reset"),+ strings.Contains(text, "could not translate host"):+ return connectionCategoryNetworkUnreachable+ default:+ return connectionCategoryUnknown+ }+}++func buildInstanceConnectionLogAttrs(source string, category string, instance *store.InstanceMessage, dataSource *storepb.DataSource, elapsed time.Duration) []slog.Attr {+ attrs := []slog.Attr{+ slog.String("source", source),+ slog.String("category", category),+ slog.Int64("elapsed_ms", elapsed.Milliseconds()),+ slog.Bool("has_ssl", hasDataSourceSSL(dataSource)),+ slog.Bool("has_ssh", hasDataSourceSSH(dataSource)),+ slog.Bool("has_external_secret", dataSource.GetExternalSecret() != nil),+ }+ if instance != nil {+ attrs = append(attrs, slog.String("engine", instance.Metadata.GetEngine().String()))+ }+ if dataSource != nil {+ attrs = append(attrs, slog.String("data_source_type", dataSource.GetType().String()))+ }+ return attrs+}++func hasDataSourceSSL(dataSource *storepb.DataSource) bool {+ return dataSource.GetUseSsl() ||+ dataSource.GetSslCa() != "" ||+ dataSource.GetObfuscatedSslCa() != "" ||+ dataSource.GetSslCert() != "" ||+ dataSource.GetObfuscatedSslCert() != "" ||+ dataSource.GetSslKey() != "" ||+ dataSource.GetObfuscatedSslKey() != "" ||+ dataSource.GetSslCaPath() != "" ||+ dataSource.GetObfuscatedSslCaPath() != "" ||+ dataSource.GetSslCertPath() != "" ||+ dataSource.GetObfuscatedSslCertPath() != "" ||+ dataSource.GetSslKeyPath() != "" ||+ dataSource.GetObfuscatedSslKeyPath() != ""+}++func hasDataSourceSSH(dataSource *storepb.DataSource) bool {+ return dataSource.GetSshHost() != "" ||+ dataSource.GetSshPort() != "" ||+ dataSource.GetSshUser() != "" ||+ dataSource.GetSshPassword() != "" ||+ dataSource.GetObfuscatedSshPassword() != "" ||+ dataSource.GetSshPrivateKey() != "" ||+ dataSource.GetObfuscatedSshPrivateKey() != ""+}++func logInstanceConnection(ctx context.Context, source string, category string, instance *store.InstanceMessage, dataSource *storepb.DataSource, elapsed time.Duration) {+ slog.LogAttrs(ctx, slog.LevelInfo, "instance connection check completed", buildInstanceConnectionLogAttrs(source, category, instance, dataSource, elapsed)...)+}+// NewInstanceService creates a new InstanceService.func NewInstanceService(store *store.Store, profile *config.Profile, licenseService *enterprise.LicenseService, dbFactory *dbfactory.DBFactory, schemaSyncer *schemasync.Syncer, sampleInstanceManager *sampleinstance.Manager) *InstanceService {return &InstanceService{@@ -179,6 +292,10 @@ func (s *InstanceService) CreateInstance(ctx context.Context, req *connect.Reque// connection below, before the instance is persisted.workspaceID := common.GetWorkspaceIDFromContext(ctx)instanceMessage.Workspace = workspaceID+ initialProjectID, err := s.getInitialDatabaseProjectID(ctx, req.Msg.GetProject())+ if err != nil {+ return nil, err+ }for _, ds := range instanceMessage.Metadata.GetDataSources() {if err := validateAndSanitizeDataSourceTLS(ds); err != nil {return nil, connect.NewError(connect.CodeInvalidArgument, err)@@ -192,6 +309,7 @@ func (s *InstanceService) CreateInstance(ctx context.Context, req *connect.Requeif req.Msg.ValidateOnly {for _, ds := range instanceMessage.Metadata.GetDataSources() {err := func() error {+ start := time.Now()driver, err := s.dbFactory.GetDataSourceDriver(ctx, instanceMessage, ds,db.ConnectionContext{@@ -199,12 +317,17 @@ func (s *InstanceService) CreateInstance(ctx context.Context, req *connect.Reque},)if err != nil {- return connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to get database driver"))+ category := classifyConnectionFailure(err)+ logInstanceConnection(ctx, v1connect.InstanceServiceCreateInstanceProcedure, category, instanceMessage, ds, time.Since(start))+ return newConnectionTestErrorWithCategory(connect.CodeInternal, err, category, "failed to get database driver")}defer driver.Close(ctx)if err := driver.Ping(ctx); err != nil {- return connect.NewError(connect.CodeInvalidArgument, errors.Wrapf(err, "invalid datasource %s", ds.GetType()))+ category := classifyConnectionFailure(err)+ logInstanceConnection(ctx, v1connect.InstanceServiceCreateInstanceProcedure, category, instanceMessage, ds, time.Since(start))+ return newConnectionTestErrorWithCategory(connect.CodeInvalidArgument, err, category, "invalid datasource %s", ds.GetType())}+ logInstanceConnection(ctx, v1connect.InstanceServiceCreateInstanceProcedure, connectionCategorySuccess, instanceMessage, ds, time.Since(start))return nil}()if err != nil {@@ -231,7 +354,9 @@ func (s *InstanceService) CreateInstance(ctx context.Context, req *connect.Requedriver, err := s.dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */, db.ConnectionContext{})if err == nil {defer driver.Close(ctx)- updatedInstance, _, _, err := s.schemaSyncer.SyncInstance(ctx, instance)+ updatedInstance, _, _, err := s.schemaSyncer.SyncInstanceWithOptions(ctx, instance, schemasync.SyncInstanceOptions{+ InitialProjectID: initialProjectID,+ })if err != nil {slog.Warn("Failed to sync instance",slog.String("instance", instance.ResourceID),@@ -247,6 +372,27 @@ func (s *InstanceService) CreateInstance(ctx context.Context, req *connect.Requereturn connect.NewResponse(result), nil}+func (s *InstanceService) getInitialDatabaseProjectID(ctx context.Context, projectName string) (string, error) {+ if projectName == "" {+ return "", nil+ }+ projectID, err := common.GetProjectID(projectName)+ if err != nil {+ return "", connect.NewError(connect.CodeInvalidArgument, errors.Wrapf(err, "invalid project %q", projectName))+ }+ project, err := s.store.GetProject(ctx, &store.FindProjectMessage{+ ResourceID: &projectID,+ Workspace: common.GetWorkspaceIDFromContext(ctx),+ })+ if err != nil {+ return "", connect.NewError(connect.CodeInternal, err)+ }+ if project == nil || project.Deleted {+ return "", connect.NewError(connect.CodeNotFound, errors.Errorf("project %q not found", projectName))+ }+ return project.ResourceID, nil+}+func instanceWithMetadata(instance *store.InstanceMessage, metadata *storepb.Instance) *store.InstanceMessage {candidate := *instancecandidate.Metadata = metadata@@ -847,6 +993,7 @@ func (s *InstanceService) AddDataSource(ctx context.Context, req *connect.Reques// Test connection.if req.Msg.ValidateOnly {err := func() error {+ start := time.Now()driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, dataSource,db.ConnectionContext{@@ -854,12 +1001,17 @@ func (s *InstanceService) AddDataSource(ctx context.Context, req *connect.Reques},)if err != nil {- return connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to get database driver"))+ category := classifyConnectionFailure(err)+ logInstanceConnection(ctx, v1connect.InstanceServiceAddDataSourceProcedure, category, instance, dataSource, time.Since(start))+ return newConnectionTestErrorWithCategory(connect.CodeInternal, err, category, "failed to get database driver")}defer driver.Close(ctx)if err := driver.Ping(ctx); err != nil {- return connect.NewError(connect.CodeInvalidArgument, errors.Wrapf(err, "invalid datasource %s", dataSource.GetType()))+ category := classifyConnectionFailure(err)+ logInstanceConnection(ctx, v1connect.InstanceServiceAddDataSourceProcedure, category, instance, dataSource, time.Since(start))+ return newConnectionTestErrorWithCategory(connect.CodeInvalidArgument, err, category, "invalid datasource %s", dataSource.GetType())}+ logInstanceConnection(ctx, v1connect.InstanceServiceAddDataSourceProcedure, connectionCategorySuccess, instance, dataSource, time.Since(start))return nil}()if err != nil {@@ -1069,17 +1221,23 @@ func (s *InstanceService) UpdateDataSource(ctx context.Context, req *connect.Req// Test connection.if req.Msg.ValidateOnly {err := func() error {+ start := time.Now()driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, dataSource,db.ConnectionContext{ReadOnly: dataSource.GetType() == storepb.DataSourceType_READ_ONLY},)if err != nil {- return connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to get database driver"))+ category := classifyConnectionFailure(err)+ logInstanceConnection(ctx, v1connect.InstanceServiceUpdateDataSourceProcedure, category, instance, dataSource, time.Since(start))+ return newConnectionTestErrorWithCategory(connect.CodeInternal, err, category, "failed to get database driver")}defer driver.Close(ctx)if err := driver.Ping(ctx); err != nil {- return connect.NewError(connect.CodeInvalidArgument, errors.Wrapf(err, "invalid datasource %s", dataSource.GetType()))+ category := classifyConnectionFailure(err)+ logInstanceConnection(ctx, v1connect.InstanceServiceUpdateDataSourceProcedure, category, instance, dataSource, time.Since(start))+ return newConnectionTestErrorWithCategory(connect.CodeInvalidArgument, err, category, "invalid datasource %s", dataSource.GetType())}+ logInstanceConnection(ctx, v1connect.InstanceServiceUpdateDataSourceProcedure, connectionCategorySuccess, instance, dataSource, time.Since(start))return nil}()if err != nil {diff --git a/backend/api/v1/instance_service_test.go b/backend/api/v1/instance_service_test.goindex d22acafcf6..0d67ed3d29 100644--- a/backend/api/v1/instance_service_test.go+++ b/backend/api/v1/instance_service_test.go@@ -1,12 +1,17 @@package v1import (+ "errors"+ "log/slog""testing"+ "time""github.com/stretchr/testify/require""github.com/bytebase/bytebase/backend/component/config"storepb "github.com/bytebase/bytebase/backend/generated-go/store"+ "github.com/bytebase/bytebase/backend/generated-go/v1/v1connect"+ "github.com/bytebase/bytebase/backend/store")func TestValidateExtraConnectionParametersRejectsTiDBAllowAllFiles(t *testing.T) {@@ -17,6 +22,67 @@ func TestValidateExtraConnectionParametersRejectsTiDBAllowAllFiles(t *testing.T)require.Contains(t, err.Error(), "allowAllFiles")}+func TestClassifyConnectionFailure(t *testing.T) {+ testCases := []struct {+ err error+ want string+ }{+ {err: errors.New("dial tcp 10.0.0.5:5432: i/o timeout"), want: connectionCategoryTimeout},+ {err: errors.New("password authentication failed for user bytebase"), want: connectionCategoryAuthFailed},+ {err: errors.New("permission denied for schema public"), want: connectionCategoryPermissionDenied},+ {err: errors.New("tls: failed to verify certificate: x509: certificate signed by unknown authority"), want: connectionCategorySSLTLSFailed},+ {err: errors.New("dial tcp 10.0.0.5:5432: connection refused"), want: connectionCategoryNetworkUnreachable},+ {err: errors.New("unsupported engine"), want: connectionCategoryUnsupportedEngine},+ {err: errors.New("driver returned an unexpected error"), want: connectionCategoryUnknown},+ }++ for _, tc := range testCases {+ require.Equal(t, tc.want, classifyConnectionFailure(tc.err))+ }+}++func TestBuildInstanceConnectionLogAttrs(t *testing.T) {+ instance := &store.InstanceMessage{+ Metadata: &storepb.Instance{+ Engine: storepb.Engine_POSTGRES,+ },+ }+ dataSource := &storepb.DataSource{+ Type: storepb.DataSourceType_ADMIN,+ Host: "sensitive.example.com",+ Port: "5432",+ Username: "bytebase",+ Password: "secret",+ Database: "prod",+ UseSsl: true,+ SshHost: "bastion.example.com",+ ObfuscatedSshPassword: "obfuscated",+ ExternalSecret: &storepb.DataSourceExternalSecret{},+ AdditionalAddresses: []*storepb.DataSource_Address{{Host: "replica.example.com", Port: "5432"}},+ }++ attrs := buildInstanceConnectionLogAttrs(v1connect.InstanceServiceCreateInstanceProcedure, connectionCategoryAuthFailed, instance, dataSource, 1500*time.Millisecond)+ got := make(map[string]any)+ for _, attr := range attrs {+ got[attr.Key] = attr.Value.Any()+ }++ require.Equal(t, map[string]any{+ "source": v1connect.InstanceServiceCreateInstanceProcedure,+ "engine": storepb.Engine_POSTGRES.String(),+ "data_source_type": storepb.DataSourceType_ADMIN.String(),+ "category": connectionCategoryAuthFailed,+ "elapsed_ms": int64(1500),+ "has_ssl": true,+ "has_ssh": true,+ "has_external_secret": true,+ }, got)+ for _, key := range []string{"host", "port", "username", "database", "password", "dsn", "sql"} {+ require.NotContains(t, got, key)+ }+ require.IsType(t, slog.Attr{}, attrs[0])+}+func TestValidateExternalSecretForSaaS(t *testing.T) {tokenSecret := func(tokenType storepb.DataSourceExternalSecret_TokenType) *storepb.DataSource {return &storepb.DataSource{diff --git a/backend/generated-go/v1/instance_service.pb.go b/backend/generated-go/v1/instance_service.pb.goindex b0cbaabede..b49e53d64d 100644--- a/backend/generated-go/v1/instance_service.pb.go+++ b/backend/generated-go/v1/instance_service.pb.go@@ -700,7 +700,10 @@ type CreateInstanceRequest struct {// are /[a-z][0-9]-/.InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`// Validate only also tests the data source connection.- ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly,proto3" json:"validate_only,omitempty"`+ ValidateOnly bool `protobuf:"varint,3,opt,name=validate_only,json=validateOnly,proto3" json:"validate_only,omitempty"`+ // The project to assign newly discovered databases to during initial sync.+ // Format: projects/{project}+ Project string `protobuf:"bytes,4,opt,name=project,proto3" json:"project,omitempty"`unknownFields protoimpl.UnknownFieldssizeCache protoimpl.SizeCache}@@ -756,6 +759,13 @@ func (x *CreateInstanceRequest) GetValidateOnly() bool {return false}+func (x *CreateInstanceRequest) GetProject() string {+ if x != nil {+ return x.Project+ }+ return ""+}+type UpdateInstanceRequest struct {state protoimpl.MessageState `protogen:"open.v1"`// The instance to update.@@ -2986,12 +2996,13 @@ const file_v1_instance_service_proto_rawDesc = "" +"\border_by\x18\x05 \x01(\tR\aorderBy\"t\n" +"\x15ListInstancesResponse\x123\n" +"\tinstances\x18\x01 \x03(\v2\x15.bytebase.v1.InstanceR\tinstances\x12&\n" +- "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\x95\x01\n" ++ "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\xaf\x01\n" +"\x15CreateInstanceRequest\x126\n" +"\binstance\x18\x01 \x01(\v2\x15.bytebase.v1.InstanceB\x03\xe0A\x02R\binstance\x12\x1f\n" +"\vinstance_id\x18\x02 \x01(\tR\n" +"instanceId\x12#\n" +- "\rvalidate_only\x18\x03 \x01(\bR\fvalidateOnly\"\xb1\x01\n" ++ "\rvalidate_only\x18\x03 \x01(\bR\fvalidateOnly\x12\x18\n" ++ "\aproject\x18\x04 \x01(\tR\aproject\"\xb1\x01\n" +"\x15UpdateInstanceRequest\x126\n" +"\binstance\x18\x01 \x01(\v2\x15.bytebase.v1.InstanceB\x03\xe0A\x02R\binstance\x12;\n" +"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskR\n" +diff --git a/backend/generated-go/v1/instance_service_equal.pb.go b/backend/generated-go/v1/instance_service_equal.pb.goindex fdaf933779..0cfd2f64ff 100644--- a/backend/generated-go/v1/instance_service_equal.pb.go+++ b/backend/generated-go/v1/instance_service_equal.pb.go@@ -83,6 +83,9 @@ func (x *CreateInstanceRequest) Equal(y *CreateInstanceRequest) bool {if x.ValidateOnly != y.ValidateOnly {return false}+ if x.Project != y.Project {+ return false+ }return true}diff --git a/backend/runner/schemasync/syncer.go b/backend/runner/schemasync/syncer.goindex 6f60a97094..d0d1fadc5f 100644--- a/backend/runner/schemasync/syncer.go+++ b/backend/runner/schemasync/syncer.go@@ -295,8 +295,20 @@ func (s *Syncer) GetInstanceMeta(ctx context.Context, instance *store.InstanceMereturn instanceMeta, nil}+// SyncInstanceOptions controls one-off sync behavior.+type SyncInstanceOptions struct {+ // InitialProjectID assigns newly discovered databases to this project.+ // Empty means the workspace default project.+ InitialProjectID string+}+// SyncInstance syncs the schema for all databases in an instance.func (s *Syncer) SyncInstance(ctx context.Context, instance *store.InstanceMessage) (*store.InstanceMessage, []*storepb.DatabaseSchemaMetadata, []*store.DatabaseMessage, error) {+ return s.SyncInstanceWithOptions(ctx, instance, SyncInstanceOptions{})+}++// SyncInstanceWithOptions syncs the schema for all databases in an instance with one-off options.+func (s *Syncer) SyncInstanceWithOptions(ctx context.Context, instance *store.InstanceMessage, options SyncInstanceOptions) (*store.InstanceMessage, []*storepb.DatabaseSchemaMetadata, []*store.DatabaseMessage, error) {instanceMeta, err := s.GetInstanceMeta(ctx, instance)if err != nil {return nil, nil, nil, err@@ -325,6 +337,14 @@ func (s *Syncer) SyncInstance(ctx context.Context, instance *store.InstanceMessa}var newDatabases []*store.DatabaseMessagevar filteredDatabaseMetadatas []*storepb.DatabaseSchemaMetadata+ databaseProjectID := options.InitialProjectID+ if databaseProjectID == "" {+ var err error+ databaseProjectID, err = s.store.GetDefaultProjectID(ctx, instance.Workspace)+ if err != nil {+ return nil, nil, nil, errors.Wrapf(err, "failed to get default project ID for instance %q", instance.ResourceID)+ }+ }for _, databaseMetadata := range instanceMeta.Databases {if len(instance.Metadata.GetSyncDatabases()) > 0 && !slices.Contains(instance.Metadata.GetSyncDatabases(), databaseMetadata.Name) {@@ -334,15 +354,10 @@ func (s *Syncer) SyncInstance(ctx context.Context, instance *store.InstanceMessaidx := slices.IndexFunc(databases, func(db *store.DatabaseMessage) bool { return db.DatabaseName == databaseMetadata.Name })if idx < 0 {- // Create the database in the default project.- defaultProjectID, err := s.store.GetDefaultProjectID(ctx, instance.Workspace)- if err != nil {- return nil, nil, nil, errors.Wrapf(err, "failed to get default project ID for instance %q", instance.ResourceID)- }newDatabase, err := s.store.CreateDatabaseDefault(ctx, &store.DatabaseMessage{InstanceID: instance.ResourceID,DatabaseName: databaseMetadata.Name,- ProjectID: defaultProjectID,+ ProjectID: databaseProjectID,})if err != nil {return nil, nil, nil, errors.Wrapf(err, "failed to create instance %q database %q in sync runner", instance.ResourceID, databaseMetadata.Name)diff --git a/backend/tests/instance_create_project_test.go b/backend/tests/instance_create_project_test.gonew file mode 100644index 0000000000..c97c1e0c53--- /dev/null+++ b/backend/tests/instance_create_project_test.go@@ -0,0 +1,128 @@+package tests++import (+ "context"+ "database/sql"+ "fmt"+ "path/filepath"+ "strings"+ "testing"++ "connectrpc.com/connect"+ _ "github.com/mattn/go-sqlite3"+ "github.com/stretchr/testify/require"++ v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"+)++func TestCreateInstanceAssignsSyncedDatabasesToProject(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ instanceRootDir := t.TempDir()+ instanceDir, err := ctl.provisionSQLiteInstance(instanceRootDir, "project-aware-sync")+ a.NoError(err)+ databaseName := "project_assignment"+ createSQLiteDatabase(t, instanceDir, databaseName)++ instanceResp, err := ctl.instanceServiceClient.CreateInstance(ctx, connect.NewRequest(&v1pb.CreateInstanceRequest{+ InstanceId: generateRandomString("instance"),+ Project: ctl.project.Name,+ Instance: &v1pb.Instance{+ Title: "project-aware-sync",+ Engine: v1pb.Engine_SQLITE,+ Environment: new("environments/prod"),+ Activation: true,+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},+ },+ }))+ a.NoError(err)+ instance := instanceResp.Msg++ databaseResp, err := ctl.databaseServiceClient.GetDatabase(ctx, connect.NewRequest(&v1pb.GetDatabaseRequest{+ Name: fmt.Sprintf("%s/databases/%s", instance.Name, databaseName),+ }))+ a.NoError(err)+ a.Equal(ctl.project.Name, databaseResp.Msg.Project)+}++func TestCreateInstanceWithoutProjectKeepsDefaultProject(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ instanceRootDir := t.TempDir()+ instanceDir, err := ctl.provisionSQLiteInstance(instanceRootDir, "default-project-sync")+ a.NoError(err)+ databaseName := "default_project_assignment"+ createSQLiteDatabase(t, instanceDir, databaseName)++ instanceResp, err := ctl.instanceServiceClient.CreateInstance(ctx, connect.NewRequest(&v1pb.CreateInstanceRequest{+ InstanceId: generateRandomString("instance"),+ Instance: &v1pb.Instance{+ Title: "default-project-sync",+ Engine: v1pb.Engine_SQLITE,+ Environment: new("environments/prod"),+ Activation: true,+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},+ },+ }))+ a.NoError(err)+ instance := instanceResp.Msg++ databaseResp, err := ctl.databaseServiceClient.GetDatabase(ctx, connect.NewRequest(&v1pb.GetDatabaseRequest{+ Name: fmt.Sprintf("%s/databases/%s", instance.Name, databaseName),+ }))+ a.NoError(err)+ a.True(strings.HasPrefix(databaseResp.Msg.Project, "projects/default-") || databaseResp.Msg.Project == "projects/default")+ a.NotEqual(ctl.project.Name, databaseResp.Msg.Project)+}++func TestListInstanceDatabaseBeforeCreate(t *testing.T) {+ t.Parallel()+ a := require.New(t)+ ctx := context.Background()+ ctl := &controller{}+ ctx, err := ctl.StartServerWithExternalPg(ctx)+ a.NoError(err)+ defer ctl.Close(ctx)++ instanceRootDir := t.TempDir()+ instanceDir, err := ctl.provisionSQLiteInstance(instanceRootDir, "preview-databases")+ a.NoError(err)+ databaseName := "preview_database"+ createSQLiteDatabase(t, instanceDir, databaseName)++ resp, err := ctl.instanceServiceClient.ListInstanceDatabase(ctx, connect.NewRequest(&v1pb.ListInstanceDatabaseRequest{+ Name: fmt.Sprintf("instances/%s", generateRandomString("instance")),+ Instance: &v1pb.Instance{+ Title: "preview-databases",+ Engine: v1pb.Engine_SQLITE,+ Environment: new("environments/prod"),+ Activation: true,+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},+ },+ }))+ a.NoError(err)+ a.Contains(resp.Msg.Databases, databaseName)+}++func createSQLiteDatabase(t *testing.T, dir, databaseName string) {+ t.Helper()++ db, err := sql.Open("sqlite3", filepath.Join(dir, fmt.Sprintf("%s.db", databaseName)))+ require.NoError(t, err)+ defer db.Close()++ _, err = db.Exec("CREATE TABLE t(id INTEGER PRIMARY KEY)")+ require.NoError(t, err)+}diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 7f41be0910..31087cb491 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -672,6 +672,7 @@"column": "Column","columns": "Columns","comment": "Comment",+ "connect-databases": "Connect databases","data-size": "Data size","edit-environment": "Edit Environment","edit-labels": "Edit Labels",@@ -808,6 +809,13 @@"packages": "Packages","partitions": "Partitions","procedures": "Procedures",+ "project-instance-synced-action": "Create first change",+ "project-instance-synced-description": "Your database is ready in this project. Start with a governed database change when you are ready.",+ "project-instance-synced-sql-editor-action": "Open SQL Editor",+ "project-instance-synced-title": "Database connected",+ "project-instance-syncing-description": "This may take a few seconds to a few minutes. You can refresh this page later.",+ "project-instance-syncing-empty": "Databases are still syncing. Refresh this page in a moment to see them here.",+ "project-instance-syncing-title": "Databases from {{instance}} are syncing.","schema": {"default": "Default schema"},@@ -932,8 +940,76 @@"psc": "Private Service Connect (PSC)","public": "Public IP"},+ "connect-database-to-project": "Connect database to project",+ "connecting-database-to-project": "Connecting database...","connection-info": "Connection info","connection-options": "Connection Options",+ "connection-recovery": {+ "auth": {+ "description": "Verify the username, password, token, or IAM authentication settings, then test the connection again.",+ "steps": {+ "credentials": "Confirm the username, password, token, or secret-manager value is current.",+ "method": "Check that the selected authentication method matches your database setup.",+ "retry": "If credentials rotate outside Bytebase, update the secret source before retrying."+ },+ "title": "Check database credentials"+ },+ "docs": "Open connection guide",+ "network": {+ "description": "Confirm the host and port are reachable from Bytebase Cloud. Check firewall rules, allowlists, proxies, tunnels, and whether the database only accepts private network traffic.",+ "steps": {+ "address": "Verify the host or socket and port match the database endpoint.",+ "firewall": "If you use Bytebase Cloud, allowlist the required Cloud IP in your database firewall.",+ "private-network": "For a private database, configure VPN, private networking, or an SSH tunnel first."+ },+ "title": "Check network reachability"+ },+ "permission": {+ "description": "Use an account with the required database privileges to read schema metadata and run the workflows you plan to use.",+ "steps": {+ "account": "Use a database account that can read schema metadata.",+ "database": "Confirm the target databases are visible to this account.",+ "workflow": "Grant extra privileges only for the workflows you plan to run, such as schema change or SQL Editor."+ },+ "title": "Check database permissions"+ },+ "timeout": {+ "description": "The database did not respond in time. Check firewall rules, port settings, network routing, and whether the database allows connections from Bytebase Cloud.",+ "steps": {+ "load": "Confirm the database is online and accepts new connections.",+ "retry": "If the database is behind a firewall, finish the allowlist or tunnel setup before retrying.",+ "route": "Check routing, proxy, tunnel, port, and connection timeout settings."+ },+ "title": "Check firewall and routing"+ },+ "tls": {+ "description": "Review SSL/TLS mode, certificates, server name, and CA settings, then test the connection again.",+ "steps": {+ "certificates": "Verify CA, client certificate, and key values or paths.",+ "hostname": "Confirm the certificate matches the server name.",+ "mode": "Check the SSL/TLS mode required by your database, such as require or verify-full."+ },+ "title": "Check SSL/TLS settings"+ },+ "unknown": {+ "description": "Start with the connection basics, then use the guide for engine-specific options.",+ "steps": {+ "fields": "Check host, port, username, password or secret source, and SSL/TLS mode.",+ "help": "If your database is private, configure VPN, private networking, or an SSH tunnel before retrying.",+ "logs": "If the database has firewall rules, allow Bytebase Cloud or your deployed Bytebase network to connect."+ },+ "title": "Review connection settings"+ },+ "unsupported": {+ "description": "The selected engine does not match the target database or this engine/version is not supported yet.",+ "steps": {+ "engine": "Confirm the selected database engine matches the target database.",+ "retry": "Select another engine or update the connection settings, then retry.",+ "version": "Check whether this engine or version is supported by Bytebase."+ },+ "title": "Check database engine support"+ }+ },"create-gcp-credentials": "To create credentials, see","database-region": "Database Region","default-role": "Default role",@@ -1169,7 +1245,9 @@},"sync-databases": {"add-database": "+ Add database, press enter to submit",- "description": "Only sync selected databases.",+ "description": "Choose which databases to sync from this instance.",+ "project-description": "Synced databases will be added to <project>{{project}}</project>.",+ "project-sync-all": "Sync all databases to this project","search-database": "Search database","self": "Sync Databases","sync-all": "Sync all databases"@@ -1668,6 +1746,8 @@}},"project": {+ "add-database": "Add database",+ "add-database-empty-placeholder": "Add a database in an existing instance to this project","batch": {"archive": {"description": "This will archive the selected projects. You can restore them later if needed.",@@ -1687,6 +1767,10 @@"warning": "This action cannot be undone. All project data including issues, configurations, and history will be permanently removed."}},+ "connect-database": "Connect database",+ "connect-database-empty-placeholder": "Connect an instance to sync databases into this project",+ "connect-database-intro-description": "Connect a database so Bytebase can sync it into this project.",+ "connect-database-intro-title": "Connect your first database","create-modal": {"project-name": "Project Name","success-prompt": "Successfully created project {{name}}."@@ -2481,6 +2565,7 @@"workload-identity-tag-hint": "Leave empty to allow all tags"},"profile": {+ "default-project-name": "New project","display-name": "Your name","display-name-placeholder": "Enter your name","email": "Email",@@ -2493,9 +2578,10 @@"phone-tips": "Be sure to include the country code +1xxxxxx","role": "Role","setup-failed": "Failed to update profile.",+ "setup-first-project": "Setup 1st project","setup-skip": "I'll do this later","setup-success": "Profile updated.",- "setup-title": "Welcome! Set up your profile",+ "setup-title": "Welcome! Set up your workspace","subscription": "(Upgrade to enable role management)","workspace-name": "Workspace name","workspace-name-placeholder": "Enter workspace name"diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 90b1b771ad..37edc40fca 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -672,6 +672,7 @@"column": "Columna","columns": "Columnas","comment": "Comentario",+ "connect-databases": "Conectar bases de datos","data-size": "Tamaño de datos","edit-environment": "Editar entorno","edit-labels": "Editar etiquetas",@@ -808,6 +809,13 @@"packages": "Paquetes","partitions": "Particiones","procedures": "Procedimientos",+ "project-instance-synced-action": "Crear primer cambio",+ "project-instance-synced-description": "Tu base de datos está lista en este proyecto. Empieza con un cambio de base de datos gobernado cuando estés listo.",+ "project-instance-synced-sql-editor-action": "Abrir SQL Editor",+ "project-instance-synced-title": "Base de datos conectada",+ "project-instance-syncing-description": "Esto puede tardar de unos segundos a unos minutos. Puedes actualizar esta página más tarde.",+ "project-instance-syncing-empty": "Las bases de datos aún se están sincronizando. Actualiza esta página en un momento para verlas aquí.",+ "project-instance-syncing-title": "Las bases de datos de {{instance}} se están sincronizando.","schema": {"default": "Esquema predeterminado"},@@ -932,8 +940,76 @@"psc": "Private Service Connect (PSC)","public": "IP pública"},+ "connect-database-to-project": "Conectar base de datos al proyecto",+ "connecting-database-to-project": "Conectando base de datos...","connection-info": "Información de conexión","connection-options": "Opciones de conexión",+ "connection-recovery": {+ "auth": {+ "description": "Verifica el usuario, la contraseña, el token o la configuración de autenticación IAM y vuelve a probar la conexión.",+ "steps": {+ "credentials": "Confirma que el usuario, la contraseña, el token o el valor del gestor de secretos estén actualizados.",+ "method": "Comprueba que el método de autenticación seleccionado coincida con la configuración de la base de datos.",+ "retry": "Si las credenciales rotan fuera de Bytebase, actualiza la fuente del secreto antes de reintentar."+ },+ "title": "Revisar credenciales de base de datos"+ },+ "docs": "Abrir guía de conexión",+ "network": {+ "description": "Confirma que el host y el puerto sean accesibles desde Bytebase Cloud. Revisa reglas de firewall, listas de permitidos, proxies, túneles y si la base de datos solo acepta tráfico de red privada.",+ "steps": {+ "address": "Verifica que el host o socket y el puerto coincidan con el endpoint de la base de datos.",+ "firewall": "Si usas Bytebase Cloud, agrega la IP requerida de Cloud a la lista permitida del firewall de la base de datos.",+ "private-network": "Para una base de datos privada, configura primero VPN, red privada o túnel SSH."+ },+ "title": "Revisar alcance de red"+ },+ "permission": {+ "description": "Usa una cuenta con los privilegios de base de datos necesarios para leer metadatos de esquema y ejecutar los flujos de trabajo que planeas usar.",+ "steps": {+ "account": "Usa una cuenta de base de datos que pueda leer metadatos de esquema.",+ "database": "Confirma que las bases de datos de destino sean visibles para esta cuenta.",+ "workflow": "Concede privilegios adicionales solo para los flujos que planeas usar, como cambios de esquema o SQL Editor."+ },+ "title": "Revisar permisos de base de datos"+ },+ "timeout": {+ "description": "La base de datos no respondió a tiempo. Revisa reglas de firewall, configuración de puertos, rutas de red y si la base de datos permite conexiones desde Bytebase Cloud.",+ "steps": {+ "load": "Confirma que la base de datos esté en línea y acepte nuevas conexiones.",+ "retry": "Si la base de datos está detrás de un firewall, completa primero la lista permitida o el túnel.",+ "route": "Revisa rutas, proxy, túnel, puerto y configuración de tiempo de espera."+ },+ "title": "Revisar firewall y rutas"+ },+ "tls": {+ "description": "Revisa el modo SSL/TLS, certificados, nombre del servidor y configuración de CA, y vuelve a probar la conexión.",+ "steps": {+ "certificates": "Verifica los valores o rutas de CA, certificado de cliente y clave.",+ "hostname": "Confirma que el certificado coincida con el nombre del servidor.",+ "mode": "Revisa el modo SSL/TLS requerido por la base de datos, como require o verify-full."+ },+ "title": "Revisar configuración SSL/TLS"+ },+ "unknown": {+ "description": "Empieza por los datos básicos de conexión y luego usa la guía para opciones específicas del motor.",+ "steps": {+ "fields": "Revisa host, puerto, usuario, contraseña o fuente de secreto y modo SSL/TLS.",+ "help": "Si la base de datos es privada, configura VPN, red privada o túnel SSH antes de reintentar.",+ "logs": "Si la base de datos tiene reglas de firewall, permite conexiones desde Bytebase Cloud o la red donde está desplegado Bytebase."+ },+ "title": "Revisar configuración de conexión"+ },+ "unsupported": {+ "description": "El motor seleccionado no coincide con la base de datos de destino, o este motor/versión aún no está soportado.",+ "steps": {+ "engine": "Confirma que el motor de base de datos seleccionado coincida con la base de datos de destino.",+ "retry": "Selecciona otro motor o actualiza la configuración de conexión y vuelve a intentarlo.",+ "version": "Revisa si Bytebase soporta este motor o versión."+ },+ "title": "Revisar soporte del motor de base de datos"+ }+ },"create-gcp-credentials": "Para crear credenciales, consulte","database-region": "Región de la base de datos","default-role": "Rol predeterminado",@@ -1169,7 +1245,9 @@},"sync-databases": {"add-database": "+ Agregar base de datos, presione enter para enviar",- "description": "Sincronizar sólo bases de datos seleccionadas.",+ "description": "Elige qué bases de datos sincronizar desde esta instancia.",+ "project-description": "Las bases de datos sincronizadas se agregarán a <project>{{project}}</project>.",+ "project-sync-all": "Sincronizar todas las bases de datos con este proyecto","search-database": "Buscar en la base de datos","self": "Sincronizar bases de datos","sync-all": "Sincronizar todas las bases de datos"@@ -1668,6 +1746,8 @@}},"project": {+ "add-database": "Agregar base de datos",+ "add-database-empty-placeholder": "Agrega una base de datos de una instancia existente a este proyecto","batch": {"archive": {"description": "Esto archivará los proyectos seleccionados. Podrás restaurarlos más tarde si lo necesitas.",@@ -1687,6 +1767,10 @@"warning": "Esta acción no se puede deshacer. Todos los datos del proyecto, incluidos problemas, configuraciones e historial, se eliminarán permanentemente."}},+ "connect-database": "Conectar base de datos",+ "connect-database-empty-placeholder": "Conecta una instancia para sincronizar bases de datos en este proyecto",+ "connect-database-intro-description": "Conecta una base de datos para que Bytebase pueda sincronizarla en este proyecto.",+ "connect-database-intro-title": "Conecta tu primera base de datos","create-modal": {"project-name": "Proyecto Nombre","success-prompt": "Proyecto {{name}} creado exitosamente."@@ -2481,6 +2565,7 @@"workload-identity-tag-hint": "Dejar vacío para permitir todas las etiquetas"},"profile": {+ "default-project-name": "Nuevo proyecto","display-name": "Su nombre","display-name-placeholder": "Ingrese su nombre","email": "Correo electrónico",@@ -2493,9 +2578,10 @@"phone-tips": "Asegúrese de incluir el código del país +1xxxxxx","role": "Rol","setup-failed": "Error al actualizar el perfil.",+ "setup-first-project": "Configurar el primer proyecto","setup-skip": "Lo haré después","setup-success": "Perfil actualizado.",- "setup-title": "¡Bienvenido! Configure su perfil",+ "setup-title": "¡Bienvenido! Configure su espacio de trabajo","subscription": "(Actualice para habilitar la gestión de roles)","workspace-name": "Nombre del espacio de trabajo","workspace-name-placeholder": "Ingrese el nombre del espacio de trabajo"diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex 5f06bd6737..5b56e7719f 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -672,6 +672,7 @@"column": "列","columns": "カラム","comment": "コメント",+ "connect-databases": "データベースを接続","data-size": "データサイズ","edit-environment": "環境の編集","edit-labels": "ラベルを編集",@@ -808,6 +809,13 @@"packages": "パッケージ","partitions": "パーティション","procedures": "ストアドプロシージャ",+ "project-instance-synced-action": "最初の変更を作成",+ "project-instance-synced-description": "このプロジェクトでデータベースを利用できるようになりました。準備ができたら、管理されたデータベース変更から始めてください。",+ "project-instance-synced-sql-editor-action": "SQL Editor を開く",+ "project-instance-synced-title": "データベースが接続されました",+ "project-instance-syncing-description": "数秒から数分かかる場合があります。後でこのページを更新してください。",+ "project-instance-syncing-empty": "データベースはまだ同期中です。しばらくしてからこのページを更新すると表示されます。",+ "project-instance-syncing-title": "{{instance}} のデータベースを同期中です。","schema": {"default": "デフォルトスキーマ"},@@ -932,8 +940,76 @@"psc": "Private Service Connect (PSC)","public": "パブリック IP"},+ "connect-database-to-project": "データベースをプロジェクトに接続",+ "connecting-database-to-project": "データベースを接続中...","connection-info": "接続情報","connection-options": "接続オプション",+ "connection-recovery": {+ "auth": {+ "description": "ユーザー名、パスワード、トークン、または IAM 認証設定を確認してから、もう一度接続をテストしてください。",+ "steps": {+ "credentials": "ユーザー名、パスワード、トークン、またはシークレットマネージャーの値が最新であることを確認してください。",+ "method": "選択した認証方式がデータベース設定と一致していることを確認してください。",+ "retry": "認証情報が Bytebase 外でローテーションされる場合は、再試行前にシークレットソースを更新してください。"+ },+ "title": "データベース認証情報を確認"+ },+ "docs": "接続ガイドを開く",+ "network": {+ "description": "ホストとポートが Bytebase Cloud から到達可能か確認してください。ファイアウォールルール、許可リスト、プロキシ、トンネル、およびデータベースがプライベートネットワーク接続のみを許可していないかを確認してください。",+ "steps": {+ "address": "ホストまたはソケットとポートがデータベースエンドポイントと一致していることを確認してください。",+ "firewall": "Bytebase Cloud を使用する場合は、必要な Cloud IP をデータベースファイアウォールの許可リストに追加してください。",+ "private-network": "プライベートデータベースの場合は、VPN、プライベートネットワーク、または SSH トンネルを先に設定してください。"+ },+ "title": "ネットワーク到達性を確認"+ },+ "permission": {+ "description": "スキーマメタデータの読み取りと、利用予定のワークフロー実行に必要なデータベース権限を持つアカウントを使用してください。",+ "steps": {+ "account": "スキーマメタデータを読み取れるデータベースアカウントを使用してください。",+ "database": "対象データベースがこのアカウントから見えることを確認してください。",+ "workflow": "スキーマ変更や SQL Editor など、利用予定のワークフローに必要な追加権限だけを付与してください。"+ },+ "title": "データベース権限を確認"+ },+ "timeout": {+ "description": "データベースが時間内に応答しませんでした。ファイアウォールルール、ポート設定、ネットワークルーティング、および Bytebase Cloud からの接続が許可されているかを確認してください。",+ "steps": {+ "load": "データベースがオンラインで、新しい接続を受け付けていることを確認してください。",+ "retry": "データベースがファイアウォールの背後にある場合は、許可リストまたはトンネル設定を完了してから再試行してください。",+ "route": "ルーティング、プロキシ、トンネル、ポート、接続タイムアウト設定を確認してください。"+ },+ "title": "ファイアウォールとルーティングを確認"+ },+ "tls": {+ "description": "SSL/TLS モード、証明書、サーバー名、CA 設定を確認してから、もう一度接続をテストしてください。",+ "steps": {+ "certificates": "CA、クライアント証明書、キーの値またはパスを確認してください。",+ "hostname": "証明書がサーバー名と一致していることを確認してください。",+ "mode": "require や verify-full など、データベースが要求する SSL/TLS モードを確認してください。"+ },+ "title": "SSL/TLS 設定を確認"+ },+ "unknown": {+ "description": "まず基本的な接続項目を確認し、エンジン固有のオプションは接続ガイドを参照してください。",+ "steps": {+ "fields": "ホスト、ポート、ユーザー名、パスワードまたはシークレットソース、SSL/TLS モードを確認してください。",+ "help": "データベースがプライベートの場合は、VPN、プライベートネットワーク、または SSH トンネルを設定してから再試行してください。",+ "logs": "データベースにファイアウォールルールがある場合は、Bytebase Cloud またはデプロイ済み Bytebase ネットワークからの接続を許可してください。"+ },+ "title": "接続設定を確認"+ },+ "unsupported": {+ "description": "選択したエンジンが対象データベースと一致しないか、このエンジン/バージョンはまだサポートされていません。",+ "steps": {+ "engine": "選択したデータベースエンジンが対象データベースと一致していることを確認してください。",+ "retry": "別のエンジンを選択するか接続設定を更新してから再試行してください。",+ "version": "このエンジンまたはバージョンが Bytebase でサポートされているか確認してください。"+ },+ "title": "データベースエンジンのサポートを確認"+ }+ },"create-gcp-credentials": "認証情報の作成方法については、を参照してください","database-region": "データベース領域","default-role": "デフォルトロール",@@ -1169,7 +1245,9 @@},"sync-databases": {"add-database": "+ データベースを追加し、Enterキーを押して送信します",- "description": "選択したデータベースのみを同期します。",+ "description": "このインスタンスから同期するデータベースを選択してください。",+ "project-description": "同期されたデータベースは <project>{{project}}</project> に追加されます。",+ "project-sync-all": "すべてのデータベースをこのプロジェクトに同期する","search-database": "データベースを検索","self": "データベースを同期する","sync-all": "すべてのデータベースを同期する"@@ -1668,6 +1746,8 @@}},"project": {+ "add-database": "データベースを追加",+ "add-database-empty-placeholder": "既存のインスタンスのデータベースをこのプロジェクトに追加します","batch": {"archive": {"description": "選択したプロジェクトがアーカイブされます。必要に応じて後で復元できます。",@@ -1687,6 +1767,10 @@"warning": "この操作は元に戻せません。イシュー、設定、履歴を含むすべてのプロジェクトデータが完全に削除されます。"}},+ "connect-database": "データベースに接続",+ "connect-database-empty-placeholder": "インスタンスを接続して、このプロジェクトにデータベースを同期します",+ "connect-database-intro-description": "データベースを接続すると、Bytebase がこのプロジェクトに同期します。",+ "connect-database-intro-title": "最初のデータベースを接続","create-modal": {"project-name": "プロジェクト名前","success-prompt": "{{name}} が正常に作成されました。"@@ -2481,6 +2565,7 @@"workload-identity-tag-hint": "すべてのタグを許可する場合は空欄にしてください"},"profile": {+ "default-project-name": "新しいプロジェクト","display-name": "あなたの名前","display-name-placeholder": "名前を入力してください","email": "メールアドレス",@@ -2493,9 +2578,10 @@"phone-tips": "国コードを必ず含めてください +81xxxxxx","role": "ロール","setup-failed": "プロフィールの更新に失敗しました。",+ "setup-first-project": "最初のプロジェクトを設定","setup-skip": "後で設定する","setup-success": "プロフィールが更新されました。",- "setup-title": "ようこそ!プロフィールを設定してください",+ "setup-title": "ようこそ!ワークスペースを設定してください","subscription": "(有料プランにアップグレードするとキャラクター管理が可能になります)","workspace-name": "ワークスペース名","workspace-name-placeholder": "ワークスペース名を入力"diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex 721fca1567..c9b29d8aef 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -672,6 +672,7 @@"column": "Cột","columns": "Cột","comment": "Bình luận",+ "connect-databases": "Kết nối cơ sở dữ liệu","data-size": "Kích thước dữ liệu","edit-environment": "Chỉnh sửa Môi trường","edit-labels": "Chỉnh sửa nhãn",@@ -808,6 +809,13 @@"packages": "Gói","partitions": "Phân vùng","procedures": "Thủ tục",+ "project-instance-synced-action": "Tạo thay đổi đầu tiên",+ "project-instance-synced-description": "Cơ sở dữ liệu của bạn đã sẵn sàng trong dự án này. Hãy bắt đầu bằng một thay đổi cơ sở dữ liệu được quản trị khi bạn sẵn sàng.",+ "project-instance-synced-sql-editor-action": "Mở SQL Editor",+ "project-instance-synced-title": "Đã kết nối cơ sở dữ liệu",+ "project-instance-syncing-description": "Quá trình này có thể mất vài giây đến vài phút. Bạn có thể làm mới trang này sau.",+ "project-instance-syncing-empty": "Cơ sở dữ liệu vẫn đang được đồng bộ hóa. Hãy làm mới trang này sau ít phút để thấy chúng ở đây.",+ "project-instance-syncing-title": "Cơ sở dữ liệu từ {{instance}} đang được đồng bộ hóa.","schema": {"default": "Schema mặc định"},@@ -932,8 +940,76 @@"psc": "Private Service Connect (PSC)","public": "IP công khai"},+ "connect-database-to-project": "Kết nối cơ sở dữ liệu với dự án",+ "connecting-database-to-project": "Đang kết nối cơ sở dữ liệu...","connection-info": "Thông tin kết nối","connection-options": "Tùy chọn kết nối",+ "connection-recovery": {+ "auth": {+ "description": "Kiểm tra tên người dùng, mật khẩu, token hoặc cấu hình xác thực IAM, rồi kiểm tra kết nối lại.",+ "steps": {+ "credentials": "Xác nhận tên người dùng, mật khẩu, token hoặc giá trị trong secret manager còn hiệu lực.",+ "method": "Kiểm tra phương thức xác thực đã chọn có khớp với cấu hình cơ sở dữ liệu hay không.",+ "retry": "Nếu thông tin xác thực được xoay vòng bên ngoài Bytebase, hãy cập nhật nguồn secret trước khi thử lại."+ },+ "title": "Kiểm tra thông tin đăng nhập cơ sở dữ liệu"+ },+ "docs": "Mở hướng dẫn kết nối",+ "network": {+ "description": "Xác nhận host và port có thể truy cập từ Bytebase Cloud. Kiểm tra firewall, allowlist, proxy, tunnel và liệu cơ sở dữ liệu có chỉ nhận lưu lượng mạng riêng hay không.",+ "steps": {+ "address": "Xác minh host hoặc socket và port khớp với endpoint cơ sở dữ liệu.",+ "firewall": "Nếu dùng Bytebase Cloud, hãy thêm IP Cloud bắt buộc vào allowlist của firewall cơ sở dữ liệu.",+ "private-network": "Với cơ sở dữ liệu riêng tư, hãy cấu hình VPN, mạng riêng hoặc SSH tunnel trước."+ },+ "title": "Kiểm tra khả năng truy cập mạng"+ },+ "permission": {+ "description": "Dùng tài khoản có quyền cơ sở dữ liệu cần thiết để đọc siêu dữ liệu schema và chạy các quy trình bạn định dùng.",+ "steps": {+ "account": "Dùng tài khoản cơ sở dữ liệu có thể đọc siêu dữ liệu schema.",+ "database": "Xác nhận các cơ sở dữ liệu mục tiêu hiển thị với tài khoản này.",+ "workflow": "Chỉ cấp thêm quyền cho quy trình bạn định dùng, ví dụ thay đổi schema hoặc SQL Editor."+ },+ "title": "Kiểm tra quyền cơ sở dữ liệu"+ },+ "timeout": {+ "description": "Cơ sở dữ liệu không phản hồi kịp thời. Kiểm tra firewall, cấu hình port, định tuyến mạng và liệu cơ sở dữ liệu có cho phép kết nối từ Bytebase Cloud hay không.",+ "steps": {+ "load": "Xác nhận cơ sở dữ liệu đang online và nhận kết nối mới.",+ "retry": "Nếu cơ sở dữ liệu nằm sau firewall, hãy hoàn tất allowlist hoặc tunnel trước khi thử lại.",+ "route": "Kiểm tra định tuyến, proxy, tunnel, port và cấu hình timeout kết nối."+ },+ "title": "Kiểm tra firewall và định tuyến"+ },+ "tls": {+ "description": "Kiểm tra chế độ SSL/TLS, chứng chỉ, tên máy chủ và cấu hình CA, rồi kiểm tra kết nối lại.",+ "steps": {+ "certificates": "Xác minh CA, chứng chỉ máy khách và giá trị hoặc đường dẫn khóa.",+ "hostname": "Xác nhận chứng chỉ khớp với tên máy chủ.",+ "mode": "Kiểm tra chế độ SSL/TLS mà cơ sở dữ liệu yêu cầu, ví dụ require hoặc verify-full."+ },+ "title": "Kiểm tra cấu hình SSL/TLS"+ },+ "unknown": {+ "description": "Bắt đầu với các thông tin kết nối cơ bản, rồi dùng hướng dẫn cho tùy chọn theo từng engine.",+ "steps": {+ "fields": "Kiểm tra host, port, username, password hoặc nguồn secret và chế độ SSL/TLS.",+ "help": "Nếu cơ sở dữ liệu là riêng tư, hãy cấu hình VPN, mạng riêng hoặc SSH tunnel trước khi thử lại.",+ "logs": "Nếu cơ sở dữ liệu có firewall, hãy cho phép Bytebase Cloud hoặc mạng Bytebase đã triển khai kết nối."+ },+ "title": "Kiểm tra cấu hình kết nối"+ },+ "unsupported": {+ "description": "Engine đã chọn không khớp với cơ sở dữ liệu mục tiêu hoặc engine/phiên bản này chưa được hỗ trợ.",+ "steps": {+ "engine": "Xác nhận engine cơ sở dữ liệu đã chọn khớp với cơ sở dữ liệu mục tiêu.",+ "retry": "Chọn engine khác hoặc cập nhật cấu hình kết nối, rồi thử lại.",+ "version": "Kiểm tra Bytebase có hỗ trợ engine hoặc phiên bản này hay không."+ },+ "title": "Kiểm tra hỗ trợ engine cơ sở dữ liệu"+ }+ },"create-gcp-credentials": "Để tạo thông tin xác thực, xem","database-region": "Khu vực cơ sở dữ liệu","default-role": "Vai trò mặc định",@@ -1169,7 +1245,9 @@},"sync-databases": {"add-database": "+ Thêm cơ sở dữ liệu, nhấn enter để gửi",- "description": "Chỉ đồng bộ các cơ sở dữ liệu đã chọn.",+ "description": "Chọn cơ sở dữ liệu cần đồng bộ từ instance này.",+ "project-description": "Các cơ sở dữ liệu được đồng bộ sẽ được thêm vào <project>{{project}}</project>.",+ "project-sync-all": "Đồng bộ tất cả cơ sở dữ liệu vào dự án này","search-database": "Tìm kiếm cơ sở dữ liệu","self": "Đồng bộ cơ sở dữ liệu","sync-all": "Đồng bộ tất cả cơ sở dữ liệu"@@ -1668,6 +1746,8 @@}},"project": {+ "add-database": "Thêm cơ sở dữ liệu",+ "add-database-empty-placeholder": "Thêm cơ sở dữ liệu trong một phiên bản hiện có vào dự án này","batch": {"archive": {"description": "Thao tác này sẽ lưu trữ các dự án đã chọn. Bạn có thể khôi phục chúng sau nếu cần.",@@ -1687,6 +1767,10 @@"warning": "Hành động này không thể hoàn tác. Tất cả dữ liệu dự án bao gồm vấn đề, cấu hình và lịch sử sẽ bị xóa vĩnh viễn."}},+ "connect-database": "Kết nối cơ sở dữ liệu",+ "connect-database-empty-placeholder": "Kết nối một phiên bản để đồng bộ cơ sở dữ liệu vào dự án này",+ "connect-database-intro-description": "Kết nối cơ sở dữ liệu để Bytebase đồng bộ vào dự án này.",+ "connect-database-intro-title": "Kết nối cơ sở dữ liệu đầu tiên","create-modal": {"project-name": "Dự án Tên","success-prompt": "Đã tạo thành công dự án {{name}}."@@ -2481,6 +2565,7 @@"workload-identity-tag-hint": "Để trống để cho phép tất cả tag"},"profile": {+ "default-project-name": "Dự án mới","display-name": "Tên của bạn","display-name-placeholder": "Nhập tên của bạn","email": "Email",@@ -2493,9 +2578,10 @@"phone-tips": "Nhớ bao gồm mã quốc gia +1xxxxxx","role": "Vai trò","setup-failed": "Cập nhật hồ sơ thất bại.",+ "setup-first-project": "Thiết lập dự án đầu tiên","setup-skip": "Để sau","setup-success": "Hồ sơ đã được cập nhật.",- "setup-title": "Chào mừng! Thiết lập hồ sơ của bạn",+ "setup-title": "Chào mừng! Thiết lập không gian làm việc của bạn","subscription": "(Nâng cấp để kích hoạt quản lý vai trò)","workspace-name": "Tên không gian làm việc","workspace-name-placeholder": "Nhập tên không gian làm việc"diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 3fc1558cba..a9de0ef495 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -672,6 +672,7 @@"column": "列","columns": "列","comment": "注释",+ "connect-databases": "连接数据库","data-size": "数据大小","edit-environment": "编辑环境","edit-labels": "编辑标签",@@ -808,6 +809,13 @@"packages": "包","partitions": "分区","procedures": "存储过程",+ "project-instance-synced-action": "创建第一个变更",+ "project-instance-synced-description": "你的数据库已在此项目中就绪。准备好后,可以从受管数据库变更开始。",+ "project-instance-synced-sql-editor-action": "打开 SQL Editor",+ "project-instance-synced-title": "数据库已连接",+ "project-instance-syncing-description": "这可能需要几秒到几分钟。你可以稍后刷新此页面。",+ "project-instance-syncing-empty": "数据库仍在同步中。稍后刷新此页面即可在这里看到它们。",+ "project-instance-syncing-title": "{{instance}} 的数据库正在同步。","schema": {"default": "默认 Schema"},@@ -932,8 +940,76 @@"psc": "Private Service Connect (PSC)","public": "公共 IP"},+ "connect-database-to-project": "连接数据库到项目",+ "connecting-database-to-project": "正在连接数据库...","connection-info": "连接信息","connection-options": "连接选项",+ "connection-recovery": {+ "auth": {+ "description": "请检查用户名、密码、令牌或 IAM 认证配置,然后重新测试连接。",+ "steps": {+ "credentials": "确认用户名、密码、令牌或密钥管理器中的值是最新的。",+ "method": "检查选择的认证方式是否与数据库配置一致。",+ "retry": "如果凭据在 Bytebase 外部轮换,请先更新密钥来源再重试。"+ },+ "title": "检查数据库凭据"+ },+ "docs": "打开连接指南",+ "network": {+ "description": "请确认 Bytebase Cloud 可以访问主机和端口。检查防火墙规则、允许列表、代理、隧道,以及数据库是否只接受私有网络流量。",+ "steps": {+ "address": "确认主机或 Socket、端口与数据库端点一致。",+ "firewall": "如果使用 Bytebase Cloud,请在数据库防火墙中允许所需的 Cloud IP。",+ "private-network": "如果数据库是私有网络,请先配置 VPN、私有网络或 SSH 隧道。"+ },+ "title": "检查网络连通性"+ },+ "permission": {+ "description": "请使用具备所需数据库权限的账号,以读取 schema 元数据并执行你计划使用的工作流。",+ "steps": {+ "account": "使用可读取 schema 元数据的数据库账号。",+ "database": "确认目标数据库对该账号可见。",+ "workflow": "仅为计划使用的工作流授予额外权限,例如 schema 变更或 SQL Editor。"+ },+ "title": "检查数据库权限"+ },+ "timeout": {+ "description": "数据库未及时响应。请检查防火墙规则、端口设置、网络路由,以及数据库是否允许来自 Bytebase Cloud 的连接。",+ "steps": {+ "load": "确认数据库在线并接受新连接。",+ "retry": "如果数据库位于防火墙后,请先完成允许列表或隧道配置再重试。",+ "route": "检查路由、代理、隧道、端口和连接超时设置。"+ },+ "title": "检查防火墙和路由"+ },+ "tls": {+ "description": "请检查 SSL/TLS 模式、证书、服务器名称和 CA 设置,然后重新测试连接。",+ "steps": {+ "certificates": "确认 CA、客户端证书和密钥的值或路径正确。",+ "hostname": "确认证书匹配服务器名称。",+ "mode": "检查数据库要求的 SSL/TLS 模式,例如 require 或 verify-full。"+ },+ "title": "检查 SSL/TLS 设置"+ },+ "unknown": {+ "description": "先检查基础连接配置,再参考连接指南中的数据库引擎专属选项。",+ "steps": {+ "fields": "检查主机、端口、用户名、密码或密钥来源,以及 SSL/TLS 模式。",+ "help": "如果数据库是私有网络,请先配置 VPN、私有网络或 SSH 隧道后再重试。",+ "logs": "如果数据库有防火墙规则,请允许 Bytebase Cloud 或已部署的 Bytebase 网络连接。"+ },+ "title": "检查连接配置"+ },+ "unsupported": {+ "description": "所选数据库引擎与目标数据库不匹配,或该引擎/版本暂不支持。",+ "steps": {+ "engine": "确认选择的数据库引擎与目标数据库一致。",+ "retry": "选择其他引擎或更新连接配置后重试。",+ "version": "检查 Bytebase 是否支持该引擎或版本。"+ },+ "title": "检查数据库引擎支持"+ }+ },"create-gcp-credentials": "创建凭据的方法见","database-region": "数据库区域","default-role": "默认角色",@@ -1169,7 +1245,9 @@},"sync-databases": {"add-database": "+ 添加数据库,按回车键提交",- "description": "仅同步选定的数据库。",+ "description": "选择要从此实例同步的数据库。",+ "project-description": "同步的数据库将添加到 <project>{{project}}</project>。",+ "project-sync-all": "将所有数据库同步到此项目","search-database": "搜索数据库","self": "同步数据库","sync-all": "同步所有数据库"@@ -1668,6 +1746,8 @@}},"project": {+ "add-database": "添加数据库",+ "add-database-empty-placeholder": "将现有实例中的数据库添加到此项目","batch": {"archive": {"description": "这将归档所选项目。如有需要,您可以稍后恢复它们。",@@ -1687,6 +1767,10 @@"warning": "此操作无法撤消。包括工单、配置和历史记录在内的所有项目数据将被永久删除。"}},+ "connect-database": "连接数据库",+ "connect-database-empty-placeholder": "连接实例,将数据库同步到此项目",+ "connect-database-intro-description": "连接数据库后,Bytebase 会将它同步到这个项目中。",+ "connect-database-intro-title": "连接第一个数据库","create-modal": {"project-name": "项目名称","success-prompt": "成功创建 {{name}}."@@ -2481,6 +2565,7 @@"workload-identity-tag-hint": "留空则允许所有标签"},"profile": {+ "default-project-name": "新项目","display-name": "您的姓名","display-name-placeholder": "输入您的姓名","email": "邮箱",@@ -2493,9 +2578,10 @@"phone-tips": "请包含国家代码前缀 +86xxxxxx","role": "角色","setup-failed": "更新个人资料失败。",+ "setup-first-project": "设置第一个项目","setup-skip": "稍后再说","setup-success": "个人资料已更新。",- "setup-title": "欢迎!设置您的个人资料",+ "setup-title": "欢迎!设置您的工作空间","subscription": "(升级到付费方案来解锁角色管理)","workspace-name": "工作空间名称","workspace-name-placeholder": "输入工作空间名称"diff --git a/frontend/src/react/components/ProjectPageLayout.tsx b/frontend/src/react/components/ProjectPageLayout.tsxindex 030e1e1cb5..672a69dccc 100644--- a/frontend/src/react/components/ProjectPageLayout.tsx+++ b/frontend/src/react/components/ProjectPageLayout.tsx@@ -7,7 +7,7 @@ const styles = stylex.create({root: {display: "flex",flexDirection: "column",- overflowX: "hidden",+ overflowX: "clip",paddingBlock: 16,paddingInline: 16,rowGap: 16,diff --git a/frontend/src/react/components/WorkspacePageLayout.tsx b/frontend/src/react/components/WorkspacePageLayout.tsxindex 30c35d203a..b5d18618dd 100644--- a/frontend/src/react/components/WorkspacePageLayout.tsx+++ b/frontend/src/react/components/WorkspacePageLayout.tsx@@ -7,7 +7,7 @@ const styles = stylex.create({root: {display: "flex",flexDirection: "column",- overflowX: "hidden",+ overflowX: "clip",paddingBlock: 16,rowGap: 16,width: "100%",@@ -19,6 +19,7 @@ const styles = stylex.create({minWidth: 0,},footer: {+ marginInline: 8,marginTop: 16,},toolbar: {diff --git a/frontend/src/react/components/database/DatabaseTable.test.tsx b/frontend/src/react/components/database/DatabaseTable.test.tsxindex bdfbf5eae8..3d5b81a2d9 100644--- a/frontend/src/react/components/database/DatabaseTable.test.tsx+++ b/frontend/src/react/components/database/DatabaseTable.test.tsx@@ -57,9 +57,18 @@ vi.mock("@/react/hooks/usePagedData", () => ({}));vi.mock("./DatabaseTableView", () => ({- DatabaseTableView: ({ databases }: { databases: Database[] }) => (+ DatabaseTableView: ({+ databases,+ emptyPlaceholder,+ }: {+ databases: Database[];+ emptyPlaceholder?: React.ReactNode;+ }) => (<div data-testid="database-names">{databases.map((database) => database.name).join(",")}+ {emptyPlaceholder && (+ <div data-testid="empty-placeholder">{emptyPlaceholder}</div>+ )}</div>),}));@@ -143,4 +152,56 @@ describe("DatabaseTable", () => {container.querySelector("[data-testid='database-names']")?.textContent).toBe(`${db1.name},${db2.name}`);});++ test("forwards empty placeholder only after a truly empty page loads", async () => {+ container = document.createElement("div");+ document.body.appendChild(container);+ root = createRoot(container);++ mocks.fetchDatabases.mockResolvedValueOnce({+ databases: [],+ nextPageToken: "",+ });++ await act(async () => {+ root!.render(+ <DatabaseTable+ filter={{}}+ parent="instances/i"+ emptyPlaceholder={<button type="button">connect database</button>}+ />+ );+ await Promise.resolve();+ });++ expect(+ container.querySelector("[data-testid='empty-placeholder']")?.textContent+ ).toContain("connect database");+ });++ test("does not forward empty placeholder while more pages may exist", async () => {+ container = document.createElement("div");+ document.body.appendChild(container);+ root = createRoot(container);++ mocks.fetchDatabases.mockResolvedValueOnce({+ databases: [],+ nextPageToken: "next",+ });++ await act(async () => {+ root!.render(+ <DatabaseTable+ filter={{}}+ parent="instances/i"+ emptyPlaceholder={<button type="button">connect database</button>}+ />+ );+ await Promise.resolve();+ });++ expect(+ container.querySelector("[data-testid='empty-placeholder']")+ ).toBeNull();+ });});diff --git a/frontend/src/react/components/database/DatabaseTable.tsx b/frontend/src/react/components/database/DatabaseTable.tsxindex ef9beace78..a31199bd69 100644--- a/frontend/src/react/components/database/DatabaseTable.tsx+++ b/frontend/src/react/components/database/DatabaseTable.tsx@@ -34,6 +34,7 @@ export interface DatabaseTableProps {*/onDatabasesChange?: (databases: Database[]) => void;refreshToken?: number;+ emptyPlaceholder?: React.ReactNode;}function databaseFilterKey(filter: DatabaseFilter | string | undefined) {@@ -68,6 +69,7 @@ export function DatabaseTable({onSelectedNamesChange,onDatabasesChange,refreshToken,+ emptyPlaceholder,}: DatabaseTableProps) {const [databases, setDatabases] = useState<Database[]>([]);const [loading, setLoading] = useState(true);@@ -179,6 +181,11 @@ export function DatabaseTable({databases={databases}mode={mode}loading={loading}+ emptyPlaceholder={+ !loading && databases.length === 0 && !hasMore+ ? emptyPlaceholder+ : undefined+ }selectedNames={selectedNames}onSelectedNamesChange={onSelectedNamesChange}sort={sort}diff --git a/frontend/src/react/components/database/DatabaseTableView.test.tsx b/frontend/src/react/components/database/DatabaseTableView.test.tsxnew file mode 100644index 0000000000..b0f09c1a33--- /dev/null+++ b/frontend/src/react/components/database/DatabaseTableView.test.tsx@@ -0,0 +1,67 @@+import { act } from "react";+import { createRoot, type Root } from "react-dom/client";+import { afterEach, describe, expect, test, vi } from "vitest";+import { DatabaseTableView } from "./DatabaseTableView";++(+ globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }+).IS_REACT_ACT_ENVIRONMENT = true;++vi.mock("react-i18next", () => ({+ initReactI18next: { type: "3rdParty", init: () => {} },+ useTranslation: () => ({ t: (key: string) => key }),+}));++vi.mock("@/react/hooks/useAppState", () => ({+ useEnvironmentList: () => [],+ usePlanFeature: () => false,+}));++describe("DatabaseTableView", () => {+ let root: Root | undefined;+ let container: HTMLDivElement | undefined;+ let clientWidthSpy: { mockRestore: () => void } | undefined;++ afterEach(() => {+ act(() => {+ root?.unmount();+ });+ root = undefined;+ container = undefined;+ clientWidthSpy?.mockRestore();+ clientWidthSpy = undefined;+ document.body.innerHTML = "";+ });++ test("centers the empty placeholder within the visible scroll container", async () => {+ clientWidthSpy = vi+ .spyOn(HTMLElement.prototype, "clientWidth", "get")+ .mockImplementation(function (this: HTMLElement) {+ return this.dataset.testid === "database-table-scroll-container"+ ? 640+ : 0;+ });+ container = document.createElement("div");+ document.body.appendChild(container);+ root = createRoot(container);++ await act(async () => {+ root!.render(+ <DatabaseTableView+ databases={[]}+ mode="PROJECT"+ emptyPlaceholder={<button type="button">connect database</button>}+ />+ );+ await Promise.resolve();+ });++ const placeholder = container.querySelector(+ "[data-testid='database-table-empty-placeholder']"+ ) as HTMLDivElement;++ expect(placeholder).toBeTruthy();+ expect(placeholder.className).toContain("sticky");+ expect(placeholder.style.width).toBe("640px");+ });+});diff --git a/frontend/src/react/components/database/DatabaseTableView.tsx b/frontend/src/react/components/database/DatabaseTableView.tsxindex 49ad6b575a..dde57046aa 100644--- a/frontend/src/react/components/database/DatabaseTableView.tsx+++ b/frontend/src/react/components/database/DatabaseTableView.tsx@@ -1,5 +1,12 @@import { CheckCircle, XCircle } from "lucide-react";-import { memo, useCallback, useMemo, useRef } from "react";+import {+ memo,+ useCallback,+ useLayoutEffect,+ useMemo,+ useRef,+ useState,+} from "react";import { useTranslation } from "react-i18next";import { EngineIcon } from "@/react/components/EngineIcon";import { EnvironmentBadge } from "@/react/components/EnvironmentLabel";@@ -10,6 +17,7 @@ import {Table,TableBody,TableCell,+ TableEmptyView,TableHead,TableHeader,TableRow,@@ -46,6 +54,7 @@ interface DatabaseTableViewProps {databases: Database[];mode?: DatabaseTableMode;loading?: boolean;+ emptyPlaceholder?: React.ReactNode;/** Selection — pass both to enable the checkbox column. */selectedNames?: Set<string>;onSelectedNamesChange?: (names: Set<string>) => void;@@ -90,6 +99,7 @@ export function DatabaseTableView({databases,mode = "ALL",loading = false,+ emptyPlaceholder,selectedNames,onSelectedNamesChange,sort,@@ -97,6 +107,10 @@ export function DatabaseTableView({onRowClick,}: DatabaseTableViewProps) {const { t } = useTranslation();+ const scrollContainerRef = useRef<HTMLDivElement>(null);+ const [visibleTableWidth, setVisibleTableWidth] = useState<+ number | undefined+ >();// Lift environment + feature lookups to the table level so the per-row// env cell doesn't subscribe to Zustand or run a `.find()` per render.@@ -303,8 +317,31 @@ export function DatabaseTableView({const totalColumnCount = columns.length + (showSelection ? 1 : 0);+ useLayoutEffect(() => {+ const container = scrollContainerRef.current;+ if (!container) return;++ const updateVisibleWidth = () => {+ setVisibleTableWidth(container.clientWidth || undefined);+ };+ updateVisibleWidth();++ if (typeof ResizeObserver !== "undefined") {+ const resizeObserver = new ResizeObserver(updateVisibleWidth);+ resizeObserver.observe(container);+ return () => resizeObserver.disconnect();+ }++ window.addEventListener("resize", updateVisibleWidth);+ return () => window.removeEventListener("resize", updateVisibleWidth);+ }, []);+return (- <div className="overflow-x-auto border rounded-sm">+ <div+ ref={scrollContainerRef}+ data-testid="database-table-scroll-container"+ className="overflow-x-auto border rounded-sm"+ ><Table className="table-fixed" style={{ minWidth: `${totalWidth}px` }}><colgroup>{showSelection && <col style={{ width: "48px" }} />}@@ -372,14 +409,16 @@ export function DatabaseTableView({</TableCell></TableRow>) : databases.length === 0 ? (- <TableRow>- <TableCell- colSpan={totalColumnCount}- className="py-8 text-center text-control-placeholder"- >- {t("common.no-data")}- </TableCell>- </TableRow>+ <TableEmptyView+ colSpan={totalColumnCount}+ contentTestId="database-table-empty-placeholder"+ contentClassName="sticky left-0"+ contentStyle={+ visibleTableWidth ? { width: visibleTableWidth } : undefined+ }+ >+ {emptyPlaceholder ?? t("common.no-data")}+ </TableEmptyView>) : (databases.map((db) => (<DatabaseRowViewdiff --git a/frontend/src/react/components/header/ProjectCreateDialog.tsx b/frontend/src/react/components/header/ProjectCreateDialog.tsxindex 50f056a82a..872bc97cb9 100644--- a/frontend/src/react/components/header/ProjectCreateDialog.tsx+++ b/frontend/src/react/components/header/ProjectCreateDialog.tsx@@ -26,10 +26,13 @@ import {useNotify,useWorkspacePermission,} from "@/react/hooks/useAppState";+import { CONNECT_DATABASE_PRODUCT_INTRO } from "@/react/lib/productIntro";import { projectNamePrefix } from "@/react/lib/resourceName";import { useNavigate } from "@/react/router";+import { PROJECT_V1_ROUTE_DATABASES } from "@/react/router/handles";import { useAppStore } from "@/react/stores/app";import type { Project } from "@/types/proto-es/v1/project_service_pb";+import { extractProjectResourceName } from "@/utils";export interface ProjectCreateDialogProps {open: boolean;@@ -112,7 +115,13 @@ export function ProjectCreateDialog({onCreated(createdProject);} else {setRecentProject(createdProject.name);- void navigate.push({ path: `/${createdProject.name}` });+ void navigate.push({+ name: PROJECT_V1_ROUTE_DATABASES,+ params: {+ projectId: extractProjectResourceName(createdProject.name),+ },+ query: { intro: CONNECT_DATABASE_PRODUCT_INTRO },+ });}onClose();diff --git a/frontend/src/react/components/header/ProjectCreateDialogLayout.test.ts b/frontend/src/react/components/header/ProjectCreateDialogLayout.test.tsindex 8f80177b75..f2891a1a71 100644--- a/frontend/src/react/components/header/ProjectCreateDialogLayout.test.ts+++ b/frontend/src/react/components/header/ProjectCreateDialogLayout.test.ts@@ -20,4 +20,21 @@ describe("ProjectCreateDialog layout", () => {expect(source).not.toContain('className="flex flex-col gap-y-6"');expect(source).not.toContain("<label");});++ test("opens the database page after creating a project", () => {+ const source = readFileSync(+ join(componentDir, "ProjectCreateDialog.tsx"),+ "utf8"+ );++ expect(source).toContain("PROJECT_V1_ROUTE_DATABASES");+ expect(source).toContain("name: PROJECT_V1_ROUTE_DATABASES");+ expect(source).toContain(+ "projectId: extractProjectResourceName(createdProject.name)"+ );+ expect(source).toContain(+ "query: { intro: CONNECT_DATABASE_PRODUCT_INTRO }"+ );+ expect(source).not.toContain("path: `/${createdProject.name}`");+ });});diff --git a/frontend/src/react/components/header/ProjectSwitchPanel.test.tsx b/frontend/src/react/components/header/ProjectSwitchPanel.test.tsxindex 23411e152f..8c470a697b 100644--- a/frontend/src/react/components/header/ProjectSwitchPanel.test.tsx+++ b/frontend/src/react/components/header/ProjectSwitchPanel.test.tsx@@ -321,4 +321,31 @@ describe("ProjectSwitchPanel", () => {expect(mocks.close).toHaveBeenCalled();unmount();});++ test("keeps project lists constrained to vertical scrolling", () => {+ const { container, render, unmount } = renderIntoContainer(+ <ProjectSwitchPanel+ onClose={mocks.close}+ onRequestCreate={mocks.requestCreate}+ />+ );++ render();++ const scrollContainers = Array.from(+ container.querySelectorAll("div")+ ).filter((div) => div.className.includes("max-h-[26rem]"));+ expect(scrollContainers).toHaveLength(2);+ for (const scrollContainer of scrollContainers) {+ expect(scrollContainer.className).toContain("overflow-y-auto");+ expect(scrollContainer.className).toContain("overflow-x-hidden");+ expect(scrollContainer.className).not.toContain("overflow-auto");+ }++ for (const table of container.querySelectorAll("table")) {+ expect(table.className).toContain("table-fixed");+ }++ unmount();+ });});diff --git a/frontend/src/react/components/header/ProjectSwitchPanel.tsx b/frontend/src/react/components/header/ProjectSwitchPanel.tsxindex c2d7b66306..2c4c161b24 100644--- a/frontend/src/react/components/header/ProjectSwitchPanel.tsx+++ b/frontend/src/react/components/header/ProjectSwitchPanel.tsx@@ -247,8 +247,9 @@ export function ProjectSwitchPanel({</div><TabsPanel value="recent" className="mt-0">- <div className="max-h-[26rem] overflow-auto">+ <div className="max-h-[26rem] overflow-y-auto overflow-x-hidden"><ProjectTable+ className="table-fixed"projectList={filteredRecentProjectList}currentProject={currentProject}keyword={searchText}@@ -259,8 +260,9 @@ export function ProjectSwitchPanel({</TabsPanel><TabsPanel value="all" className="mt-0">- <div className="max-h-[26rem] overflow-auto">+ <div className="max-h-[26rem] overflow-y-auto overflow-x-hidden"><ProjectTable+ className="table-fixed"projectList={allProjects}currentProject={currentProject}keyword={searchText}diff --git a/frontend/src/react/components/instance/ConnectionRecovery.test.ts b/frontend/src/react/components/instance/ConnectionRecovery.test.tsnew file mode 100644index 0000000000..f36ef5286a--- /dev/null+++ b/frontend/src/react/components/instance/ConnectionRecovery.test.ts@@ -0,0 +1,80 @@+import { readFileSync } from "node:fs";+import { join } from "node:path";+import { describe, expect, test } from "vitest";+import { normalizeConnectionFailureCategory } from "./ConnectionRecovery";++describe("ConnectionRecovery", () => {+ test("normalizes backend connection failure categories", () => {+ expect(normalizeConnectionFailureCategory("auth_failed")).toBe(+ "auth_failed"+ );+ expect(normalizeConnectionFailureCategory("ssl_tls_failed")).toBe(+ "ssl_tls_failed"+ );+ expect(normalizeConnectionFailureCategory("not_a_category")).toBe(+ "unknown"+ );+ expect(normalizeConnectionFailureCategory(undefined)).toBe("unknown");+ });++ test("renders recovery with the shared warning alert", () => {+ const source = readFileSync(+ join(+ process.cwd(),+ "src/react/components/instance/ConnectionRecovery.tsx"+ ),+ "utf-8"+ );++ expect(source).toContain('from "@/react/components/ui/alert"');+ expect(source).toContain("<Alert");+ expect(source).toContain('variant="warning"');+ expect(source).not.toContain("border-control-border bg-control-bg");+ expect(source).not.toContain("toLowerCase");+ });++ test("shows category-specific recovery steps", () => {+ const source = readFileSync(+ join(+ process.cwd(),+ "src/react/components/instance/ConnectionRecovery.tsx"+ ),+ "utf-8"+ );++ expect(source).toContain("steps:");+ expect(source).toContain("recovery.steps.map");+ expect(source).toContain("<ul");+ expect(source).toContain("<li");+ expect(source).toContain("instance.connection-recovery.auth.steps");+ expect(source).toContain("instance.connection-recovery.network.steps");+ expect(source).toContain("instance.connection-recovery.permission.steps");+ expect(source).toContain("instance.connection-recovery.timeout.steps");+ expect(source).toContain("instance.connection-recovery.tls.steps");+ expect(source).toContain("instance.connection-recovery.unsupported.steps");+ expect(source).toContain("instance.connection-recovery.unknown.steps");+ });++ test("links to official connection docs instead of backend-only guidance", () => {+ const source = readFileSync(+ join(+ process.cwd(),+ "src/react/components/instance/ConnectionRecovery.tsx"+ ),+ "utf-8"+ );+ const enUS = readFileSync(+ join(process.cwd(), "src/locales/en-US.json"),+ "utf-8"+ );++ expect(source).toContain(+ 'href="https://docs.bytebase.com/get-started/connect/overview?source=console"'+ );+ expect(source).toContain('target="_blank"');+ expect(source).toContain('rel="noreferrer"');+ expect(source).toContain("instance.connection-recovery.docs");+ expect(enUS).not.toContain("Check Bytebase backend logs");+ expect(enUS).not.toContain("Review required connection fields");+ });+});diff --git a/frontend/src/react/components/instance/ConnectionRecovery.tsx b/frontend/src/react/components/instance/ConnectionRecovery.tsxnew file mode 100644index 0000000000..0298a1f224--- /dev/null+++ b/frontend/src/react/components/instance/ConnectionRecovery.tsx@@ -0,0 +1,134 @@+import { ExternalLink } from "lucide-react";+import { useTranslation } from "react-i18next";+import { Alert } from "@/react/components/ui/alert";++export type ConnectionFailureCategory =+ | "auth_failed"+ | "network_unreachable"+ | "permission_denied"+ | "ssl_tls_failed"+ | "timeout"+ | "unsupported_engine"+ | "unknown";++const connectionFailureCategorySet = new Set<ConnectionFailureCategory>([+ "auth_failed",+ "network_unreachable",+ "permission_denied",+ "ssl_tls_failed",+ "timeout",+ "unsupported_engine",+ "unknown",+]);++export const connectionFailureCategoryHeader =+ "bytebase-connection-failure-category";++export const normalizeConnectionFailureCategory = (+ value: string | null | undefined+): ConnectionFailureCategory => {+ if (!value) return "unknown";+ if (connectionFailureCategorySet.has(value as ConnectionFailureCategory)) {+ return value as ConnectionFailureCategory;+ }+ return "unknown";+};++export function ConnectionRecovery({+ category,+ className,+}: Readonly<{+ category: ConnectionFailureCategory;+ className?: string;+}>) {+ const { t } = useTranslation();+ const recovery = {+ auth_failed: {+ title: t("instance.connection-recovery.auth.title"),+ description: t("instance.connection-recovery.auth.description"),+ steps: [+ t("instance.connection-recovery.auth.steps.credentials"),+ t("instance.connection-recovery.auth.steps.method"),+ t("instance.connection-recovery.auth.steps.retry"),+ ],+ },+ network_unreachable: {+ title: t("instance.connection-recovery.network.title"),+ description: t("instance.connection-recovery.network.description"),+ steps: [+ t("instance.connection-recovery.network.steps.address"),+ t("instance.connection-recovery.network.steps.firewall"),+ t("instance.connection-recovery.network.steps.private-network"),+ ],+ },+ permission_denied: {+ title: t("instance.connection-recovery.permission.title"),+ description: t("instance.connection-recovery.permission.description"),+ steps: [+ t("instance.connection-recovery.permission.steps.account"),+ t("instance.connection-recovery.permission.steps.database"),+ t("instance.connection-recovery.permission.steps.workflow"),+ ],+ },+ timeout: {+ title: t("instance.connection-recovery.timeout.title"),+ description: t("instance.connection-recovery.timeout.description"),+ steps: [+ t("instance.connection-recovery.timeout.steps.load"),+ t("instance.connection-recovery.timeout.steps.retry"),+ t("instance.connection-recovery.timeout.steps.route"),+ ],+ },+ ssl_tls_failed: {+ title: t("instance.connection-recovery.tls.title"),+ description: t("instance.connection-recovery.tls.description"),+ steps: [+ t("instance.connection-recovery.tls.steps.certificates"),+ t("instance.connection-recovery.tls.steps.hostname"),+ t("instance.connection-recovery.tls.steps.mode"),+ ],+ },+ unsupported_engine: {+ title: t("instance.connection-recovery.unsupported.title"),+ description: t("instance.connection-recovery.unsupported.description"),+ steps: [+ t("instance.connection-recovery.unsupported.steps.engine"),+ t("instance.connection-recovery.unsupported.steps.retry"),+ t("instance.connection-recovery.unsupported.steps.version"),+ ],+ },+ unknown: {+ title: t("instance.connection-recovery.unknown.title"),+ description: t("instance.connection-recovery.unknown.description"),+ steps: [+ t("instance.connection-recovery.unknown.steps.fields"),+ t("instance.connection-recovery.unknown.steps.help"),+ t("instance.connection-recovery.unknown.steps.logs"),+ ],+ },+ }[category];++ return (+ <Alert+ variant="warning"+ title={recovery.title}+ description={recovery.description}+ className={className}+ >+ <ul className="mt-2 list-disc pl-5 text-sm leading-6 opacity-90">+ {recovery.steps.map((step) => (+ <li key={step}>{step}</li>+ ))}+ </ul>+ <a+ className="mt-3 inline-flex items-center gap-x-1 text-sm font-medium underline underline-offset-2"+ href="https://docs.bytebase.com/get-started/connect/overview?source=console"+ target="_blank"+ rel="noreferrer"+ >+ {t("instance.connection-recovery.docs")}+ <ExternalLink className="size-3.5" />+ </a>+ </Alert>+ );+}diff --git a/frontend/src/react/components/instance/InstanceFormBody.test.ts b/frontend/src/react/components/instance/InstanceFormBody.test.tsindex 4145a64a3e..5ff482c3e4 100644--- a/frontend/src/react/components/instance/InstanceFormBody.test.ts+++ b/frontend/src/react/components/instance/InstanceFormBody.test.ts@@ -29,17 +29,108 @@ describe("InstanceFormBody", () => {"utf-8");+ const basicInfoIndex = source.indexOf("{/* Basic Info Card */}");const connectionCardIndex = source.indexOf("{/* Connection Card */}");const syncDatabasesIndex = source.indexOf("{/* Sync Databases */}");const connectionOptionsIndex = source.indexOf("{/* Connection Options Card */}");- expect(connectionCardIndex).toBeGreaterThanOrEqual(0);+ expect(basicInfoIndex).toBeGreaterThanOrEqual(0);+ expect(connectionCardIndex).toBeGreaterThan(basicInfoIndex);expect(syncDatabasesIndex).toBeGreaterThan(connectionCardIndex);expect(syncDatabasesIndex).toBeLessThan(connectionOptionsIndex);});+ test("explains project-aware database sync in the instance form", () => {+ const source = readFileSync(+ join(process.cwd(), "src/react/components/instance/InstanceFormBody.tsx"),+ "utf-8"+ );++ expect(source).not.toContain("instance.sync-databases.project-self");+ expect(source).not.toContain("showLabel && !hasProjectContext");+ expect(source).toContain("title={showLabel");+ expect(source).toContain("instance.sync-databases.description");+ expect(source).toContain('t("instance.sync-databases.self")');+ expect(source).toContain("instance.sync-databases.project-description");+ expect(source).toContain("instance.sync-databases.project-sync-all");+ expect(source).toContain("projectName");+ expect(source).toContain("fetchProject(routeProjectName");+ expect(source).toContain("ResourceLink");+ expect(source).toContain("showResourceType={false}");+ expect(source).toContain('className="underline underline-offset-2"');+ expect(source).toContain('target="_blank"');+ expect(source).toContain('rel="noopener noreferrer"');+ });++ test("lets users load more database sync options", () => {+ const source = readFileSync(+ join(process.cwd(), "src/react/components/instance/InstanceFormBody.tsx"),+ "utf-8"+ );++ expect(source).toContain("pendingScrollDatabaseRef");+ expect(source).toContain("scrollIntoView");+ expect(source).toContain("visibleDatabaseCount");+ expect(source).toContain("setVisibleDatabaseCount");+ expect(source).toContain(+ "filteredDatabases.slice(0, visibleDatabaseCount)"+ );+ expect(source).toContain('t("common.load-more")');+ expect(source).not.toContain('{t("common.load-more")} (');+ expect(source).not.toContain(+ "filteredDatabases.length - MAX_VISIBLE_DATABASES"+ );+ });++ test("shows cloud connection instruction under the connection section title", () => {+ const source = readFileSync(+ join(process.cwd(), "src/react/components/instance/InstanceFormBody.tsx"),+ "utf-8"+ );++ const connectionTitleIndex = source.indexOf(+ 't("instance.section.connection")'+ );+ const firewallInfoIndex = source.indexOf(+ 't("instance.sentence.firewall-info")'+ );+ const firewallAlertIndex = source.indexOf(+ '<Alert variant="info"',+ connectionTitleIndex+ );+ const connectionGridIndex = source.indexOf(+ 'className="mt-3 grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-4"',+ connectionTitleIndex+ );++ expect(connectionTitleIndex).toBeGreaterThanOrEqual(0);+ expect(firewallAlertIndex).toBeGreaterThan(connectionTitleIndex);+ expect(firewallAlertIndex).toBeLessThan(firewallInfoIndex);+ expect(firewallInfoIndex).toBeGreaterThan(connectionTitleIndex);+ expect(firewallInfoIndex).toBeLessThan(connectionGridIndex);+ expect(source).toContain(+ 'href="https://docs.bytebase.com/get-started/cloud#prerequisites"'+ );+ });++ test("shows connection recovery for explicit test connection failures", () => {+ const source = readFileSync(+ join(process.cwd(), "src/react/components/instance/InstanceFormBody.tsx"),+ "utf-8"+ );++ expect(source).toContain("ConnectionRecovery");+ expect(source).toContain("testConnectionFailure");+ expect(source).toContain("message: result.message");+ expect(source).toContain("failureCategory: result.failureCategory");+ expect(source).toContain("setTestConnectionFailure(undefined)");+ expect(source).toContain(+ "category={testConnectionFailure.failureCategory}"+ );+ });+test("refetches database previews when pending create instance changes", () => {const source = readFileSync(join(process.cwd(), "src/react/components/instance/InstanceFormBody.tsx"),diff --git a/frontend/src/react/components/instance/InstanceFormBody.tsx b/frontend/src/react/components/instance/InstanceFormBody.tsxindex 47198d9df8..61aa6b49fc 100644--- a/frontend/src/react/components/instance/InstanceFormBody.tsx+++ b/frontend/src/react/components/instance/InstanceFormBody.tsx@@ -9,7 +9,7 @@ import {Trash2,} from "lucide-react";import { useCallback, useEffect, useMemo, useRef, useState } from "react";-import { useTranslation } from "react-i18next";+import { Trans, useTranslation } from "react-i18next";import { EngineIcon } from "@/react/components/EngineIcon";import { EnvironmentSelect } from "@/react/components/EnvironmentSelect";import { FeatureBadge } from "@/react/components/FeatureBadge";@@ -17,6 +17,7 @@ import { LabelListEditor } from "@/react/components/LabelListEditor";import { LearnMoreLink } from "@/react/components/LearnMoreLink";import { ResourceIdField } from "@/react/components/ResourceIdField";import { RouterLink } from "@/react/components/RouterLink";+import { ResourceLink } from "@/react/components/sql-review/ResourceLink";import { Alert } from "@/react/components/ui/alert";import { Button } from "@/react/components/ui/button";import { Checkbox } from "@/react/components/ui/checkbox";@@ -29,11 +30,13 @@ import {import { Input } from "@/react/components/ui/input";import { RadioGroup, RadioGroupItem } from "@/react/components/ui/radio-group";import { cn } from "@/react/lib/utils";+import { router } from "@/react/router";import { useAppStore } from "@/react/stores/app";import { pushNotification } from "@/store";import {environmentNamePrefix,instanceNamePrefix,+ projectNamePrefix,} from "@/store/modules/v1/common";import {isValidEnvironmentName,@@ -59,6 +62,10 @@ import {supportedEngineV1List,urlfy,} from "@/utils";+import {+ type ConnectionFailureCategory,+ ConnectionRecovery,+} from "./ConnectionRecovery";import type { EditDataSource } from "./common";import { hasSslConfig } from "./common";import {@@ -403,12 +410,14 @@ function SyncDatabases({isCreating: isCreatingProp,showLabel,allowEdit,+ projectName,syncDatabases,onSyncDatabasesChange,}: {isCreating: boolean;showLabel: boolean;allowEdit: boolean;+ projectName?: string;syncDatabases: string[];onSyncDatabasesChange: (databases: string[]) => void;}) {@@ -424,6 +433,11 @@ function SyncDatabases({const [loading, setLoading] = useState(false);const [searchText, setSearchText] = useState("");const [inputDatabase, setInputDatabase] = useState("");+ const [visibleDatabaseCount, setVisibleDatabaseCount] = useState(+ MAX_VISIBLE_DATABASES+ );+ const pendingScrollDatabaseRef = useRef<string | null>(null);+ const firstNewDatabaseRef = useRef<HTMLLabelElement | null>(null);// Notify parent only when selection actually changes.const onSyncDatabasesChangeRef = useRef(onSyncDatabasesChange);@@ -461,16 +475,26 @@ function SyncDatabases({};}, [syncAll, isCreatingProp, pendingCreateInstance, instance]);+ useEffect(() => {+ setVisibleDatabaseCount(MAX_VISIBLE_DATABASES);+ }, [databaseList, searchText]);++ useEffect(() => {+ if (!pendingScrollDatabaseRef.current) return;+ firstNewDatabaseRef.current?.scrollIntoView({ block: "nearest" });+ pendingScrollDatabaseRef.current = null;+ firstNewDatabaseRef.current = null;+ }, [visibleDatabaseCount]);+if (hideAdvancedFeatures) return null;const lowerSearch = searchText.toLowerCase();const filteredDatabases = lowerSearch? [...databaseList].filter((db) => db.toLowerCase().includes(lowerSearch)): [...databaseList];- const hasMore = filteredDatabases.length > MAX_VISIBLE_DATABASES;- const visibleDatabases = hasMore- ? filteredDatabases.slice(0, MAX_VISIBLE_DATABASES)- : filteredDatabases;+ const visibleDatabases = filteredDatabases.slice(0, visibleDatabaseCount);+ const hasMore = filteredDatabases.length > visibleDatabaseCount;+ const hasProjectContext = !!projectName && isCreatingProp;const handleKeyDown = (e: React.KeyboardEvent) => {if (e.nativeEvent.isComposing) return;@@ -495,6 +519,12 @@ function SyncDatabases({});};+ const loadMoreDatabases = () => {+ pendingScrollDatabaseRef.current =+ filteredDatabases[visibleDatabaseCount] ?? null;+ setVisibleDatabaseCount((count) => count + MAX_VISIBLE_DATABASES);+ };+return (<FormFieldclassName="sm:col-span-4 sm:col-start-1"@@ -504,13 +534,35 @@ function SyncDatabases({}><div className="flex flex-col gap-y-2">+ {hasProjectContext && (+ <Alert variant="info">+ <Trans+ t={t}+ i18nKey="instance.sync-databases.project-description"+ values={{ project: projectName }}+ components={{+ project: (+ <ResourceLink+ resource={projectName || ""}+ showResourceType={false}+ className="underline underline-offset-2"+ target="_blank"+ rel="noopener noreferrer"+ />+ ),+ }}+ />+ </Alert>+ )}<label className="flex items-center gap-x-2 cursor-pointer"><Checkboxchecked={syncAll}disabled={!allowEdit}onCheckedChange={(checked) => setSyncAll(checked)}/>- {t("instance.sync-databases.sync-all")}+ {hasProjectContext+ ? t("instance.sync-databases.project-sync-all")+ : t("instance.sync-databases.sync-all")}</label>{!syncAll && (<div>@@ -530,6 +582,11 @@ function SyncDatabases({{visibleDatabases.map((db) => (<labelkey={db}+ ref={(element) => {+ if (db === pendingScrollDatabaseRef.current) {+ firstNewDatabaseRef.current = element;+ }+ }}className="flex items-center gap-x-2 cursor-pointer text-sm"><Checkbox@@ -542,11 +599,15 @@ function SyncDatabases({))}</div>{hasMore && (- <div className="text-xs text-control-light">- {t("common.n-more", {- n: filteredDatabases.length - MAX_VISIBLE_DATABASES,- })}- </div>+ <Button+ type="button"+ appearance="secondary"+ size="sm"+ className="self-start"+ onClick={loadMoreDatabases}+ >+ {t("common.load-more")}+ </Button>)}<Inputvalue={inputDatabase}@@ -611,6 +672,13 @@ export function InstanceFormBody({ onOpenInfoPanel }: InstanceFormBodyProps) {useState(false);const [isConnectionOptionsCollapsed, setIsConnectionOptionsCollapsed] =useState(true);+ const [testConnectionFailure, setTestConnectionFailure] = useState<+ | {+ message: string;+ failureCategory: ConnectionFailureCategory;+ }+ | undefined+ >();// Auto-expand connection options when configuredconst showConnectionOptionsCard =@@ -690,6 +758,25 @@ export function InstanceFormBody({ onOpenInfoPanel }: InstanceFormBodyProps) {return id;}, [basicInfo.name]);+ const routeProjectId = useMemo(() => {+ const projectId = router.currentRoute.value.query.project;+ return typeof projectId === "string" && projectId ? projectId : undefined;+ }, []);+ const routeProjectName = routeProjectId+ ? `${projectNamePrefix}${routeProjectId}`+ : "";++ useEffect(() => {+ if (!routeProjectName) return;+ useAppStore+ .getState()+ .fetchProject(routeProjectName, true)+ .catch(() => {+ // Ignore prefetch failure. The instance creation request still uses the+ // route project name directly.+ });+ }, [routeProjectName]);+const setResourceId = useCallback((id: string) => {setBasicInfo((prev) => ({ ...prev, name: `instances/${id}` }));@@ -983,8 +1070,16 @@ export function InstanceFormBody({ onOpenInfoPanel }: InstanceFormBodyProps) {const testConnectionForCurrentEditingDS = useCallback(async () => {const ds = editingDataSource;if (!ds) return;+ setTestConnectionFailure(undefined);const result = await testConnection(ds, false);- if (!result.success && hasConfiguredConnectionOptions) {+ if (result.success) {+ return;+ }+ setTestConnectionFailure({+ message: result.message,+ failureCategory: result.failureCategory,+ });+ if (hasConfiguredConnectionOptions) {emitShowConnectionOptions();}}, [@@ -1295,6 +1390,18 @@ export function InstanceFormBody({ onOpenInfoPanel }: InstanceFormBodyProps) {<h3 className="text-base font-medium text-main">{t("instance.section.connection")}</h3>+ {isSaaSMode && (+ <Alert variant="info" className="mt-2">+ <a+ href="https://docs.bytebase.com/get-started/cloud#prerequisites"+ target="_blank"+ rel="noopener noreferrer"+ className="normal-link"+ >+ {t("instance.sentence.firewall-info")}+ </a>+ </Alert>+ )}<div className="mt-3 grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-4">{/* Host input */}@@ -1577,18 +1684,18 @@ export function InstanceFormBody({ onOpenInfoPanel }: InstanceFormBodyProps) {onOpenInfoPanel={onOpenInfoPanel}/>- {isSaaSMode && (- <Alert variant="info" className="mt-4">- <a- href="https://docs.bytebase.com/get-started/cloud#prerequisites"- target="_blank"- rel="noopener noreferrer"- className="normal-link"- >- {t("instance.sentence.firewall-info")}- </a>- </Alert>- )}+ <div className="mt-6">+ <SyncDatabases+ isCreating={isCreating}+ showLabel+ allowEdit={+ isCreating ? allowEdit && !!allowCreate : allowEdit+ }+ projectName={routeProjectName}+ syncDatabases={basicInfo.syncDatabases}+ onSyncDatabasesChange={handleChangeSyncDatabases}+ />+ </div></>)}@@ -1651,7 +1758,7 @@ export function InstanceFormBody({ onOpenInfoPanel }: InstanceFormBodyProps) {{/* Test Connection button (create only) */}{isCreating && !!editingDataSource && (- <div className="flex justify-start">+ <div className="flex flex-col items-start gap-y-2"><Buttonappearance="outline"disabled={!allowTestConnection || state.isTestingConnection}@@ -1664,6 +1771,12 @@ export function InstanceFormBody({ onOpenInfoPanel }: InstanceFormBodyProps) {? `${t("instance.test-connection")}...`: t("instance.test-connection")}</Button>+ {testConnectionFailure && (+ <ConnectionRecovery+ category={testConnectionFailure.failureCategory}+ className="max-w-3xl"+ />+ )}</div>)}</div>diff --git a/frontend/src/react/components/instance/InstanceFormButtons.test.tsx b/frontend/src/react/components/instance/InstanceFormButtons.test.tsxnew file mode 100644index 0000000000..90c09eaf7f--- /dev/null+++ b/frontend/src/react/components/instance/InstanceFormButtons.test.tsx@@ -0,0 +1,348 @@+import { create } from "@bufbuild/protobuf";+import { act } from "react";+import { createRoot } from "react-dom/client";+import { beforeEach, describe, expect, test, vi } from "vitest";+import { Engine } from "@/types/proto-es/v1/common_pb";+import {+ DataSourceSchema,+ DataSourceType,+ InstanceSchema,+} from "@/types/proto-es/v1/instance_service_pb";+import { InstanceFormButtons } from "./InstanceFormButtons";++(+ globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }+).IS_REACT_ACT_ENVIRONMENT = true;++const mocks = vi.hoisted(() => ({+ routerCurrentQuery: {} as Record<string, unknown>,+ routerPush: vi.fn(),+ pushNotification: vi.fn(),+ createInstance: vi.fn(),+ fetchDatabases: vi.fn(),+ batchUpdateDatabases: vi.fn(),+ context: undefined as Record<string, unknown> | undefined,+}));++vi.mock("react-i18next", () => ({+ initReactI18next: { type: "3rdParty", init: () => {} },+ useTranslation: () => ({ t: (key: string) => key }),+}));++vi.mock("@/react/i18n", () => ({+ default: {+ t: (key: string) => key,+ },+}));++vi.mock("@/react/router", () => ({+ router: {+ push: mocks.routerPush,+ currentRoute: {+ get value() {+ return { query: mocks.routerCurrentQuery };+ },+ },+ },+}));++vi.mock("@/react/stores/app", () => {+ const appState = {+ hasFeature: () => true,+ createInstance: mocks.createInstance,+ fetchDatabases: mocks.fetchDatabases,+ batchUpdateDatabases: mocks.batchUpdateDatabases,+ };+ const useAppStore = Object.assign(+ (selector: (state: typeof appState) => unknown) => selector(appState),+ { getState: () => appState }+ );+ return { useAppStore };+});++vi.mock("@/store", () => ({+ pushNotification: mocks.pushNotification,+}));++vi.mock("@/utils", () => ({+ convertKVListToLabels: (list: { key: string; value: string }[]) =>+ Object.fromEntries(list.map(({ key, value }) => [key, value])),+ extractInstanceResourceName: (name: string) =>+ name.replace(/^instances\//, ""),+ isValidSpannerHost: (host: string) => host !== "",+}));++vi.mock("../ui/alert-dialog", () => ({+ AlertDialog: ({+ children,+ open,+ }: {+ children: React.ReactNode;+ open?: boolean;+ }) => (open ? <div>{children}</div> : null),+ AlertDialogContent: ({+ children,+ className,+ }: {+ children: React.ReactNode;+ className?: string;+ }) => (+ <div className={className} data-testid="alert-dialog-content">+ {children}+ </div>+ ),+ AlertDialogDescription: ({ children }: { children: React.ReactNode }) => (+ <div>{children}</div>+ ),+ AlertDialogFooter: ({ children }: { children: React.ReactNode }) => (+ <div>{children}</div>+ ),+ AlertDialogTitle: ({ children }: { children: React.ReactNode }) => (+ <div>{children}</div>+ ),+}));++vi.mock("../ui/button", () => ({+ Button: ({+ children,+ disabled,+ onClick,+ }: {+ children: React.ReactNode;+ disabled?: boolean;+ onClick?: () => void;+ }) => (+ <button disabled={disabled} type="button" onClick={onClick}>+ {children}+ </button>+ ),+}));++vi.mock("../ui/sticky-action-footer", () => ({+ StickyActionFooter: ({+ left,+ right,+ }: {+ left?: React.ReactNode;+ right?: React.ReactNode;+ }) => (+ <div>+ {left}+ {right}+ </div>+ ),+}));++vi.mock("./InstanceFormContext", () => ({+ useInstanceFormContext: () => mocks.context,+}));++const flushPromises = async () => {+ await Promise.resolve();+ await Promise.resolve();+};++beforeEach(() => {+ vi.clearAllMocks();+ mocks.routerCurrentQuery = {};++ const adminDataSource = {+ ...create(DataSourceSchema, {+ id: "admin",+ type: DataSourceType.ADMIN,+ host: "127.0.0.1",+ port: "5432",+ }),+ pendingCreate: true,+ updatedPassword: "",+ updatedMasterPassword: "",+ updatedToken: "",+ };++ mocks.context = {+ state: { isRequesting: false, isTestingConnection: false },+ setState: vi.fn((updater) => {+ if (!mocks.context) return;+ const nextState =+ typeof updater === "function" ? updater(mocks.context.state) : updater;+ mocks.context = { ...mocks.context, state: nextState };+ }),+ instance: undefined,+ isCreating: true,+ allowEdit: true,+ allowCreate: true,+ basicInfo: create(InstanceSchema, {+ title: "Production",+ engine: Engine.POSTGRES,+ environment: "environments/prod",+ syncDatabases: [],+ }),+ setBasicInfo: vi.fn(),+ labelKVList: [],+ adminDataSource,+ editingDataSource: adminDataSource,+ readonlyDataSourceList: [],+ setDataSourceEditState: vi.fn(),+ hasReadonlyReplicaFeature: true,+ setMissingFeature: vi.fn(),+ testConnection: vi.fn(async () => ({ success: true, message: "" })),+ checkDataSource: vi.fn(() => true),+ extractDataSourceFromEdit: vi.fn(() =>+ create(DataSourceSchema, {+ id: "admin",+ type: DataSourceType.ADMIN,+ host: "127.0.0.1",+ port: "5432",+ })+ ),+ valueChanged: true,+ onDismiss: vi.fn(),+ emitShowConnectionOptions: vi.fn(),+ };++ mocks.createInstance.mockResolvedValue(+ create(InstanceSchema, {+ name: "instances/prod",+ title: "Production",+ engine: Engine.POSTGRES,+ })+ );+ mocks.batchUpdateDatabases.mockResolvedValue([]);+});++describe("InstanceFormButtons", () => {+ test("uses project-aware create action text when creating from a project", async () => {+ mocks.routerCurrentQuery = { project: "demo" };+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<InstanceFormButtons />);+ });++ expect(container.textContent).toContain(+ "instance.connect-database-to-project"+ );+ expect(container.textContent).not.toContain("common.create");++ await act(async () => {+ root.unmount();+ });+ });++ test("passes project context to instance creation without client-side database transfer", async () => {+ mocks.routerCurrentQuery = { project: "demo" };+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<InstanceFormButtons />);+ });++ const createButton = Array.from(container.querySelectorAll("button")).find(+ (button) =>+ button.textContent?.includes("instance.connect-database-to-project")+ ) as HTMLButtonElement;+ await act(async () => {+ createButton.click();+ await flushPromises();+ });++ expect(mocks.createInstance).toHaveBeenCalledWith(+ expect.anything(),+ false,+ {+ project: "projects/demo",+ }+ );+ expect(mocks.fetchDatabases).not.toHaveBeenCalled();+ expect(mocks.batchUpdateDatabases).not.toHaveBeenCalled();+ expect(mocks.routerPush).toHaveBeenCalledWith({+ name: "workspace.project.database",+ params: { projectId: "demo" },+ query: {+ syncingInstance: "prod",+ intro: "connect-database",+ },+ });+ expect(mocks.context?.onDismiss).not.toHaveBeenCalled();++ await act(async () => {+ root.unmount();+ });+ });++ test("uses structured recovery category from connection test failures", async () => {+ const context = mocks.context as {+ emitShowConnectionOptions: ReturnType<typeof vi.fn>;+ testConnection: ReturnType<typeof vi.fn>;+ };+ context.testConnection.mockResolvedValue({+ success: false,+ message: "dial tcp 10.0.0.5:5432: i/o timeout",+ failureCategory: "ssl_tls_failed",+ });++ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<InstanceFormButtons />);+ });++ const createButton = Array.from(container.querySelectorAll("button")).find(+ (button) => button.textContent?.includes("common.create")+ ) as HTMLButtonElement;+ await act(async () => {+ createButton.click();+ await flushPromises();+ });++ expect(container.textContent).toContain(+ "instance.connection-recovery.tls.title"+ );+ expect(container.textContent).toContain(+ "instance.connection-recovery.tls.description"+ );+ expect(context.emitShowConnectionOptions).not.toHaveBeenCalled();+ expect(mocks.createInstance).not.toHaveBeenCalled();++ await act(async () => {+ root.unmount();+ });+ });++ test("renders a wider connection failure dialog", async () => {+ const context = mocks.context as {+ testConnection: ReturnType<typeof vi.fn>;+ };+ context.testConnection.mockResolvedValue({+ success: false,+ message: "permission denied",+ failureCategory: "permission_denied",+ });++ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<InstanceFormButtons />);+ });++ const createButton = Array.from(container.querySelectorAll("button")).find(+ (button) => button.textContent?.includes("common.create")+ ) as HTMLButtonElement;+ await act(async () => {+ createButton.click();+ await flushPromises();+ });++ expect(+ container.querySelector('[data-testid="alert-dialog-content"]')+ ).toHaveClass("max-w-2xl");++ await act(async () => {+ root.unmount();+ });+ });+});diff --git a/frontend/src/react/components/instance/InstanceFormButtons.tsx b/frontend/src/react/components/instance/InstanceFormButtons.tsxindex d6ba936705..a52ae08905 100644--- a/frontend/src/react/components/instance/InstanceFormButtons.tsx+++ b/frontend/src/react/components/instance/InstanceFormButtons.tsx@@ -2,10 +2,13 @@ import { create } from "@bufbuild/protobuf";import { cloneDeep, isEqual } from "lodash-es";import { useMemo, useState } from "react";import { useTranslation } from "react-i18next";+import { CONNECT_DATABASE_PRODUCT_INTRO } from "@/react/lib/productIntro";import { cn } from "@/react/lib/utils";import { router } from "@/react/router";+import { PROJECT_V1_ROUTE_DATABASES } from "@/react/router/handles";import { useAppStore } from "@/react/stores/app";import { pushNotification } from "@/store";+import { projectNamePrefix } from "@/store/modules/v1/common";import { Engine } from "@/types/proto-es/v1/common_pb";import type {DataSource,@@ -16,7 +19,11 @@ import {InstanceSchema,} from "@/types/proto-es/v1/instance_service_pb";import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";-import { convertKVListToLabels, isValidSpannerHost } from "@/utils";+import {+ convertKVListToLabels,+ extractInstanceResourceName,+ isValidSpannerHost,+} from "@/utils";import {AlertDialog,AlertDialogContent,@@ -26,6 +33,10 @@ import {} from "../ui/alert-dialog";import { Button } from "../ui/button";import { StickyActionFooter } from "../ui/sticky-action-footer";+import {+ type ConnectionFailureCategory,+ ConnectionRecovery,+} from "./ConnectionRecovery";import type { EditDataSource } from "./common";import {calcDataSourceUpdateMask,@@ -45,6 +56,7 @@ interface InstanceFormButtonsProps {type ConnectionFailureDialogState = {open: boolean;message: string;+ failureCategory: ConnectionFailureCategory;};export function InstanceFormButtons({@@ -87,6 +99,7 @@ export function InstanceFormButtons({useState<ConnectionFailureDialogState>({open: false,message: "",+ failureCategory: "unknown",});const [connectionFailureResolver, setConnectionFailureResolver] = useState<((confirmed: boolean) => void) | undefined@@ -165,18 +178,21 @@ export function InstanceFormButtons({setConnectionFailureDialogState({open: false,message: "",+ failureCategory: "unknown",});connectionFailureResolver?.(confirmed);setConnectionFailureResolver(undefined);};const confirmContinueWithConnectionFailure = async (- message: string+ message: string,+ failureCategory: ConnectionFailureCategory): Promise<boolean> => {return await new Promise<boolean>((resolve) => {setConnectionFailureDialogState({open: true,message,+ failureCategory,});setConnectionFailureResolver(() => resolve);});@@ -212,6 +228,19 @@ export function InstanceFormButtons({return inst;};+ const getRouteProjectContext = () => {+ const projectId = router.currentRoute.value.query.project;+ if (typeof projectId !== "string" || projectId.length === 0) {+ return;+ }+ return {+ id: projectId,+ name: `${projectNamePrefix}${projectId}`,+ };+ };++ const projectContext = getRouteProjectContext();+const doCreate = async () => {if (!isCreating) return;@@ -225,12 +254,22 @@ export function InstanceFormButtons({try {const createdInstance = await useAppStore.getState()- .createInstance(payload);+ .createInstance(payload, false, {+ project: projectContext?.name,+ });if (onCreated) {onCreated(createdInstance);+ } else if (projectContext) {+ router.push({+ name: PROJECT_V1_ROUTE_DATABASES,+ params: { projectId: projectContext.id },+ query: {+ syncingInstance: extractInstanceResourceName(createdInstance.name),+ intro: CONNECT_DATABASE_PRODUCT_INTRO,+ },+ });} else {router.push(`/${createdInstance.name}`);- onDismiss?.();}pushNotification({@@ -242,6 +281,11 @@ export function InstanceFormButtons({0: createdInstance.title,}),+ description: projectContext+ ? t("db.syncing-databases-for-instance", {+ 0: createdInstance.title,+ })+ : undefined,});} finally {setState((prev) => ({ ...prev, isRequesting: false }));@@ -256,7 +300,8 @@ export function InstanceFormButtons({} else {maybeOpenConnectionOptions(editingDS);const confirmed = await confirmContinueWithConnectionFailure(- testResult.message+ testResult.message,+ testResult.failureCategory);if (confirmed) {doCreate();@@ -361,7 +406,8 @@ export function InstanceFormButtons({if (!testResult.success) {maybeOpenConnectionOptions(editState);const continueAnyway = await confirmContinueWithConnectionFailure(- testResult.message+ testResult.message,+ testResult.failureCategory);if (!continueAnyway) return true;}@@ -401,7 +447,8 @@ export function InstanceFormButtons({if (!testResult.success) {maybeOpenConnectionOptions(editingDS);const continueAnyway = await confirmContinueWithConnectionFailure(- testResult.message+ testResult.message,+ testResult.failureCategory);if (!continueAnyway) return true;}@@ -479,8 +526,12 @@ export function InstanceFormButtons({}}}>- <AlertDialogContent>+ <AlertDialogContent className="max-w-2xl"><AlertDialogTitle>{t("common.warning")}</AlertDialogTitle>+ <ConnectionRecovery+ category={connectionFailureDialogState.failureCategory}+ className="my-2"+ /><AlertDialogDescription className="whitespace-pre-wrap break-all">{t("instance.unable-to-connect", {0: connectionFailureDialogState.message,@@ -525,7 +576,13 @@ export function InstanceFormButtons({}onClick={tryCreate}>- {state.isRequesting ? t("common.creating") : t("common.create")}+ {state.isRequesting+ ? projectContext+ ? t("instance.connecting-database-to-project")+ : t("common.creating")+ : projectContext+ ? t("instance.connect-database-to-project")+ : t("common.create")}</Button>}/>diff --git a/frontend/src/react/components/instance/InstanceFormContext.test.tsx b/frontend/src/react/components/instance/InstanceFormContext.test.tsxindex 429ae2f21d..65f1561fa4 100644--- a/frontend/src/react/components/instance/InstanceFormContext.test.tsx+++ b/frontend/src/react/components/instance/InstanceFormContext.test.tsx@@ -2,7 +2,7 @@ import { create } from "@bufbuild/protobuf";import type { ReactElement } from "react";import { act } from "react";import { createRoot } from "react-dom/client";-import { describe, expect, test, vi } from "vitest";+import { beforeEach, describe, expect, test, vi } from "vitest";import { Engine } from "@/types/proto-es/v1/common_pb";import {DataSourceSchema,@@ -54,6 +54,8 @@ vi.mock("@/store", () => ({pushNotification: vi.fn(),}));+let mockEnvironmentList: { id: string; name: string }[] = [];+vi.mock("@/react/stores/app", () => {const appState = () => ({createDataSource: vi.fn(),@@ -64,7 +66,7 @@ vi.mock("@/react/stores/app", () => {instanceLicenseCount: () => 1,activatedInstanceCount: () => 0,currentPlan: () => 1,- environmentList: [],+ environmentList: mockEnvironmentList,});return {useAppStore: Object.assign(@@ -129,6 +131,7 @@ const Probe = () => {<divdata-title={ctx.basicInfo.title}data-host={ctx.adminDataSource.host}+ data-environment={ctx.basicInfo.environment}/>);};@@ -153,6 +156,26 @@ const renderIntoContainer = () => {};describe("InstanceFormProvider", () => {+ beforeEach(() => {+ mockEnvironmentList = [];+ });++ test("selects the first environment by default when creating an instance", async () => {+ mockEnvironmentList = [{ id: "dev", name: "environments/dev" }];+ const harness = renderIntoContainer();++ await harness.render(+ <InstanceFormProvider>+ <Probe />+ </InstanceFormProvider>+ );++ const probe = harness.container.firstElementChild as HTMLElement;+ expect(probe.dataset.environment).toBe("environments/dev");++ harness.unmount();+ });+test("refreshes form state when an unknown instance is replaced by the fetched instance", async () => {const fetchedInstance = create(InstanceSchema, {name: "instances/prod",diff --git a/frontend/src/react/components/instance/InstanceFormContext.tsx b/frontend/src/react/components/instance/InstanceFormContext.tsxindex 7a68525fb6..189a6c5c48 100644--- a/frontend/src/react/components/instance/InstanceFormContext.tsx+++ b/frontend/src/react/components/instance/InstanceFormContext.tsx@@ -1,4 +1,5 @@import { create } from "@bufbuild/protobuf";+import { ConnectError } from "@connectrpc/connect";import { cloneDeep, isEqual, omit } from "lodash-es";import {createContext,@@ -35,6 +36,11 @@ import {} from "@/utils";import { extractGrpcErrorMessage } from "@/utils/connect";import { FeatureModal } from "../ui/feature-modal";+import {+ type ConnectionFailureCategory,+ connectionFailureCategoryHeader,+ normalizeConnectionFailureCategory,+} from "./ConnectionRecovery";import type { BasicInfo, DataSourceEditState, EditDataSource } from "./common";import {calcDataSourceUpdateMask,@@ -50,6 +56,12 @@ export type LocalState = {isRequesting: boolean;};+type TestConnectionResult = {+ success: boolean;+ message: string;+ failureCategory: ConnectionFailureCategory;+};+export interface InstanceFormContextValue {instance: Instance | undefined;hideAdvancedFeatures: boolean;@@ -94,7 +106,7 @@ export interface InstanceFormContextValue {testConnection: (editingDS: EditDataSource,silent?: boolean- ) => Promise<{ success: boolean; message: string }>;+ ) => Promise<TestConnectionResult>;pendingCreateInstance: Instance;valueChanged: boolean;isEditing: boolean;@@ -153,6 +165,7 @@ export function InstanceFormProvider({const [showConnectionOptionsEvent, setShowConnectionOptionsEvent] =useState(0);const syncedInstanceNameRef = useRef(instance?.name);+ const isCreating = instance === undefined;useEffect(() => {if (syncedInstanceNameRef.current === instance?.name) {@@ -173,11 +186,25 @@ export function InstanceFormProvider({setMissingFeature(undefined);}, [instance]);+ useEffect(() => {+ if (!isCreating || basicInfo.environment) {+ return;+ }++ const firstEnvironment = environmentList[0];+ if (!firstEnvironment) {+ return;+ }++ setBasicInfo((prev) =>+ prev.environment ? prev : { ...prev, environment: firstEnvironment.name }+ );+ }, [basicInfo.environment, environmentList, isCreating]);+const emitShowConnectionOptions = useCallback(() => {setShowConnectionOptionsEvent((prev) => prev + 1);}, []);- const isCreating = instance === undefined;const allowEdit = isCreating? true: (instance?.state || State.STATE_UNSPECIFIED) === State.ACTIVE &&@@ -424,8 +451,8 @@ export function InstanceFormProvider({async (editingDS: EditDataSource,silent = false- ): Promise<{ success: boolean; message: string }> => {- const ok = () => {+ ): Promise<TestConnectionResult> => {+ const ok = (): TestConnectionResult => {if (!silent) {pushNotification({module: "bytebase",@@ -434,9 +461,14 @@ export function InstanceFormProvider({});}setState((prev) => ({ ...prev, isTestingConnection: false }));- return { success: true, message: "" };+ return { success: true, message: "", failureCategory: "unknown" };};- const fail = (host: string, err: unknown) => {+ const fail = (host: string, err: unknown): TestConnectionResult => {+ const failureCategory = normalizeConnectionFailureCategory(+ err instanceof ConnectError+ ? err.metadata.get(connectionFailureCategoryHeader)+ : undefined+ );let error = extractGrpcErrorMessage(err);if (!silent) {if (host === "localhost" || host === "127.0.0.1") {@@ -451,7 +483,7 @@ export function InstanceFormProvider({});}setState((prev) => ({ ...prev, isTestingConnection: false }));- return { success: false, message: error };+ return { success: false, message: error, failureCategory };};setState((prev) => ({ ...prev, isTestingConnection: true }));diff --git a/frontend/src/react/components/sql-review/ResourceLink.test.tsx b/frontend/src/react/components/sql-review/ResourceLink.test.tsxindex 2e15a0385b..c35e0be751 100644--- a/frontend/src/react/components/sql-review/ResourceLink.test.tsx+++ b/frontend/src/react/components/sql-review/ResourceLink.test.tsx@@ -23,10 +23,18 @@ vi.mock("@/react/components/RouterLink", () => ({RouterLink: ({children,className,+ rel,+ target,}: {children: React.ReactNode;className?: string;- }) => <a className={className}>{children}</a>,+ rel?: string;+ target?: string;+ }) => (+ <a className={className} target={target} rel={rel}>+ {children}+ </a>+ ),}));vi.mock("@/react/hooks/useAppState", () => ({@@ -108,4 +116,40 @@ describe("ResourceLink", () => {unmount();});++ test("can hide the resource type label for inline project links", () => {+ const { container, render, unmount } = renderIntoContainer(+ <ResourceLink resource="projects/sample" showResourceType={false} />+ );++ render();++ const link = container.querySelector("a");+ expect(link?.textContent).toBe("Sample project");+ expect(link?.textContent).not.toContain("common.project");++ unmount();+ });++ test("passes through link attributes for inline project links", () => {+ const { container, render, unmount } = renderIntoContainer(+ <ResourceLink+ resource="projects/sample"+ showResourceType={false}+ className="underline underline-offset-2"+ target="_blank"+ rel="noopener noreferrer"+ />+ );++ render();++ const link = container.querySelector("a");+ expect(link?.className).toContain("normal-link");+ expect(link?.className).toContain("underline underline-offset-2");+ expect(link?.getAttribute("target")).toBe("_blank");+ expect(link?.getAttribute("rel")).toBe("noopener noreferrer");++ unmount();+ });});diff --git a/frontend/src/react/components/sql-review/ResourceLink.tsx b/frontend/src/react/components/sql-review/ResourceLink.tsxindex d2958ed20b..071ae0e627 100644--- a/frontend/src/react/components/sql-review/ResourceLink.tsx+++ b/frontend/src/react/components/sql-review/ResourceLink.tsx@@ -1,28 +1,64 @@import { ShieldAlert } from "lucide-react";import { useEffect } from "react";import { useTranslation } from "react-i18next";-import { RouterLink } from "@/react/components/RouterLink";+import {+ RouterLink,+ type RouterLinkProps,+} from "@/react/components/RouterLink";import { useEnvironment, usePlanFeature } from "@/react/hooks/useAppState";import { useProjectByName } from "@/react/hooks/useProjectByName";+import { cn } from "@/react/lib/utils";import { useAppStore } from "@/react/stores/app";import {environmentNamePrefix,projectNamePrefix,} from "@/store/modules/v1/common";import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";-import { hasWorkspacePermissionV2 } from "@/utils";+import { extractProjectResourceName, hasWorkspacePermissionV2 } from "@/utils";++type ResourceLinkAnchorProps = Pick<+ RouterLinkProps,+ "className" | "rel" | "target"+>;-export function ResourceLink({ resource }: { resource: string }) {+export function ResourceLink({+ resource,+ showResourceType = true,+ ...linkProps+}: {+ resource: string;+ showResourceType?: boolean;+} & ResourceLinkAnchorProps) {if (resource.startsWith(environmentNamePrefix)) {- return <EnvironmentResourceLink resource={resource} />;+ return (+ <EnvironmentResourceLink+ resource={resource}+ showResourceType={showResourceType}+ {...linkProps}+ />+ );}if (resource.startsWith(projectNamePrefix)) {- return <ProjectResourceLink resource={resource} />;+ return (+ <ProjectResourceLink+ resource={resource}+ showResourceType={showResourceType}+ {...linkProps}+ />+ );}- return <span>{resource}</span>;+ return <span className={linkProps.className}>{resource}</span>;}-function EnvironmentResourceLink({ resource }: { resource: string }) {+function EnvironmentResourceLink({+ resource,+ showResourceType,+ className,+ ...linkProps+}: {+ resource: string;+ showResourceType: boolean;+} & ResourceLinkAnchorProps) {const { t } = useTranslation();const environment = useEnvironment(resource);const hasEnvTierFeature = usePlanFeature(@@ -33,19 +69,30 @@ function EnvironmentResourceLink({ resource }: { resource: string }) {return (<RouterLink+ {...linkProps}to={{ path: `/${resource}` }}- className="inline-flex items-center gap-x-1 normal-link"+ className={cn("inline-flex items-center gap-x-1 normal-link", className)}>- <span className="text-control-light text-xs mr-0.5">- {t("common.environment")}:- </span>+ {showResourceType && (+ <span className="text-control-light text-xs mr-0.5">+ {t("common.environment")}:+ </span>+ )}<span>{environment.title || resource}</span>{isProtected && <ShieldAlert className="w-3.5 h-3.5 shrink-0" />}</RouterLink>);}-function ProjectResourceLink({ resource }: { resource: string }) {+function ProjectResourceLink({+ resource,+ showResourceType,+ className,+ ...linkProps+}: {+ resource: string;+ showResourceType: boolean;+} & ResourceLinkAnchorProps) {const { t } = useTranslation();// subscribe to re-render on project cache changeconst projectsByName = useAppStore((s) => s.projectsByName);@@ -61,13 +108,16 @@ function ProjectResourceLink({ resource }: { resource: string }) {return (<RouterLink+ {...linkProps}to={{ path: `/${resource}` }}- className="inline-flex items-center gap-x-1 normal-link"+ className={cn("inline-flex items-center gap-x-1 normal-link", className)}>- <span className="text-control-light text-xs mr-0.5">- {t("common.project")}:- </span>- <span>{project?.title || resource}</span>+ {showResourceType && (+ <span className="text-control-light text-xs mr-0.5">+ {t("common.project")}:+ </span>+ )}+ <span>{project?.title || extractProjectResourceName(resource)}</span></RouterLink>);}diff --git a/frontend/src/react/components/ui/table.test.tsx b/frontend/src/react/components/ui/table.test.tsxindex 01f41bdd03..d1d7581984 100644--- a/frontend/src/react/components/ui/table.test.tsx+++ b/frontend/src/react/components/ui/table.test.tsx@@ -1,6 +1,6 @@import { describe, expect, test } from "vitest";import { ColumnResizeHandle } from "./column-resize-handle";-import { TableBody, TableRow } from "./table";+import { TableBody, TableEmptyView, TableRow } from "./table";describe("table primitives", () => {test("TableBody stripes rows by default", () => {@@ -26,6 +26,31 @@ describe("table primitives", () => {expect(element.props.className).toContain("!bg-transparent");});+ test("TableEmptyView renders a full-span centered placeholder", () => {+ const element = TableEmptyView({+ colSpan: 4,+ children: "No data",+ contentClassName: "sticky left-0",+ contentStyle: { width: 640 },+ contentTestId: "table-empty",+ });++ expect(element.type).toBe(TableRow);+ const cell = element.props.children;+ expect(cell.props.colSpan).toBe(4);+ expect(cell.props.className).toContain("text-center");+ expect(cell.props.className).toContain("text-control-placeholder");++ const content = cell.props.children;+ expect(content.props["data-testid"]).toBe("table-empty");+ expect(content.props.className).toContain("flex");+ expect(content.props.className).toContain("items-center");+ expect(content.props.className).toContain("justify-center");+ expect(content.props.className).toContain("sticky left-0");+ expect(content.props.style).toEqual({ width: 640 });+ expect(content.props.children).toBe("No data");+ });+test("ColumnResizeHandle uses a raised 12px hitbox around a 2px visual bar", () => {const element = ColumnResizeHandle({ onMouseDown: () => {} });diff --git a/frontend/src/react/components/ui/table.tsx b/frontend/src/react/components/ui/table.tsxindex bf8a3a5f9a..e55cd08328 100644--- a/frontend/src/react/components/ui/table.tsx+++ b/frontend/src/react/components/ui/table.tsx@@ -1,5 +1,5 @@import { ArrowDown, ArrowUp, ArrowUpDown } from "lucide-react";-import type { ComponentPropsWithoutRef } from "react";+import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from "react";import { ColumnResizeHandle } from "@/react/components/ui/column-resize-handle";import { cn } from "@/react/lib/utils";@@ -139,4 +139,49 @@ function TableCell({ className, ...props }: ComponentPropsWithoutRef<"td">) {);}-export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow };+interface TableEmptyViewProps+ extends Omit<ComponentPropsWithoutRef<"td">, "children"> {+ children?: ReactNode;+ contentClassName?: string;+ contentStyle?: CSSProperties;+ contentTestId?: string;+}++function TableEmptyView({+ className,+ children,+ contentClassName,+ contentStyle,+ contentTestId,+ ...props+}: Readonly<TableEmptyViewProps>) {+ return (+ <TableRow>+ <TableCell+ className={cn("text-center text-control-placeholder", className)}+ {...props}+ >+ <div+ data-testid={contentTestId}+ className={cn(+ "flex min-h-40 items-center justify-center",+ contentClassName+ )}+ style={contentStyle}+ >+ {children}+ </div>+ </TableCell>+ </TableRow>+ );+}++export {+ Table,+ TableBody,+ TableCell,+ TableEmptyView,+ TableHead,+ TableHeader,+ TableRow,+};diff --git a/frontend/src/react/lib/productIntro.css b/frontend/src/react/lib/productIntro.cssnew file mode 100644index 0000000000..7e55304fa4--- /dev/null+++ b/frontend/src/react/lib/productIntro.css@@ -0,0 +1,98 @@+.bb-product-intro {+ position: fixed;+ inset: 0;+ z-index: 1000000000;+ pointer-events: none;+}++.bb-product-intro-stage {+ position: fixed;+ border-radius: 8px;+ box-shadow:+ 0 0 0 4px rgb(var(--color-background)),+ 0 0 0 7px rgb(var(--color-accent) / 72%),+ 0 0 0 9999px rgb(var(--color-overlay) / 38%),+ 0 12px 28px rgb(var(--color-overlay) / 20%);+ pointer-events: none;+}++.bb-product-intro-popover {+ position: fixed;+ box-sizing: border-box;+ width: min(320px, calc(100vw - 32px));+ padding: 18px 20px 18px;+ color: rgb(var(--color-main));+ background: rgb(var(--color-background));+ border: 1px solid rgb(var(--color-block-border));+ border-radius: 8px;+ box-shadow:+ 0 12px 28px rgb(var(--color-overlay) / 18%),+ 0 2px 8px rgb(var(--color-overlay) / 10%);+ pointer-events: auto;+}++.bb-product-intro-title {+ padding-right: 24px;+ color: rgb(var(--color-main));+ font-size: 16px;+ font-weight: 600;+ line-height: 24px;+}++.bb-product-intro-description {+ margin-top: 8px;+ color: rgb(var(--color-control));+ font-size: 14px;+ line-height: 20px;+}++.bb-product-intro-close {+ position: absolute;+ top: 10px;+ right: 10px;+ display: flex;+ align-items: center;+ justify-content: center;+ width: 28px;+ height: 28px;+ padding: 0;+ color: rgb(var(--color-control-light));+ font-size: 24px;+ line-height: 1;+ background: transparent;+ border: 0;+ border-radius: 4px;+ cursor: pointer;+}++.bb-product-intro-close:hover,+.bb-product-intro-close:focus {+ color: rgb(var(--color-main));+ background: rgb(var(--color-control-bg));+}++.bb-product-intro-arrow {+ position: absolute;+ width: 12px;+ height: 12px;+ background: rgb(var(--color-background));+ border: 1px solid rgb(var(--color-block-border));+ transform: rotate(45deg);+}++.bb-product-intro-arrow-top {+ top: -6px;+ border-right: 0;+ border-bottom: 0;+}++.bb-product-intro-arrow-bottom {+ bottom: -6px;+ border-top: 0;+ border-left: 0;+}++.bb-product-intro-active {+ position: relative;+ z-index: 1000000001;+}diff --git a/frontend/src/react/lib/productIntro.test.ts b/frontend/src/react/lib/productIntro.test.tsnew file mode 100644index 0000000000..1905f5bf36--- /dev/null+++ b/frontend/src/react/lib/productIntro.test.ts@@ -0,0 +1,258 @@+import { readFileSync } from "node:fs";+import { dirname, join } from "node:path";+import { fileURLToPath } from "node:url";++import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";++const appStoreMocks = vi.hoisted(() => {+ const introState = new Map<string, boolean>();+ return {+ introState,+ getIntroStateByKey: vi.fn((key: string) => introState.get(key) ?? false),+ saveIntroStateByKey: vi.fn(+ ({ key, newState }: { key: string; newState: boolean }) => {+ introState.set(key, newState);+ }+ ),+ };+});++vi.mock("@/react/stores/app", () => ({+ useAppStore: {+ getState: () => ({+ getIntroStateByKey: appStoreMocks.getIntroStateByKey,+ saveIntroStateByKey: appStoreMocks.saveIntroStateByKey,+ }),+ },+}));++import { showProductIntroOnce } from "./productIntro";++const setRect = (element: HTMLElement, rect: Partial<DOMRect>) => {+ element.getBoundingClientRect = vi.fn(+ () =>+ ({+ x: rect.left ?? 0,+ y: rect.top ?? 0,+ top: rect.top ?? 0,+ left: rect.left ?? 0,+ right: rect.right ?? 0,+ bottom: rect.bottom ?? 0,+ width: rect.width ?? 0,+ height: rect.height ?? 0,+ }) as DOMRect+ );+};++const createButton = (rect: Partial<DOMRect>) => {+ const button = document.createElement("button");+ button.setAttribute("data-product-intro-target", "connect-database");+ setRect(button, rect);+ document.body.appendChild(button);+ return button;+};++const introOptions = {+ id: "connect-database",+ title: "Connect your first database",+ description: "Connect a database.",+ closeLabel: "Close",+};++const libDir = dirname(fileURLToPath(import.meta.url));++describe("showProductIntroOnce", () => {+ beforeEach(() => {+ vi.useFakeTimers();+ appStoreMocks.introState.clear();+ appStoreMocks.getIntroStateByKey.mockClear();+ appStoreMocks.saveIntroStateByKey.mockClear();+ window.localStorage.clear();+ document.body.innerHTML = "";+ });++ afterEach(() => {+ document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape" }));+ window.localStorage.clear();+ document.body.innerHTML = "";+ vi.useRealTimers();+ });++ test("renders a custom intro around the visible target", async () => {+ const button = createButton({+ top: 240,+ left: 400,+ right: 560,+ bottom: 280,+ width: 160,+ height: 40,+ });++ await expect(showProductIntroOnce(introOptions)).resolves.toBe(true);++ expect(document.querySelectorAll(".bb-product-intro")).toHaveLength(1);+ expect(button.classList.contains("bb-product-intro-active")).toBe(true);+ expect(document.querySelector(".bb-product-intro-title")?.textContent).toBe(+ "Connect your first database"+ );+ expect(+ document.querySelector(".bb-product-intro-description")?.textContent+ ).toBe("Connect a database.");+ expect(document.querySelector(".bb-product-intro-stage")).toHaveProperty(+ "style.top",+ "234px"+ );+ expect(document.querySelector(".bb-product-intro-popover")).toHaveProperty(+ "style.top",+ "294px"+ );+ });++ test("uses the visible target when responsive layouts render multiple matches", async () => {+ const hiddenButton = createButton({+ top: 0,+ left: 0,+ right: 0,+ bottom: 0,+ width: 0,+ height: 0,+ });+ const visibleButton = createButton({+ top: 300,+ left: 600,+ right: 760,+ bottom: 340,+ width: 160,+ height: 40,+ });++ await showProductIntroOnce(introOptions);++ expect(hiddenButton.classList.contains("bb-product-intro-active")).toBe(+ false+ );+ expect(visibleButton.classList.contains("bb-product-intro-active")).toBe(+ true+ );+ });++ test("re-resolves and repositions the target after responsive replacement", async () => {+ const oldButton = createButton({+ top: 240,+ left: 400,+ right: 560,+ bottom: 280,+ width: 160,+ height: 40,+ });++ await showProductIntroOnce(introOptions);++ setRect(oldButton, {+ top: 0,+ left: 0,+ right: 0,+ bottom: 0,+ width: 0,+ height: 0,+ });+ oldButton.remove();+ const newButton = createButton({+ top: 300,+ left: 600,+ right: 760,+ bottom: 340,+ width: 160,+ height: 40,+ });++ window.dispatchEvent(new Event("resize"));+ vi.advanceTimersByTime(100);++ expect(document.querySelectorAll(".bb-product-intro")).toHaveLength(1);+ expect(oldButton.classList.contains("bb-product-intro-active")).toBe(false);+ expect(newButton.classList.contains("bb-product-intro-active")).toBe(true);+ expect(document.querySelector(".bb-product-intro-stage")).toHaveProperty(+ "style.top",+ "294px"+ );+ expect(document.querySelector(".bb-product-intro-popover")).toHaveProperty(+ "style.top",+ "354px"+ );+ });++ test("does not show an already dismissed intro", async () => {+ appStoreMocks.introState.set("connect-database", true);+ createButton({+ top: 240,+ left: 400,+ right: 560,+ bottom: 280,+ width: 160,+ height: 40,+ });++ await expect(showProductIntroOnce(introOptions)).resolves.toBe(false);++ expect(appStoreMocks.getIntroStateByKey).toHaveBeenCalledWith(+ "connect-database"+ );+ expect(document.querySelector(".bb-product-intro")).toBeNull();+ });++ test("marks the intro dismissed when the close button is clicked", async () => {+ createButton({+ top: 240,+ left: 400,+ right: 560,+ bottom: 280,+ width: 160,+ height: 40,+ });++ await showProductIntroOnce(introOptions);++ expect(appStoreMocks.saveIntroStateByKey).not.toHaveBeenCalled();+ (+ document.querySelector(".bb-product-intro-close") as HTMLButtonElement+ ).click();++ expect(appStoreMocks.saveIntroStateByKey).toHaveBeenCalledWith({+ key: "connect-database",+ newState: true,+ });+ expect(document.querySelector(".bb-product-intro")).toBeNull();+ });++ test("destroys the intro when the highlighted target is clicked", async () => {+ const onClick = vi.fn();+ const button = createButton({+ top: 240,+ left: 400,+ right: 560,+ bottom: 280,+ width: 160,+ height: 40,+ });+ button.addEventListener("click", onClick);++ await showProductIntroOnce(introOptions);++ button.click();++ expect(onClick).toHaveBeenCalledTimes(1);+ expect(appStoreMocks.saveIntroStateByKey).toHaveBeenCalledWith({+ key: "connect-database",+ newState: true,+ });+ expect(document.querySelector(".bb-product-intro")).toBeNull();+ });++ test("keeps the page cover light enough to preserve context", () => {+ const css = readFileSync(join(libDir, "productIntro.css"), "utf8");++ expect(css).toContain("0 0 0 9999px rgb(var(--color-overlay) / 38%)");+ expect(css).not.toContain("0 0 0 9999px rgb(var(--color-overlay) / 62%)");+ });+});diff --git a/frontend/src/react/lib/productIntro.ts b/frontend/src/react/lib/productIntro.tsnew file mode 100644index 0000000000..f40a6c2dd1--- /dev/null+++ b/frontend/src/react/lib/productIntro.ts@@ -0,0 +1,242 @@+import "./productIntro.css";++import { useAppStore } from "@/react/stores/app";++export const PRODUCT_INTRO_QUERY_KEY = "intro";+export const CONNECT_DATABASE_PRODUCT_INTRO = "connect-database";++export type ProductIntroOptions = {+ id: string;+ title: string;+ description: string;+ closeLabel: string;+};++const ACTIVE_TARGET_CLASS = "bb-product-intro-active";+const ROOT_CLASS = "bb-product-intro";+const STAGE_CLASS = "bb-product-intro-stage";+const POPOVER_CLASS = "bb-product-intro-popover";+const ARROW_CLASS = "bb-product-intro-arrow";+const REFRESH_DELAY_MS = 100;+const STAGE_PADDING = 6;+const POPOVER_GAP = 14;+const POPOVER_WIDTH = 320;+const POPOVER_HEIGHT = 128;+const VIEWPORT_PADDING = 16;++const getTargetSelector = (id: string) => `[data-product-intro-target="${id}"]`;++const isVisibleRect = (rect: DOMRect) => rect.width > 0 && rect.height > 0;++const resolveTargetElement = (selector: string): HTMLElement | undefined => {+ for (const element of document.querySelectorAll(selector)) {+ if (!(element instanceof HTMLElement)) {+ continue;+ }+ if (!element.isConnected) {+ continue;+ }+ if (isVisibleRect(element.getBoundingClientRect())) {+ return element;+ }+ }+ return undefined;+};++const findElement = async (+ selector: string+): Promise<HTMLElement | undefined> => {+ for (let i = 0; i < 10; i++) {+ const element = resolveTargetElement(selector);+ if (element) {+ return element;+ }+ await new Promise<void>((resolve) => window.setTimeout(resolve, 100));+ }+ return undefined;+};++const clamp = (value: number, min: number, max: number) =>+ Math.min(Math.max(value, min), max);++const removeActiveTargetClass = () => {+ for (const element of document.querySelectorAll(`.${ACTIVE_TARGET_CLASS}`)) {+ element.classList.remove(ACTIVE_TARGET_CLASS);+ }+};++const markActiveTarget = (element: HTMLElement) => {+ removeActiveTargetClass();+ element.classList.add(ACTIVE_TARGET_CLASS);+};++const createIntroElements = ({+ title,+ description,+ closeLabel,+}: Pick<ProductIntroOptions, "title" | "description" | "closeLabel">) => {+ const root = document.createElement("div");+ root.className = ROOT_CLASS;++ const stage = document.createElement("div");+ stage.className = STAGE_CLASS;++ const popover = document.createElement("div");+ popover.className = POPOVER_CLASS;+ popover.setAttribute("role", "dialog");+ popover.setAttribute("aria-modal", "false");++ const arrow = document.createElement("div");+ arrow.className = ARROW_CLASS;++ const titleElement = document.createElement("div");+ titleElement.className = "bb-product-intro-title";+ titleElement.textContent = title;++ const descriptionElement = document.createElement("div");+ descriptionElement.className = "bb-product-intro-description";+ descriptionElement.textContent = description;++ const closeButton = document.createElement("button");+ closeButton.className = "bb-product-intro-close";+ closeButton.type = "button";+ closeButton.setAttribute("aria-label", closeLabel);+ closeButton.textContent = "×";++ popover.append(arrow, closeButton, titleElement, descriptionElement);+ root.append(stage, popover);++ return { root, stage, popover, arrow, closeButton };+};++export const showProductIntroOnce = async ({+ id,+ title,+ description,+ closeLabel,+}: ProductIntroOptions): Promise<boolean> => {+ const target = getTargetSelector(id);+ const store = useAppStore.getState();++ if (store.getIntroStateByKey(id)) {+ return false;+ }++ const element = await findElement(target);+ if (!element) {+ return false;+ }++ let activeElement = element;+ let destroyed = false;+ let refreshTimer: number | undefined;+ const { root, stage, popover, arrow, closeButton } = createIntroElements({+ title,+ description,+ closeLabel,+ });++ const render = () => {+ const rect = activeElement.getBoundingClientRect();+ stage.style.top = `${rect.top - STAGE_PADDING}px`;+ stage.style.left = `${rect.left - STAGE_PADDING}px`;+ stage.style.width = `${rect.width + STAGE_PADDING * 2}px`;+ stage.style.height = `${rect.height + STAGE_PADDING * 2}px`;++ const maxLeft = window.innerWidth - POPOVER_WIDTH - VIEWPORT_PADDING;+ const left = clamp(+ rect.left + rect.width / 2 - POPOVER_WIDTH / 2,+ VIEWPORT_PADDING,+ Math.max(VIEWPORT_PADDING, maxLeft)+ );+ const canShowBelow =+ rect.bottom + POPOVER_GAP + POPOVER_HEIGHT <= window.innerHeight;+ const top = canShowBelow+ ? rect.bottom + POPOVER_GAP+ : Math.max(VIEWPORT_PADDING, rect.top - POPOVER_GAP - POPOVER_HEIGHT);++ popover.style.left = `${left}px`;+ popover.style.top = `${top}px`;+ arrow.classList.toggle("bb-product-intro-arrow-top", canShowBelow);+ arrow.classList.toggle("bb-product-intro-arrow-bottom", !canShowBelow);+ arrow.style.left = `${clamp(+ rect.left + rect.width / 2 - left - 6,+ 12,+ POPOVER_WIDTH - 24+ )}px`;+ };++ const cleanup = () => {+ if (destroyed) {+ return;+ }+ destroyed = true;+ if (refreshTimer !== undefined) {+ window.clearTimeout(refreshTimer);+ refreshTimer = undefined;+ }+ closeButton.removeEventListener("click", handleCloseClick);+ document.removeEventListener("click", handleDocumentClick, true);+ document.removeEventListener("keydown", handleDocumentKeydown, true);+ window.removeEventListener("resize", scheduleRefreshTarget);+ window.removeEventListener("scroll", scheduleRefreshTarget, true);+ root.remove();+ removeActiveTargetClass();+ store.saveIntroStateByKey({ key: id, newState: true });+ };++ const refreshTarget = () => {+ refreshTimer = undefined;+ const currentElement = resolveTargetElement(target);+ if (!currentElement) {+ cleanup();+ return;+ }+ if (currentElement !== activeElement) {+ activeElement.classList.remove(ACTIVE_TARGET_CLASS);+ activeElement = currentElement;+ markActiveTarget(activeElement);+ }+ render();+ };++ const scheduleRefreshTarget = () => {+ if (refreshTimer !== undefined) {+ window.clearTimeout(refreshTimer);+ }+ refreshTimer = window.setTimeout(refreshTarget, REFRESH_DELAY_MS);+ };++ function handleCloseClick(event: MouseEvent) {+ event.preventDefault();+ event.stopPropagation();+ cleanup();+ }++ function handleDocumentClick(event: MouseEvent) {+ const currentElement = resolveTargetElement(target);+ if (!currentElement) {+ cleanup();+ return;+ }+ if (event.target instanceof Node && currentElement.contains(event.target)) {+ cleanup();+ }+ }++ function handleDocumentKeydown(event: KeyboardEvent) {+ if (event.key === "Escape") {+ cleanup();+ }+ }++ markActiveTarget(activeElement);+ document.body.appendChild(root);+ render();+ closeButton.addEventListener("click", handleCloseClick);+ document.addEventListener("click", handleDocumentClick, true);+ document.addEventListener("keydown", handleDocumentKeydown, true);+ window.addEventListener("resize", scheduleRefreshTarget);+ window.addEventListener("scroll", scheduleRefreshTarget, true);+ return true;+};diff --git a/frontend/src/react/pages/auth/ProfileSetupPage.test.tsx b/frontend/src/react/pages/auth/ProfileSetupPage.test.tsxindex 460e05b423..c9ff698bb1 100644--- a/frontend/src/react/pages/auth/ProfileSetupPage.test.tsx+++ b/frontend/src/react/pages/auth/ProfileSetupPage.test.tsx@@ -1,3 +1,4 @@+import { fireEvent } from "@testing-library/react";import type { ReactElement } from "react";import { act } from "react";import { createRoot } from "react-dom/client";@@ -31,15 +32,25 @@ const mocks = vi.hoisted(() => ({} as IamPolicy,updateUser: vi.fn(),updateWorkspace: vi.fn(),+ createProject: vi.fn(),+ setRecentProject: vi.fn(),routerReplace: vi.fn(),pushNotification: vi.fn(),hasWorkspacePermissionV2: vi.fn(() => false),+ canCreateProject: true,}));vi.mock("@/react/hooks/useAppState", () => ({useCurrentUser: () => mocks.currentUser,useWorkspace: () => mocks.workspace,- useWorkspacePermission: () => mocks.canUpdateWorkspace,+ useWorkspacePermission: (permission: string) =>+ permission === "bb.projects.create"+ ? mocks.canCreateProject+ : mocks.canUpdateWorkspace,+ useCreateProject: () => ({+ createProject: mocks.createProject,+ setRecentProject: mocks.setRecentProject,+ }),}));vi.mock("@/react/stores/app", () => ({@@ -64,11 +75,36 @@ vi.mock("@/react/router", async (importOriginal) => ({},}));+vi.mock("@/react/components/ResourceIdField", async () => {+ const React = await import("react");+ return {+ ResourceIdField: ({+ value,+ resourceTitle,+ onChange,+ onValidationChange,+ }: {+ value: string;+ resourceTitle?: string;+ onChange?: (value: string) => void;+ onValidationChange?: (valid: boolean) => void;+ }) => {+ React.useEffect(() => {+ if (!resourceTitle) return;+ onChange?.("new-project");+ onValidationChange?.(true);+ }, [onChange, onValidationChange, resourceTitle]);+ return <input data-testid="project-resource-id" readOnly value={value} />;+ },+ };+});+vi.mock("@/store", () => ({pushNotification: mocks.pushNotification,}));vi.mock("@/utils", () => ({+ extractProjectResourceName: (name: string) => name.split("/").pop() ?? "",hasWorkspacePermissionV2: mocks.hasWorkspacePermissionV2,}));@@ -77,8 +113,18 @@ vi.mock("@/react/components/UserAvatar", () => ({}));vi.mock("react-i18next", () => ({+ initReactI18next: { type: "3rdParty", init: () => {} },useTranslation: () => ({- t: (key: string) => key,+ t: (key: string) =>+ (+ ({+ "settings.profile.setup-title": "Welcome! Set up your workspace",+ "settings.profile.setup-first-project": "Setup 1st project",+ "settings.profile.default-project-name": "New project",+ "settings.profile.create-project-description":+ "Optional. If you create a project here, we will take you to its database page next.",+ }) as Record<string, string>+ )[key] ?? key,}),}));@@ -104,6 +150,7 @@ const renderIntoContainer = (element: ReactElement) => {beforeEach(async () => {vi.clearAllMocks();mocks.canUpdateWorkspace = true;+ mocks.canCreateProject = true;mocks.workspacePolicy = {bindings: [{@@ -112,6 +159,10 @@ beforeEach(async () => {},],} as IamPolicy;+ mocks.createProject.mockResolvedValue({+ name: "projects/new-project",+ title: "New Project",+ });({ ProfileSetupPage } = await import("./ProfileSetupPage"));});@@ -121,9 +172,24 @@ describe("ProfileSetupPage", () => {page.render();+ expect(page.container.textContent).toContain(+ "Welcome! Set up your workspace"+ );expect(page.container.textContent).toContain("settings.profile.workspace-name");+ const displayNameInput = page.container.querySelector(+ "[data-testid='profile-display-name']"+ );+ const workspaceNameInput = page.container.querySelector(+ "[data-testid='profile-workspace-title']"+ );+ expect(displayNameInput).toBeTruthy();+ expect(workspaceNameInput).toBeTruthy();+ expect(displayNameInput?.closest("[data-slot='form-field']")).toBeTruthy();+ expect(+ workspaceNameInput?.closest("[data-slot='form-field']")+ ).toBeTruthy();expect(mocks.hasWorkspacePermissionV2).not.toHaveBeenCalled();page.unmount();@@ -152,4 +218,93 @@ describe("ProfileSetupPage", () => {page.unmount();});++ test("can optionally create a project and continue to its databases page", async () => {+ const page = renderIntoContainer(<ProfileSetupPage />);++ page.render();++ expect(page.container.textContent).toContain("Setup 1st project");+ expect(page.container.textContent).not.toContain(+ "settings.profile.create-project-description"+ );+ expect(page.container.textContent).not.toContain(+ "Optional. If you create a project here, we will take you to its database page next."+ );+ expect(+ page.container.querySelector("[data-testid='create-project-toggle']")+ ).toBeNull();++ const projectNameInput = page.container.querySelector(+ "[data-testid='profile-project-title']"+ ) as HTMLInputElement;+ expect(projectNameInput.value).toBe("New project");+ expect(+ page.container.querySelector("[data-testid='project-resource-id']")+ ).toBeTruthy();+ expect(+ projectNameInput.closest("[data-slot='form-field']")?.className+ ).not.toContain("border-control-border");+ expect(+ [...page.container.querySelectorAll("[data-slot='form-field']")].some(+ (field) => field.className.includes("border-control-border")+ )+ ).toBe(false);++ const save = Array.from(page.container.querySelectorAll("button")).find(+ (button) => button.textContent?.includes("common.save")+ ) as HTMLButtonElement;+ await act(async () => {+ save.click();+ await Promise.resolve();+ await Promise.resolve();+ });++ expect(mocks.createProject).toHaveBeenCalledWith(+ "New project",+ "new-project"+ );+ expect(mocks.setRecentProject).toHaveBeenCalledWith("projects/new-project");+ expect(mocks.routerReplace).toHaveBeenCalledWith({+ name: "workspace.project.database",+ params: { projectId: "new-project" },+ query: { intro: "connect-database" },+ });++ page.unmount();+ });++ test("does not create a project when the optional project name is empty", async () => {+ const page = renderIntoContainer(<ProfileSetupPage />);++ page.render();++ const projectNameInput = page.container.querySelector(+ "[data-testid='profile-project-title']"+ ) as HTMLInputElement;+ await act(async () => {+ fireEvent.change(projectNameInput, { target: { value: "" } });+ await Promise.resolve();+ await Promise.resolve();+ });++ expect(+ page.container.querySelector("[data-testid='project-resource-id']")+ ).toBeNull();++ const save = Array.from(page.container.querySelectorAll("button")).find(+ (button) => button.textContent?.includes("common.save")+ ) as HTMLButtonElement;+ await act(async () => {+ save.click();+ await Promise.resolve();+ await Promise.resolve();+ });++ expect(mocks.createProject).not.toHaveBeenCalled();+ expect(mocks.setRecentProject).not.toHaveBeenCalled();+ expect(mocks.routerReplace).toHaveBeenCalledWith("/");++ page.unmount();+ });});diff --git a/frontend/src/react/pages/auth/ProfileSetupPage.tsx b/frontend/src/react/pages/auth/ProfileSetupPage.tsxindex 487c4399df..4bc84ae925 100644--- a/frontend/src/react/pages/auth/ProfileSetupPage.tsx+++ b/frontend/src/react/pages/auth/ProfileSetupPage.tsx@@ -1,29 +1,39 @@import { create } from "@bufbuild/protobuf";import { FieldMaskSchema } from "@bufbuild/protobuf/wkt";-import { useEffect, useRef, useState } from "react";+import { useCallback, useEffect, useRef, useState } from "react";import { useTranslation } from "react-i18next";+import { ResourceIdField } from "@/react/components/ResourceIdField";import { UserAvatar } from "@/react/components/UserAvatar";import { Button } from "@/react/components/ui/button";+import { FormField } from "@/react/components/ui/form";import { Input } from "@/react/components/ui/input";import {+ useCreateProject,useCurrentUser,useWorkspace,useWorkspacePermission,} from "@/react/hooks/useAppState";+import { CONNECT_DATABASE_PRODUCT_INTRO } from "@/react/lib/productIntro";import { router } from "@/react/router";+import { PROJECT_V1_ROUTE_DATABASES } from "@/react/router/handles";import { useAppStore } from "@/react/stores/app";import { pushNotification } from "@/store";+import { projectNamePrefix } from "@/store/modules/v1/common";+import type { ValidatedMessage } from "@/types";import { UpdateUserRequestSchema } from "@/types/proto-es/v1/user_service_pb";import { WorkspaceSchema } from "@/types/proto-es/v1/workspace_service_pb";+import { extractProjectResourceName } from "@/utils";export function ProfileSetupPage() {const { t } = useTranslation();const currentUser = useCurrentUser();const updateUser = useAppStore((state) => state.updateUser);const updateWorkspace = useAppStore((state) => state.updateWorkspace);+ const { createProject, setRecentProject } = useCreateProject();const workspace = useWorkspace();const workspacePolicy = useAppStore((state) => state.workspacePolicy);const canUpdateWorkspace = useWorkspacePermission("bb.workspaces.update");+ const canCreateProject = useWorkspacePermission("bb.projects.create");// Show workspace name field only if the user is the sole member of the// workspace (i.e. they just created it), not when they were invited.@@ -49,15 +59,50 @@ export function ProfileSetupPage() {}}, [currentUser.email, currentUser.title]);const [workspaceTitle, setWorkspaceTitle] = useState(workspace?.title ?? "");+ const [projectTitle, setProjectTitle] = useState(() =>+ t("settings.profile.default-project-name")+ );+ const [projectResourceId, setProjectResourceId] = useState("");+ const [isProjectResourceIdValid, setIsProjectResourceIdValid] =+ useState(false);const [saving, setSaving] = useState(false);+ const projectTitleTrimmed = projectTitle.trim();+ const shouldCreateProject = canCreateProject && !!projectTitleTrimmed;const redirectUrl = () => {const q = new URLSearchParams(window.location.search);return q.get("redirect") || "/";};+ const validateProjectResourceId = useCallback(+ async (id: string): Promise<ValidatedMessage[]> => {+ try {+ const existing = await useAppStore+ .getState()+ .fetchProject(`${projectNamePrefix}${id}`, true);+ if (!existing) return [];+ return [+ {+ type: "error",+ message: t("resource-id.validation.duplicated", {+ resource: t("common.project"),+ }),+ },+ ];+ } catch {+ return [];+ }+ },+ [t]+ );++ const canSave =+ !!name.trim() &&+ !saving &&+ (!shouldCreateProject || isProjectResourceIdValid);+const handleSave = async () => {- if (!currentUser?.name || !name.trim()) return;+ if (!currentUser?.name || !canSave) return;setSaving(true);try {await updateUser(@@ -75,12 +120,31 @@ export function ProfileSetupPage() {["title"]);}+ let createdProjectName = "";+ if (shouldCreateProject) {+ const createdProject = await createProject(+ projectTitleTrimmed,+ projectResourceId+ );+ setRecentProject(createdProject.name);+ createdProjectName = createdProject.name;+ }pushNotification({module: "bytebase",style: "SUCCESS",title: t("settings.profile.setup-success"),});- router.replace(redirectUrl());+ if (createdProjectName) {+ router.replace({+ name: PROJECT_V1_ROUTE_DATABASES,+ params: {+ projectId: extractProjectResourceName(createdProjectName),+ },+ query: { intro: CONNECT_DATABASE_PRODUCT_INTRO },+ });+ } else {+ router.replace(redirectUrl());+ }} catch {pushNotification({module: "bytebase",@@ -100,7 +164,7 @@ export function ProfileSetupPage() {return (<div className="flex flex-col items-center justify-center min-h-screen px-4">- <div className="w-full max-w-sm flex flex-col items-center gap-y-6">+ <div className="w-full max-w-lg mx-4 flex flex-col items-center gap-y-6"><UserAvatartitle={displayName}colorSeed={currentUser?.email}@@ -115,11 +179,9 @@ export function ProfileSetupPage() {</div><div className="w-full flex flex-col gap-y-4">- <div className="flex flex-col gap-y-1.5">- <label className="text-sm font-medium">- {t("settings.profile.display-name")}- </label>+ <FormField title={t("settings.profile.display-name")}><Input+ data-testid="profile-display-name"value={name}onChange={(e) => setName(e.target.value)}placeholder={t("settings.profile.display-name-placeholder")}@@ -130,25 +192,45 @@ export function ProfileSetupPage() {}}}/>- </div>+ </FormField>{canRenameWorkspace && (- <div className="flex flex-col gap-y-1.5">- <label className="text-sm font-medium">- {t("settings.profile.workspace-name")}- </label>+ <FormField title={t("settings.profile.workspace-name")}><Input+ data-testid="profile-workspace-title"value={workspaceTitle}onChange={(e) => setWorkspaceTitle(e.target.value)}placeholder={t("settings.profile.workspace-name-placeholder")}/>- </div>+ </FormField>+ )}++ {canCreateProject && (+ <FormField title={t("settings.profile.setup-first-project")}>+ <Input+ data-testid="profile-project-title"+ value={projectTitle}+ onChange={(e) => setProjectTitle(e.target.value)}+ placeholder={t("quick-action.new-project")}+ />+ {projectTitleTrimmed && (+ <ResourceIdField+ suffix+ value={projectResourceId}+ resourceName={t("common.project")}+ resourceTitle={projectTitle}+ validate={validateProjectResourceId}+ onChange={setProjectResourceId}+ onValidationChange={setIsProjectResourceIdValid}+ />+ )}+ </FormField>)}<div className="flex flex-col gap-y-2 mt-2"><ButtononClick={() => void handleSave()}- disabled={!name.trim() || saving}+ disabled={!canSave}className="w-full">{t("common.save")}diff --git a/frontend/src/react/pages/project/ProjectDatabasesPage.test.tsx b/frontend/src/react/pages/project/ProjectDatabasesPage.test.tsxnew file mode 100644index 0000000000..62036b8b44--- /dev/null+++ b/frontend/src/react/pages/project/ProjectDatabasesPage.test.tsx@@ -0,0 +1,401 @@+import { act } from "react";+import { createRoot } from "react-dom/client";+import { beforeEach, describe, expect, test, vi } from "vitest";+import { preCreateIssue } from "@/react/lib/plan/issue";++(+ globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }+).IS_REACT_ACT_ENVIRONMENT = true;++const mocks = vi.hoisted(() => ({+ visibleDatabases: [] as { name: string }[],+ routerCurrentQuery: {} as Record<string, unknown>,+ routerPush: vi.fn(),+ showProductIntroOnce: vi.fn(),+ removeDatabaseMetadataCache: vi.fn(),+ fetchInstanceList: vi.fn(async () => ({+ instances: [] as { name: string; title: string }[],+ })),+ workspacePermissions: new Set<string>([+ "bb.instances.create",+ "bb.instances.list",+ ]),+}));++let ProjectDatabasesPage: typeof import("./ProjectDatabasesPage").ProjectDatabasesPage;++vi.mock("react-i18next", () => ({+ initReactI18next: { type: "3rdParty", init: () => {} },+ useTranslation: () => ({ t: (key: string) => key }),+}));++vi.mock("@/react/router", () => ({+ router: {+ push: mocks.routerPush,+ currentRoute: {+ get value() {+ return { query: mocks.routerCurrentQuery };+ },+ },+ },+}));++vi.mock("@/react/components/AdvancedSearch", () => ({+ AdvancedSearch: () => <div data-testid="advanced-search" />,+ getValueFromScopes: () => undefined,+}));++vi.mock("@/react/components/EditEnvironmentSheet", () => ({+ EditEnvironmentSheet: () => null,+}));++vi.mock("@/react/components/PermissionGuard", () => ({+ PermissionGuard: ({ children }: { children: React.ReactNode }) => (+ <>{children}</>+ ),+}));++vi.mock("@/react/components/database", async () => {+ const React = await import("react");+ return {+ CreateDatabaseSheet: ({ open }: { open: boolean }) =>+ open+ ? React.createElement("div", { "data-testid": "create-database-sheet" })+ : null,+ DatabaseBatchOperationsBar: () => null,+ DatabaseTable: ({+ emptyPlaceholder,+ onDatabasesChange,+ }: {+ emptyPlaceholder?: React.ReactNode;+ onDatabasesChange: (databases: { name: string }[]) => void;+ }) => {+ React.useEffect(() => {+ onDatabasesChange(mocks.visibleDatabases);+ }, [onDatabasesChange]);+ return React.createElement(+ "div",+ { "data-testid": "database-table" },+ emptyPlaceholder+ );+ },+ LabelEditorSheet: () => null,+ };+});++vi.mock("@/react/hooks/useProjectByName", () => ({+ useProjectByName: (name: string) => ({ name, title: "Demo Project" }),+}));++vi.mock("@/react/lib/plan/issue", () => ({+ preCreateIssue: vi.fn(),+}));++vi.mock("@/react/lib/productIntro", () => ({+ CONNECT_DATABASE_PRODUCT_INTRO: "connect-database",+ PRODUCT_INTRO_QUERY_KEY: "intro",+ showProductIntroOnce: mocks.showProductIntroOnce,+}));++vi.mock("@/react/stores/app", () => {+ const appState = {+ removeDatabaseMetadataCache: mocks.removeDatabaseMetadataCache,+ databasesByName: {},+ projectsByName: {},+ environmentList: [],+ };+ const useAppStore = (selector: (state: typeof appState) => unknown) =>+ selector(appState);+ useAppStore.getState = () => ({+ fetchInstanceList: mocks.fetchInstanceList,+ batchSyncDatabases: vi.fn(),+ batchUpdateDatabases: vi.fn(),+ serverInfo: { defaultProject: "projects/default" },+ });+ return { useAppStore };+});++vi.mock("@/store", () => ({+ pushNotification: vi.fn(),+}));++vi.mock("@/utils", async () => {+ const actual = await vi.importActual<typeof import("@/utils")>("@/utils");+ return {+ ...actual,+ engineNameV1: () => "PostgreSQL",+ extractInstanceResourceName: (name: string) =>+ name.replace(/^instances\//, ""),+ getDefaultPagination: () => 1000,+ hasProjectPermissionV2: () => true,+ hasWorkspacePermissionV2: (permission: string) =>+ mocks.workspacePermissions.has(permission),+ PERMISSIONS_FOR_DATABASE_CREATE_ISSUE: [],+ supportedEngineV1List: () => [],+ };+});++beforeEach(async () => {+ vi.clearAllMocks();+ mocks.visibleDatabases = [];+ mocks.routerCurrentQuery = {};+ mocks.workspacePermissions = new Set([+ "bb.instances.create",+ "bb.instances.list",+ ]);+ ({ ProjectDatabasesPage } = await import("./ProjectDatabasesPage"));+});++describe("ProjectDatabasesPage", () => {+ test("shows a connect database action when the project has no databases", async () => {+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<ProjectDatabasesPage projectId="demo" />);+ });++ const toolbarButton = container.querySelector(+ 'button[data-product-intro-target="connect-database"]'+ );+ expect(toolbarButton?.textContent).toContain("project.connect-database");+ expect(+ container.querySelector("[data-testid='database-table'] button")+ ).toBe(null);+ expect(container.textContent).toContain(+ "project.connect-database-empty-placeholder"+ );++ act(() => {+ root.unmount();+ });+ });++ test("starts the connect database intro when requested after project creation", async () => {+ mocks.routerCurrentQuery = { intro: "connect-database" };+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<ProjectDatabasesPage projectId="demo" />);+ await Promise.resolve();+ });++ expect(mocks.showProductIntroOnce).toHaveBeenCalledWith({+ id: "connect-database",+ title: "project.connect-database-intro-title",+ description: "project.connect-database-intro-description",+ closeLabel: "common.close",+ });++ act(() => {+ root.unmount();+ });+ });++ test("routes the empty project connect action to instance creation with project context", async () => {+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<ProjectDatabasesPage projectId="demo" />);+ });++ const button = container.querySelector(+ 'button[data-product-intro-target="connect-database"]'+ ) as HTMLButtonElement;+ act(() => {+ button.click();+ });++ expect(mocks.routerPush).toHaveBeenCalledWith({+ name: "workspace.instance.create",+ query: { project: "demo" },+ });++ act(() => {+ root.unmount();+ });+ });++ test("opens the add database sheet when the project is empty but the workspace has instances", async () => {+ mocks.fetchInstanceList.mockResolvedValueOnce({+ instances: [{ name: "instances/prod", title: "Prod" }],+ });+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<ProjectDatabasesPage projectId="demo" />);+ await Promise.resolve();+ });++ const button = container.querySelector(+ "button:not([data-product-intro-target])"+ ) as HTMLButtonElement;+ expect(button.textContent?.trim()).toContain("project.add-database");+ expect(container.textContent).toContain(+ "project.add-database-empty-placeholder"+ );+ expect(container.textContent).not.toContain("project.connect-database");++ await act(async () => {+ button.click();+ });++ expect(mocks.routerPush).not.toHaveBeenCalled();+ expect(+ container.querySelector("[data-testid='create-database-sheet']")+ ).not.toBeNull();++ act(() => {+ root.unmount();+ });+ });++ test("disables the empty project connect action without workspace instance creation permission", async () => {+ mocks.workspacePermissions.delete("bb.instances.create");+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<ProjectDatabasesPage projectId="demo" />);+ });++ const button = container.querySelector(+ 'button[data-product-intro-target="connect-database"]'+ ) as HTMLButtonElement;+ expect(button.textContent?.trim()).toContain("project.connect-database");+ expect(button.disabled).toBe(true);+ expect(+ container.querySelector("[data-testid='database-table'] button")+ ).toBe(null);++ act(() => {+ button.click();+ });+ expect(mocks.routerPush).not.toHaveBeenCalled();++ act(() => {+ root.unmount();+ });+ });++ test("shows syncing guidance when redirected from project-aware instance creation", async () => {+ mocks.routerCurrentQuery = { syncingInstance: "prod" };+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<ProjectDatabasesPage projectId="demo" />);+ });++ expect(container.textContent).toContain(+ "db.project-instance-syncing-title"+ );+ expect(container.textContent).toContain(+ "db.project-instance-syncing-description"+ );+ expect(container.textContent).toContain("common.refresh");+ expect(container.textContent).toContain(+ "db.project-instance-syncing-empty"+ );+ expect(container.textContent).not.toContain("project.connect-database");++ const refreshButton = Array.from(container.querySelectorAll("button")).find(+ (button) => button.textContent?.includes("common.refresh")+ ) as HTMLButtonElement;+ await act(async () => {+ refreshButton.click();+ });++ act(() => {+ root.unmount();+ });+ });++ test("shows next action after redirected instance databases finish syncing", async () => {+ mocks.routerCurrentQuery = { syncingInstance: "prod" };+ mocks.visibleDatabases = [{ name: "instances/prod/databases/app" }];+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<ProjectDatabasesPage projectId="demo" />);+ });++ expect(container.textContent).toContain("db.project-instance-synced-title");+ expect(container.textContent).toContain(+ "db.project-instance-synced-description"+ );+ expect(container.textContent).toContain(+ "db.project-instance-synced-action"+ );+ expect(container.textContent).toContain(+ "db.project-instance-synced-sql-editor-action"+ );+ expect(container.textContent).not.toContain(+ "db.project-instance-syncing-title"+ );++ const nextActionButton = Array.from(+ container.querySelectorAll("button")+ ).find((button) =>+ button.textContent?.includes("db.project-instance-synced-action")+ ) as HTMLButtonElement;+ await act(async () => {+ nextActionButton.click();+ });++ expect(preCreateIssue).toHaveBeenCalledWith("projects/demo", [+ "instances/prod/databases/app",+ ]);++ const sqlEditorButton = Array.from(+ container.querySelectorAll("button")+ ).find((button) =>+ button.textContent?.includes(+ "db.project-instance-synced-sql-editor-action"+ )+ ) as HTMLButtonElement;+ await act(async () => {+ sqlEditorButton.click();+ });++ expect(mocks.routerPush).toHaveBeenCalledWith({+ name: "sql-editor.database",+ params: {+ project: "demo",+ instance: "prod",+ database: "app",+ },+ });++ act(() => {+ root.unmount();+ });+ });++ test("recognizes syncInstance query alias for manually opened URLs", async () => {+ mocks.routerCurrentQuery = {+ syncInstance: "prod",+ intro: "connect-database",+ };+ mocks.visibleDatabases = [{ name: "instances/prod/databases/app" }];+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<ProjectDatabasesPage projectId="demo" />);+ });++ expect(container.textContent).toContain("db.project-instance-synced-title");+ expect(container.textContent).toContain(+ "db.project-instance-synced-action"+ );++ act(() => {+ root.unmount();+ });+ });+});diff --git a/frontend/src/react/pages/project/ProjectDatabasesPage.tsx b/frontend/src/react/pages/project/ProjectDatabasesPage.tsxindex 1ea4baa2b3..c1cd0331bd 100644--- a/frontend/src/react/pages/project/ProjectDatabasesPage.tsx+++ b/frontend/src/react/pages/project/ProjectDatabasesPage.tsx@@ -1,6 +1,6 @@import { create } from "@bufbuild/protobuf";import { FieldMaskSchema } from "@bufbuild/protobuf/wkt";-import { Plus } from "lucide-react";+import { Plus, SquareTerminal } from "lucide-react";import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import {@@ -22,6 +22,7 @@ import {ProjectPageLayout,ProjectPageToolbar,} from "@/react/components/ProjectPageLayout";+import { Alert } from "@/react/components/ui/alert";import {AlertDialog,AlertDialogContent,@@ -32,6 +33,16 @@ import { Button } from "@/react/components/ui/button";import { useProjectByName } from "@/react/hooks/useProjectByName";import type { DatabaseFilter } from "@/react/lib/databaseFilter";import { preCreateIssue } from "@/react/lib/plan/issue";+import {+ CONNECT_DATABASE_PRODUCT_INTRO,+ PRODUCT_INTRO_QUERY_KEY,+ showProductIntroOnce,+} from "@/react/lib/productIntro";+import { router } from "@/react/router";+import {+ INSTANCE_ROUTE_CREATE,+ SQL_EDITOR_DATABASE_MODULE,+} from "@/react/router/handles";import { useAppStore } from "@/react/stores/app";import { pushNotification } from "@/store";import {@@ -56,6 +67,7 @@ import {import { unknownDatabase } from "@/types/v1/database";import {engineNameV1,+ extractDatabaseResourceName,extractInstanceResourceName,getDefaultPagination,hasProjectPermissionV2,@@ -90,6 +102,10 @@ export function ProjectDatabasesPage({ projectId }: { projectId: string }) {const [showEditEnvDrawer, setShowEditEnvDrawer] = useState(false);const [showUnassignConfirm, setShowUnassignConfirm] = useState(false);const [refreshToken, setRefreshToken] = useState(0);+ const [workspaceHasInstance, setWorkspaceHasInstance] = useState<+ boolean | undefined+ >(undefined);+ const autoRefreshCountRef = useRef(0);const [searchParams, setSearchParams] = useState<SearchParams>({query: "",@@ -215,6 +231,15 @@ export function ProjectDatabasesPage({ projectId }: { projectId: string }) {// Selection stateconst [selectedNames, setSelectedNames] = useState<Set<string>>(new Set());const [visibleDatabases, setVisibleDatabases] = useState<Database[]>([]);+ const syncingInstanceId = useMemo(() => {+ const { syncingInstance, syncInstance } = router.currentRoute.value.query;+ const value = syncingInstance ?? syncInstance;+ return typeof value === "string" && value ? value : undefined;+ }, []);+ const productIntro = useMemo(() => {+ const value = router.currentRoute.value.query[PRODUCT_INTRO_QUERY_KEY];+ return typeof value === "string" ? value : undefined;+ }, []);const selectedDatabases = useMemo(() => {if (selectedNames.size === 0) return [];@@ -227,6 +252,7 @@ export function ProjectDatabasesPage({ projectId }: { projectId: string }) {() => selectedDatabases.map((db) => db.name),[selectedDatabases]);+ const canCreateInstance = hasWorkspacePermissionV2("bb.instances.create");// Mirror `selectedDatabases` into a ref so the batch-operation handlers// below can read the latest value without listing it as a dep. Otherwise@@ -241,6 +267,45 @@ export function ProjectDatabasesPage({ projectId }: { projectId: string }) {setSelectedNames(new Set());}, []);+ useEffect(() => {+ if (!syncingInstanceId || visibleDatabases.length > 0) return;+ autoRefreshCountRef.current = 0;+ const timer = window.setInterval(() => {+ autoRefreshCountRef.current += 1;+ refresh();+ if (autoRefreshCountRef.current >= 12) {+ window.clearInterval(timer);+ }+ }, 5000);+ return () => window.clearInterval(timer);+ }, [syncingInstanceId, visibleDatabases.length, refresh]);++ useEffect(() => {+ if (!hasWorkspacePermissionV2("bb.instances.list")) {+ setWorkspaceHasInstance(false);+ return;+ }++ let cancelled = false;+ useAppStore+ .getState()+ .fetchInstanceList({ pageSize: 1 })+ .then(({ instances }) => {+ if (!cancelled) {+ setWorkspaceHasInstance(instances.length > 0);+ }+ })+ .catch(() => {+ if (!cancelled) {+ setWorkspaceHasInstance(false);+ }+ });++ return () => {+ cancelled = true;+ };+ }, []);+// Batch operation handlersconst handleSyncSchema = useCallback(async () => {if (syncing) return;@@ -379,6 +444,82 @@ export function ProjectDatabasesPage({ projectId }: { projectId: string }) {preCreateIssue(projectName, selectedDatabaseNames);}, [projectName, selectedDatabaseNames]);+ const hasVisibleDatabase = visibleDatabases.length > 0;+ const showSyncingInstanceHint = !!syncingInstanceId && !hasVisibleDatabase;+ const showPostSyncNextAction = !!syncingInstanceId && hasVisibleDatabase;+ const checkingWorkspaceInstance =+ !hasVisibleDatabase &&+ !showSyncingInstanceHint &&+ workspaceHasInstance === undefined;+ const emptyProjectHasInstance =+ !hasVisibleDatabase &&+ workspaceHasInstance === true &&+ !showSyncingInstanceHint;+ const emptyProjectShouldConnectInstance =+ !hasVisibleDatabase &&+ workspaceHasInstance === false &&+ !showSyncingInstanceHint;++ const handleCreateFirstChange = useCallback(() => {+ const firstDatabase = visibleDatabases[0];+ if (!firstDatabase) return;+ preCreateIssue(projectName, [firstDatabase.name]);+ }, [projectName, visibleDatabases]);++ const handleOpenFirstDatabaseInSQLEditor = useCallback(() => {+ const firstDatabase = visibleDatabases[0];+ if (!firstDatabase) return;+ const { instanceName, databaseName } = extractDatabaseResourceName(+ firstDatabase.name+ );+ router.push({+ name: SQL_EDITOR_DATABASE_MODULE,+ params: {+ project: projectId,+ instance: instanceName,+ database: databaseName,+ },+ });+ }, [projectId, visibleDatabases]);++ useEffect(() => {+ if (productIntro !== CONNECT_DATABASE_PRODUCT_INTRO) return;+ if (+ showSyncingInstanceHint ||+ hasVisibleDatabase ||+ workspaceHasInstance !== false ||+ !canCreateInstance+ ) {+ return;+ }+ void showProductIntroOnce({+ id: CONNECT_DATABASE_PRODUCT_INTRO,+ title: t("project.connect-database-intro-title"),+ description: t("project.connect-database-intro-description"),+ closeLabel: t("common.close"),+ });+ }, [+ canCreateInstance,+ hasVisibleDatabase,+ productIntro,+ showSyncingInstanceHint,+ workspaceHasInstance,+ t,+ ]);++ const handleCreateDatabaseAction = useCallback(() => {+ if (checkingWorkspaceInstance) return;+ if (emptyProjectShouldConnectInstance) {+ if (!hasWorkspacePermissionV2("bb.instances.create")) return;+ router.push({+ name: INSTANCE_ROUTE_CREATE,+ query: { project: projectId },+ });+ return;+ }+ setShowCreateDrawer(true);+ }, [checkingWorkspaceInstance, emptyProjectShouldConnectInstance, projectId]);+return (<ProjectPageLayout><ProjectPageToolbar className="flex-col items-start gap-2 sm:flex-row sm:items-end">@@ -388,29 +529,100 @@ export function ProjectDatabasesPage({ projectId }: { projectId: string }) {placeholder={t("database.filter-database")}scopeOptions={scopeOptions}/>- <PermissionGuard- permissions={[- "bb.instances.list",- "bb.plans.create",- "bb.sheets.create",- ]}- project={project}- >- <Button- disabled={- !hasProjectPermission("bb.instances.list") ||- !PERMISSIONS_FOR_DATABASE_CREATE_ISSUE.every((permission) =>- hasProjectPermission(permission)- )+ {!showSyncingInstanceHint && (+ <PermissionGuard+ permissions={+ hasVisibleDatabase || emptyProjectHasInstance+ ? ["bb.instances.list", "bb.plans.create", "bb.sheets.create"]+ : ["bb.instances.create"]+ }+ project={+ hasVisibleDatabase || emptyProjectHasInstance+ ? project+ : undefined}- onClick={() => setShowCreateDrawer(true)}>- <Plus className="size-4 mr-1" />- {t("common.create")}- </Button>- </PermissionGuard>+ <Button+ data-product-intro-target={+ emptyProjectShouldConnectInstance+ ? CONNECT_DATABASE_PRODUCT_INTRO+ : undefined+ }+ disabled={+ checkingWorkspaceInstance+ ? true+ : hasVisibleDatabase || emptyProjectHasInstance+ ? !hasProjectPermission("bb.instances.list") ||+ !PERMISSIONS_FOR_DATABASE_CREATE_ISSUE.every(+ (permission) => hasProjectPermission(permission)+ )+ : !canCreateInstance+ }+ onClick={handleCreateDatabaseAction}+ >+ <Plus className="size-4 mr-1" />+ {hasVisibleDatabase+ ? t("common.create")+ : emptyProjectHasInstance+ ? t("project.add-database")+ : t("project.connect-database")}+ </Button>+ </PermissionGuard>+ )}</ProjectPageToolbar>+ {showSyncingInstanceHint && (+ <Alert+ variant="info"+ title={t("db.project-instance-syncing-title", {+ instance: syncingInstanceId,+ })}+ description={+ <div className="flex flex-col gap-y-3 sm:flex-row sm:items-center sm:justify-between sm:gap-x-4">+ <span>{t("db.project-instance-syncing-description")}</span>+ <Button size="sm" appearance="outline" onClick={refresh}>+ {t("common.refresh")}+ </Button>+ </div>+ }+ />+ )}++ {showPostSyncNextAction && (+ <Alert+ variant="info"+ title={t("db.project-instance-synced-title")}+ description={+ <div className="flex flex-col gap-y-3 sm:flex-row sm:items-center sm:justify-between sm:gap-x-4">+ <span>{t("db.project-instance-synced-description")}</span>+ <div className="flex flex-wrap items-center gap-x-2 gap-y-2">+ <PermissionGuard+ permissions={["bb.sql.select"]}+ project={project}+ >+ <Button+ size="sm"+ appearance="outline"+ onClick={handleOpenFirstDatabaseInSQLEditor}+ >+ <SquareTerminal className="size-4" />+ {t("db.project-instance-synced-sql-editor-action")}+ </Button>+ </PermissionGuard>+ <PermissionGuard+ permissions={PERMISSIONS_FOR_DATABASE_CREATE_ISSUE}+ project={project}+ >+ <Button size="sm" onClick={handleCreateFirstChange}>+ {t("db.project-instance-synced-action")}+ </Button>+ </PermissionGuard>+ </div>+ </div>+ }+ />+ )}+<DatabaseTablefilter={filter}parent={projectName}@@ -419,6 +631,24 @@ export function ProjectDatabasesPage({ projectId }: { projectId: string }) {onSelectedNamesChange={setSelectedNames}onDatabasesChange={setVisibleDatabases}refreshToken={refreshToken}+ emptyPlaceholder={+ showSyncingInstanceHint ? (+ <div className="flex flex-col items-center gap-y-3 text-center">+ <div className="text-sm text-control-light">+ {t("db.project-instance-syncing-empty")}+ </div>+ <Button size="sm" appearance="outline" onClick={refresh}>+ {t("common.refresh")}+ </Button>+ </div>+ ) : (+ <span className="text-sm text-control-light">+ {emptyProjectHasInstance+ ? t("project.add-database-empty-placeholder")+ : t("project.connect-database-empty-placeholder")}+ </span>+ )+ }/>{/* Batch operations bar */}diff --git a/frontend/src/react/pages/project/ProjectPageLayout.test.ts b/frontend/src/react/pages/project/ProjectPageLayout.test.tsindex 748020d85a..77dbdaac98 100644--- a/frontend/src/react/pages/project/ProjectPageLayout.test.ts+++ b/frontend/src/react/pages/project/ProjectPageLayout.test.ts@@ -53,6 +53,8 @@ describe("project page layout", () => {expect(source).toContain("paddingBlock: 16");expect(source).toContain("paddingInline: 16");expect(source).toContain("rowGap: 16");+ expect(source).toContain('overflowX: "clip"');+ expect(source).not.toContain('overflowX: "hidden"');expect(source).not.toContain("paddingBottom: 8");});diff --git a/frontend/src/react/pages/settings/CreateInstancePage.test.tsx b/frontend/src/react/pages/settings/CreateInstancePage.test.tsxindex 4d3a117157..f38d017322 100644--- a/frontend/src/react/pages/settings/CreateInstancePage.test.tsx+++ b/frontend/src/react/pages/settings/CreateInstancePage.test.tsx@@ -8,6 +8,8 @@ import { beforeEach, describe, expect, test, vi } from "vitest";const mocks = vi.hoisted(() => ({useUnsavedChangesGuard: vi.fn(),+ routerCurrentQuery: {} as Record<string, unknown>,+ routerPush: vi.fn(),instanceFormContext: {basicInfo: { engine: 0 },state: { isRequesting: false },@@ -28,7 +30,12 @@ vi.mock("@/react/hooks/useUnsavedChangesGuard", () => ({vi.mock("@/react/router", () => ({router: {- push: vi.fn(),+ push: mocks.routerPush,+ currentRoute: {+ get value() {+ return { query: mocks.routerCurrentQuery };+ },+ },},}));@@ -54,14 +61,26 @@ vi.mock("@/react/components/instance", () => ({InstanceFormButtons: ({ className }: { className?: string }) => (<div data-testid="instance-form-buttons" className={className} />),- InstanceFormProvider: ({ children }: { children: React.ReactNode }) => (- <div>{children}</div>+ InstanceFormProvider: ({+ children,+ onDismiss,+ }: {+ children: React.ReactNode;+ onDismiss?: () => void;+ }) => (+ <div>+ <button type="button" data-testid="dismiss" onClick={onDismiss}>+ dismiss+ </button>+ {children}+ </div>),useInstanceFormContext: () => mocks.instanceFormContext,}));beforeEach(async () => {vi.clearAllMocks();+ mocks.routerCurrentQuery = {};mocks.instanceFormContext.state.isRequesting = false;mocks.instanceFormContext.valueChanged = false;globalThis.ResizeObserver = class ResizeObserver {@@ -130,4 +149,109 @@ describe("CreateInstancePage", () => {root.unmount();});});++ test("dismisses to the workspace instance dashboard by default", () => {+ const container = document.createElement("div");+ const root = createRoot(container);++ act(() => {+ root.render(<CreateInstancePage />);+ });++ const dismiss = container.querySelector(+ "[data-testid='dismiss']"+ ) as HTMLButtonElement;+ act(() => {+ dismiss.click();+ });++ expect(mocks.routerPush).toHaveBeenCalledWith({+ name: "workspace.instance",+ });++ act(() => {+ root.unmount();+ });+ });++ test("dismisses to the project database page when project context is present", () => {+ mocks.routerCurrentQuery = { project: "demo" };+ const container = document.createElement("div");+ const root = createRoot(container);++ act(() => {+ root.render(<CreateInstancePage />);+ });++ const dismiss = container.querySelector(+ "[data-testid='dismiss']"+ ) as HTMLButtonElement;+ act(() => {+ dismiss.click();+ });++ expect(mocks.routerPush).toHaveBeenCalledWith({+ name: "workspace.project.database",+ params: { projectId: "demo" },+ });++ act(() => {+ root.unmount();+ });+ });++ test("keeps syncing instance and intro context when dismissing to the project database page", () => {+ mocks.routerCurrentQuery = {+ project: "demo",+ syncInstance: "prod",+ intro: "connect-database",+ };+ const container = document.createElement("div");+ const root = createRoot(container);++ act(() => {+ root.render(<CreateInstancePage />);+ });++ const dismiss = container.querySelector(+ "[data-testid='dismiss']"+ ) as HTMLButtonElement;+ act(() => {+ dismiss.click();+ });++ expect(mocks.routerPush).toHaveBeenCalledWith({+ name: "workspace.project.database",+ params: { projectId: "demo" },+ query: {+ syncingInstance: "prod",+ intro: "connect-database",+ },+ });++ act(() => {+ root.unmount();+ });+ });++ test("shows the instance form directly for project-context setup", () => {+ mocks.routerCurrentQuery = { project: "demo" };+ const container = document.createElement("div");+ const root = createRoot(container);++ act(() => {+ root.render(<CreateInstancePage />);+ });++ expect(container.textContent).not.toContain(+ "instance.create-readiness.title"+ );+ expect(+ container.querySelector("[data-testid='instance-form-body']")+ ).not.toBe(null);++ act(() => {+ root.unmount();+ });+ });});diff --git a/frontend/src/react/pages/settings/CreateInstancePage.tsx b/frontend/src/react/pages/settings/CreateInstancePage.tsxindex 73284eb687..40805367ac 100644--- a/frontend/src/react/pages/settings/CreateInstancePage.tsx+++ b/frontend/src/react/pages/settings/CreateInstancePage.tsx@@ -11,7 +11,10 @@ import {import type { InfoSection } from "@/react/components/instance/info-content";import { useUnsavedChangesGuard } from "@/react/hooks/useUnsavedChangesGuard";import { router } from "@/react/router";-import { INSTANCE_ROUTE_DASHBOARD } from "@/react/router/handles";+import {+ INSTANCE_ROUTE_DASHBOARD,+ PROJECT_V1_ROUTE_DATABASES,+} from "@/react/router/handles";import { useAppStore } from "@/react/stores/app";import { pushNotification } from "@/store";@@ -41,6 +44,28 @@ export function CreateInstancePage() {}, [t]);const goBack = useCallback(() => {+ const {+ project: projectId,+ syncingInstance,+ syncInstance,+ intro,+ } = router.currentRoute.value.query;+ if (typeof projectId === "string" && projectId) {+ const query: Record<string, string> = {};+ const instanceId = syncingInstance ?? syncInstance;+ if (typeof instanceId === "string" && instanceId) {+ query.syncingInstance = instanceId;+ }+ if (typeof intro === "string" && intro) {+ query.intro = intro;+ }+ router.push({+ name: PROJECT_V1_ROUTE_DATABASES,+ params: { projectId },+ ...(Object.keys(query).length > 0 ? { query } : {}),+ });+ return;+ }router.push({ name: INSTANCE_ROUTE_DASHBOARD });}, []);diff --git a/frontend/src/react/pages/settings/DatabasesPage.test.tsx b/frontend/src/react/pages/settings/DatabasesPage.test.tsxnew file mode 100644index 0000000000..4c78f4d4f3--- /dev/null+++ b/frontend/src/react/pages/settings/DatabasesPage.test.tsx@@ -0,0 +1,168 @@+import { act } from "react";+import { createRoot } from "react-dom/client";+import { beforeEach, describe, expect, test, vi } from "vitest";++(+ globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }+).IS_REACT_ACT_ENVIRONMENT = true;++const mocks = vi.hoisted(() => ({+ routerPush: vi.fn(),+ routerReplace: vi.fn(),+ batchSyncDatabases: vi.fn(),+ batchUpdateDatabases: vi.fn(),+ removeDatabaseMetadataCache: vi.fn(),+ hasWorkspacePermission: true,+}));++let DatabasesPage: typeof import("./DatabasesPage").DatabasesPage;++vi.mock("react-i18next", () => ({+ initReactI18next: { type: "3rdParty", init: () => {} },+ useTranslation: () => ({ t: (key: string) => key }),+}));++vi.mock("@/react/router", () => ({+ router: {+ currentRoute: {+ value: { query: {} },+ },+ push: mocks.routerPush,+ replace: mocks.routerReplace,+ },+}));++vi.mock("@/react/components/AdvancedSearch", () => ({+ AdvancedSearch: () => <div data-testid="advanced-search" />,+ getValueFromScopes: () => undefined,+}));++vi.mock("@/react/components/EditEnvironmentSheet", () => ({+ EditEnvironmentSheet: () => null,+}));++vi.mock("@/react/components/EngineIcon", () => ({+ EngineIcon: () => <span data-testid="engine-icon" />,+}));++vi.mock("@/react/components/EnvironmentLabel", () => ({+ EnvironmentLabel: () => <span data-testid="environment-label" />,+}));++vi.mock("@/react/components/PermissionGuard", () => ({+ PermissionGuard: ({ children }: { children: React.ReactNode }) => (+ <>{children}</>+ ),+}));++vi.mock("@/react/components/WorkspacePageLayout", () => ({+ WorkspacePageLayout: ({ children }: { children: React.ReactNode }) => (+ <div>{children}</div>+ ),+ WorkspacePageToolbar: ({ children }: { children: React.ReactNode }) => (+ <div>{children}</div>+ ),+}));++vi.mock("@/react/components/database", () => ({+ CreateDatabaseSheet: ({ open }: { open: boolean }) => (+ <div data-testid="create-database-sheet" data-open={String(open)} />+ ),+ DatabaseBatchOperationsBar: () => null,+ DatabaseTable: ({+ emptyPlaceholder,+ }: {+ emptyPlaceholder?: React.ReactNode;+ }) => <div data-testid="database-table">{emptyPlaceholder}</div>,+ LabelEditorSheet: () => null,+ TransferProjectSheet: () => null,+}));++vi.mock("@/react/stores/app", () => {+ const appState = {+ databasesByName: {},+ environmentList: [],+ getDatabaseByName: (name: string) => ({ name }),+ removeDatabaseMetadataCache: mocks.removeDatabaseMetadataCache,+ serverInfo: { defaultProject: "projects/default" },+ };+ const useAppStore = (selector: (state: typeof appState) => unknown) =>+ selector(appState);+ useAppStore.getState = () => ({+ ...appState,+ batchSyncDatabases: mocks.batchSyncDatabases,+ batchUpdateDatabases: mocks.batchUpdateDatabases,+ fetchInstanceList: vi.fn(async () => ({ instances: [] })),+ fetchProjectList: vi.fn(async () => ({ projects: [] })),+ getIntroStateByKey: vi.fn(() => true),+ saveIntroStateByKey: vi.fn(),+ });+ return { useAppStore };+});++vi.mock("@/store", () => ({+ pushNotification: vi.fn(),+}));++vi.mock("@/utils", async () => {+ const actual = await vi.importActual<typeof import("@/utils")>("@/utils");+ return {+ ...actual,+ engineNameV1: () => "PostgreSQL",+ extractInstanceResourceName: (name: string) =>+ name.replace(/^instances\//, ""),+ extractProjectResourceName: (name: string) =>+ name.replace(/^projects\//, ""),+ getDefaultPagination: () => 1000,+ hasWorkspacePermissionV2: () => mocks.hasWorkspacePermission,+ supportedEngineV1List: () => [],+ };+});++beforeEach(async () => {+ vi.clearAllMocks();+ mocks.hasWorkspacePermission = true;+ ({ DatabasesPage } = await import("./DatabasesPage"));+});++describe("DatabasesPage", () => {+ test("passes a connect databases action as the empty table placeholder", async () => {+ const container = document.createElement("div");+ const root = createRoot(container);++ await act(async () => {+ root.render(<DatabasesPage />);+ await Promise.resolve();+ });++ const emptyStateButton = container.querySelector(+ "[data-testid='database-table'] button"+ ) as HTMLButtonElement;+ expect(emptyStateButton?.textContent).toContain(+ "database.connect-databases"+ );+ expect(+ container+ .querySelector("[data-testid='create-database-sheet']")+ ?.getAttribute("data-open")+ ).toBe("false");++ await act(async () => {+ emptyStateButton.click();+ await Promise.resolve();+ });++ expect(mocks.routerPush).toHaveBeenCalledWith({+ name: "workspace.instance.create",+ });+ expect(+ container+ .querySelector("[data-testid='create-database-sheet']")+ ?.getAttribute("data-open")+ ).toBe("false");++ act(() => {+ root.unmount();+ });+ });+});diff --git a/frontend/src/react/pages/settings/DatabasesPage.tsx b/frontend/src/react/pages/settings/DatabasesPage.tsxindex 4a69111550..88676903a1 100644--- a/frontend/src/react/pages/settings/DatabasesPage.tsx+++ b/frontend/src/react/pages/settings/DatabasesPage.tsx@@ -28,6 +28,7 @@ import {} from "@/react/components/WorkspacePageLayout";import type { DatabaseFilter } from "@/react/lib/databaseFilter";import { router } from "@/react/router";+import { INSTANCE_ROUTE_CREATE } from "@/react/router/handles";import { useAppStore } from "@/react/stores/app";import { pushNotification } from "@/store";import {@@ -530,6 +531,19 @@ export function DatabasesPage() {onSelectedNamesChange={setSelectedNames}onDatabasesChange={setVisibleDatabases}refreshToken={refreshToken}+ emptyPlaceholder={+ <Button+ className="gap-x-2"+ disabled={+ !hasWorkspacePermissionV2("bb.instances.list") ||+ !hasWorkspacePermissionV2("bb.issues.create")+ }+ onClick={() => router.push({ name: INSTANCE_ROUTE_CREATE })}+ >+ <Plus className="h-4 w-4" />+ {t("database.connect-databases")}+ </Button>+ }/>{/* Batch operations bar */}diff --git a/frontend/src/react/pages/settings/WorkspacePageLayout.test.ts b/frontend/src/react/pages/settings/WorkspacePageLayout.test.tsindex aaed02167e..2d191619be 100644--- a/frontend/src/react/pages/settings/WorkspacePageLayout.test.ts+++ b/frontend/src/react/pages/settings/WorkspacePageLayout.test.ts@@ -67,6 +67,9 @@ describe("workspace list page layout", () => {expect(source).toContain("paddingBlock: 16");expect(source).toContain("rowGap: 16");+ expect(source).toContain('overflowX: "clip"');+ expect(source).not.toContain('overflowX: "hidden"');+ expect(source).toContain("marginInline: 8");expect(source).toContain('padding?: "page" | "flush"');expect(source).toContain('padding = "page"');expect(source).toContain("pagePadding");@@ -133,6 +136,7 @@ describe("workspace list page layout", () => {expect(source).toContain('<WorkspacePageLayout className="py-0 divide-y divide-block-border">');+ expect(source).not.toContain('className="-mb-4"');});test("does not reserve top gap for hidden custom approval feature attention", () => {diff --git a/frontend/src/react/pages/settings/general/GeneralPage.tsx b/frontend/src/react/pages/settings/general/GeneralPage.tsxindex dfd197dddb..2aeaf6bcf4 100644--- a/frontend/src/react/pages/settings/general/GeneralPage.tsx+++ b/frontend/src/react/pages/settings/general/GeneralPage.tsx@@ -210,7 +210,6 @@ export function GeneralPage() {{isDirty && (<StickyActionFooter- className="-mb-4"left={<Button appearance="outline" onClick={handleRevert}>{t("common.cancel")}diff --git a/frontend/src/react/stores/app/instance.ts b/frontend/src/react/stores/app/instance.tsindex 560c1a56dc..35f29d0281 100644--- a/frontend/src/react/stores/app/instance.ts+++ b/frontend/src/react/stores/app/instance.ts@@ -169,21 +169,23 @@ export const createInstanceSlice: AppSliceCreator<InstanceSlice> = (return upsertInstances([response])[0];},- createInstance: async (instance, validateOnly = false) => {+ createInstance: async (instance, validateOnly, options) => {+ const validateOnlyValue = validateOnly ?? false;const response = await instanceServiceClientConnect.createInstance(createProto(CreateInstanceRequestSchema, {instance,instanceId: extractInstanceResourceName(instance.name),- validateOnly,+ validateOnly: validateOnlyValue,+ project: options?.project,}),{contextValues: createContextValues().set(silentContextKey,- validateOnly+ validateOnlyValue),});- if (!validateOnly) {+ if (!validateOnlyValue) {upsertInstances([response]);}return response;diff --git a/frontend/src/react/stores/app/types.ts b/frontend/src/react/stores/app/types.tsindex 77645fc38e..05b517740b 100644--- a/frontend/src/react/stores/app/types.ts+++ b/frontend/src/react/stores/app/types.ts@@ -438,7 +438,8 @@ export type InstanceSlice = {) => Promise<Instance>;createInstance: (instance: Instance,- validateOnly?: boolean+ validateOnly?: boolean,+ options?: { project?: string }) => Promise<Instance>;updateInstance: (instance: Instance,diff --git a/frontend/src/types/proto-es/v1/instance_service_pb.d.ts b/frontend/src/types/proto-es/v1/instance_service_pb.d.tsindex 290e37a9cf..b7394c2c37 100644--- a/frontend/src/types/proto-es/v1/instance_service_pb.d.ts+++ b/frontend/src/types/proto-es/v1/instance_service_pb.d.ts@@ -178,6 +178,14 @@ export declare type CreateInstanceRequest = Message<"bytebase.v1.CreateInstanceR* @generated from field: bool validate_only = 3;*/validateOnly: boolean;++ /**+ * The project to assign newly discovered databases to during initial sync.+ * Format: projects/{project}+ *+ * @generated from field: string project = 4;+ */+ project: string;};/**diff --git a/frontend/src/types/proto-es/v1/instance_service_pb.js b/frontend/src/types/proto-es/v1/instance_service_pb.jsindex 10641f2947..fb03f92cfe 100644--- a/frontend/src/types/proto-es/v1/instance_service_pb.js+++ b/frontend/src/types/proto-es/v1/instance_service_pb.js@@ -17,7 +17,7 @@ import { file_v1_instance_role_service } from "./instance_role_service_pb";* Describes the file v1/instance_service.proto.*/export const file_v1_instance_service = /*@__PURE__*/- fileDesc("Chl2MS9pbnN0YW5jZV9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSJBChJHZXRJbnN0YW5jZVJlcXVlc3QSKwoEbmFtZRgBIAEoCUId4EEC+kEXChVieXRlYmFzZS5jb20vSW5zdGFuY2UidQoUTGlzdEluc3RhbmNlc1JlcXVlc3QSEQoJcGFnZV9zaXplGAEgASgFEhIKCnBhZ2VfdG9rZW4YAiABKAkSFAoMc2hvd19kZWxldGVkGAMgASgIEg4KBmZpbHRlchgEIAEoCRIQCghvcmRlcl9ieRgFIAEoCSJaChVMaXN0SW5zdGFuY2VzUmVzcG9uc2USKAoJaW5zdGFuY2VzGAEgAygLMhUuYnl0ZWJhc2UudjEuSW5zdGFuY2USFwoPbmV4dF9wYWdlX3Rva2VuGAIgASgJInEKFUNyZWF0ZUluc3RhbmNlUmVxdWVzdBIsCghpbnN0YW5jZRgBIAEoCzIVLmJ5dGViYXNlLnYxLkluc3RhbmNlQgPgQQISEwoLaW5zdGFuY2VfaWQYAiABKAkSFQoNdmFsaWRhdGVfb25seRgDIAEoCCKNAQoVVXBkYXRlSW5zdGFuY2VSZXF1ZXN0EiwKCGluc3Rhbm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kkwI2OgtkYXRhX3NvdXJjZTInL3YxL3tuYW1lPWluc3RhbmNlcy8qfTp1cGRhdGVEYXRhU291cmNlQqoBCg9jb20uYnl0ZWJhc2UudjFCFEluc3RhbmNlU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_instance_role_service]);+ fileDesc("Chl2MS9pbnN0YW5jZV9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSJBChJHZXRJbnN0YW5jZVJlcXVlc3QSKwoEbmFtZRgBIAEoCUId4EEC+kEXChVieXRlYmFzZS5jb20vSW5zdGFuY2UidQoUTGlzdEluc3RhbmNlc1JlcXVlc3QSEQoJcGFnZV9zaXplGAEgASgFEhIKCnBhZ2VfdG9rZW4YAiABKAkSFAoMc2hvd19kZWxldGVkGAMgASgIEg4KBmZpbHRlchgEIAEoCRIQCghvcmRlcl9ieRgFIAEoCSJaChVMaXN0SW5zdGFuY2VzUmVzcG9uc2USKAoJaW5zdGFuY2VzGAEgAygLMhUuYnl0ZWJhc2UudjEuSW5zdGFuY2USFwoPbmV4dF9wYWdlX3Rva2VuGAIgASgJIoIBChVDcmVhdGVJbnN0YW5jZVJlcXVlc3QSLAoIaW5zdGFuY2UYASABKAsyFS5ieXRlYmFzZS52MS5JbnN0YW5jZUID4EECEhMKC2luc3RhbmNlX2lkGAIgASgJEhUKDXZhbGlkYXRlX29ubHkYAyABKAgSDwoHcHJvamVjdBgEIAEoCSKN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c2uK6jATYmIuaW5zdGFuY2VzLnVwZGF0ZZDqMAGY6jABgtPkkwI2OgtkYXRhX3NvdXJjZTInL3YxL3tuYW1lPWluc3RhbmNlcy8qfTp1cGRhdGVEYXRhU291cmNlQqoBCg9jb20uYnl0ZWJhc2UudjFCFEluc3RhbmNlU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_instance_role_service]);/*** Describes the message bytebase.v1.GetInstanceRequest.diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex f67313e719..e644ea4658 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -1698,6 +1698,14 @@ paths:schema:type: booleantitle: validate_only+ - name: project+ in: query+ description: |-+ The project to assign newly discovered databases to during initial sync.+ Format: projects/{project}+ schema:+ type: string+ title: projectrequestBody:description: The instance to create.content:@@ -17616,6 +17624,12 @@ components:type: booleantitle: validate_onlydescription: Validate only also tests the data source connection.+ project:+ type: string+ title: project+ description: |-+ The project to assign newly discovered databases to during initial sync.+ Format: projects/{project}title: CreateInstanceRequestrequired:- instancediff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 72728838f7..e0a89ac734 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -5,12 +5,12 @@- [v1/annotation.proto](#v1_annotation-proto)- [AuthMethod](#bytebase-v1-AuthMethod)-+- [File-level Extensions](#v1_annotation-proto-extensions)- [File-level Extensions](#v1_annotation-proto-extensions)- [File-level Extensions](#v1_annotation-proto-extensions)- [File-level Extensions](#v1_annotation-proto-extensions)-+- [v1/access_grant_service.proto](#v1_access_grant_service-proto)- [AccessGrant](#bytebase-v1-AccessGrant)- [ActivateAccessGrantRequest](#bytebase-v1-ActivateAccessGrantRequest)@@ -21,16 +21,16 @@- [RevokeAccessGrantRequest](#bytebase-v1-RevokeAccessGrantRequest)- [SearchMyAccessGrantsRequest](#bytebase-v1-SearchMyAccessGrantsRequest)- [SearchMyAccessGrantsResponse](#bytebase-v1-SearchMyAccessGrantsResponse)-+- [AccessGrant.Status](#bytebase-v1-AccessGrant-Status)-+- [AccessGrantService](#bytebase-v1-AccessGrantService)-+- [v1/common.proto](#v1_common-proto)- [PermissionDeniedDetail](#bytebase-v1-PermissionDeniedDetail)- [Position](#bytebase-v1-Position)- [Range](#bytebase-v1-Range)-+- [ApprovalStatus](#bytebase-v1-ApprovalStatus)- [Engine](#bytebase-v1-Engine)- [ExportFormat](#bytebase-v1-ExportFormat)@@ -39,7 +39,7 @@- [StatementType](#bytebase-v1-StatementType)- [VCSType](#bytebase-v1-VCSType)- [WebhookType](#bytebase-v1-WebhookType)-+- [v1/rollout_service.proto](#v1_rollout_service-proto)- [BatchCancelTaskRunsRequest](#bytebase-v1-BatchCancelTaskRunsRequest)- [BatchCancelTaskRunsResponse](#bytebase-v1-BatchCancelTaskRunsResponse)@@ -85,23 +85,23 @@- [TaskRunSession](#bytebase-v1-TaskRunSession)- [TaskRunSession.Postgres](#bytebase-v1-TaskRunSession-Postgres)- [TaskRunSession.Postgres.Session](#bytebase-v1-TaskRunSession-Postgres-Session)-+- [Task.Status](#bytebase-v1-Task-Status)- [Task.Type](#bytebase-v1-Task-Type)- [TaskRun.ExportArchiveStatus](#bytebase-v1-TaskRun-ExportArchiveStatus)- [TaskRun.Status](#bytebase-v1-TaskRun-Status)- [TaskRunLogEntry.TransactionControl.Type](#bytebase-v1-TaskRunLogEntry-TransactionControl-Type)- [TaskRunLogEntry.Type](#bytebase-v1-TaskRunLogEntry-Type)-+- [RolloutService](#bytebase-v1-RolloutService)-+- [v1/instance_role_service.proto](#v1_instance_role_service-proto)- [InstanceRole](#bytebase-v1-InstanceRole)- [ListInstanceRolesRequest](#bytebase-v1-ListInstanceRolesRequest)- [ListInstanceRolesResponse](#bytebase-v1-ListInstanceRolesResponse)-+- [InstanceRoleService](#bytebase-v1-InstanceRoleService)-+- [v1/instance_service.proto](#v1_instance_service-proto)- [AddDataSourceRequest](#bytebase-v1-AddDataSourceRequest)- [BatchSyncInstancesRequest](#bytebase-v1-BatchSyncInstancesRequest)@@ -134,7 +134,7 @@- [UndeleteInstanceRequest](#bytebase-v1-UndeleteInstanceRequest)- [UpdateDataSourceRequest](#bytebase-v1-UpdateDataSourceRequest)- [UpdateInstanceRequest](#bytebase-v1-UpdateInstanceRequest)-+- [DataSource.AuthenticationType](#bytebase-v1-DataSource-AuthenticationType)- [DataSource.CloudSQLIPType](#bytebase-v1-DataSource-CloudSQLIPType)- [DataSource.RedisType](#bytebase-v1-DataSource-RedisType)@@ -143,9 +143,9 @@- [DataSourceExternalSecret.SecretType](#bytebase-v1-DataSourceExternalSecret-SecretType)- [DataSourceExternalSecret.TokenType](#bytebase-v1-DataSourceExternalSecret-TokenType)- [DataSourceType](#bytebase-v1-DataSourceType)-+- [InstanceService](#bytebase-v1-InstanceService)-+- [v1/database_service.proto](#v1_database_service-proto)- [BatchGetDatabasesRequest](#bytebase-v1-BatchGetDatabasesRequest)- [BatchGetDatabasesResponse](#bytebase-v1-BatchGetDatabasesResponse)@@ -205,7 +205,7 @@- [TriggerMetadata](#bytebase-v1-TriggerMetadata)- [UpdateDatabaseRequest](#bytebase-v1-UpdateDatabaseRequest)- [ViewMetadata](#bytebase-v1-ViewMetadata)-+- [Changelog.Status](#bytebase-v1-Changelog-Status)- [ChangelogView](#bytebase-v1-ChangelogView)- [ColumnMetadata.IdentityGeneration](#bytebase-v1-ColumnMetadata-IdentityGeneration)@@ -217,9 +217,9 @@- [SyncStatus](#bytebase-v1-SyncStatus)- [TablePartitionMetadata.Type](#bytebase-v1-TablePartitionMetadata-Type)- [TaskMetadata.State](#bytebase-v1-TaskMetadata-State)-+- [DatabaseService](#bytebase-v1-DatabaseService)-+- [v1/sql_service.proto](#v1_sql_service-proto)- [AICompletionRequest](#bytebase-v1-AICompletionRequest)- [AICompletionRequest.Message](#bytebase-v1-AICompletionRequest-Message)@@ -251,7 +251,7 @@- [RowValue.TimestampTZ](#bytebase-v1-RowValue-TimestampTZ)- [SearchQueryHistoriesRequest](#bytebase-v1-SearchQueryHistoriesRequest)- [SearchQueryHistoriesResponse](#bytebase-v1-SearchQueryHistoriesResponse)-+- [Advice.Level](#bytebase-v1-Advice-Level)- [Advice.RuleType](#bytebase-v1-Advice-RuleType)- [QueryHistory.Type](#bytebase-v1-QueryHistory-Type)@@ -259,9 +259,9 @@- [QueryOption.RedisRunCommandsOn](#bytebase-v1-QueryOption-RedisRunCommandsOn)- [QueryResult.CommandError.Type](#bytebase-v1-QueryResult-CommandError-Type)- [QueryResult.Message.Level](#bytebase-v1-QueryResult-Message-Level)-+- [SQLService](#bytebase-v1-SQLService)-+- [v1/plan_service.proto](#v1_plan_service-proto)- [CancelPlanCheckRunRequest](#bytebase-v1-CancelPlanCheckRunRequest)- [CancelPlanCheckRunResponse](#bytebase-v1-CancelPlanCheckRunResponse)@@ -285,12 +285,12 @@- [RunPlanChecksRequest](#bytebase-v1-RunPlanChecksRequest)- [RunPlanChecksResponse](#bytebase-v1-RunPlanChecksResponse)- [UpdatePlanRequest](#bytebase-v1-UpdatePlanRequest)-+- [PlanCheckRun.Result.Type](#bytebase-v1-PlanCheckRun-Result-Type)- [PlanCheckRun.Status](#bytebase-v1-PlanCheckRun-Status)-+- [PlanService](#bytebase-v1-PlanService)-+- [v1/issue_service.proto](#v1_issue_service-proto)- [ApprovalFlow](#bytebase-v1-ApprovalFlow)- [ApprovalTemplate](#bytebase-v1-ApprovalTemplate)@@ -318,14 +318,14 @@- [SearchIssuesResponse](#bytebase-v1-SearchIssuesResponse)- [UpdateIssueCommentRequest](#bytebase-v1-UpdateIssueCommentRequest)- [UpdateIssueRequest](#bytebase-v1-UpdateIssueRequest)-+- [Issue.Approver.Status](#bytebase-v1-Issue-Approver-Status)- [Issue.Type](#bytebase-v1-Issue-Type)- [IssueComment.Approval.Status](#bytebase-v1-IssueComment-Approval-Status)- [IssueStatus](#bytebase-v1-IssueStatus)-+- [IssueService](#bytebase-v1-IssueService)-+- [v1/setting_service.proto](#v1_setting_service-proto)- [AISetting](#bytebase-v1-AISetting)- [Algorithm](#bytebase-v1-Algorithm)@@ -371,7 +371,7 @@- [WorkspaceApprovalSetting.Rule](#bytebase-v1-WorkspaceApprovalSetting-Rule)- [WorkspaceProfileSetting](#bytebase-v1-WorkspaceProfileSetting)- [WorkspaceProfileSetting.PasswordRestriction](#bytebase-v1-WorkspaceProfileSetting-PasswordRestriction)-+- [AISetting.Provider](#bytebase-v1-AISetting-Provider)- [Algorithm.InnerOuterMask.MaskType](#bytebase-v1-Algorithm-InnerOuterMask-MaskType)- [DatabaseChangeMode](#bytebase-v1-DatabaseChangeMode)@@ -380,18 +380,18 @@- [EmailSetting.Type](#bytebase-v1-EmailSetting-Type)- [Setting.SettingName](#bytebase-v1-Setting-SettingName)- [WorkspaceApprovalSetting.Rule.Source](#bytebase-v1-WorkspaceApprovalSetting-Rule-Source)-+- [SettingService](#bytebase-v1-SettingService)-+- [v1/actuator_service.proto](#v1_actuator_service-proto)- [ActuatorInfo](#bytebase-v1-ActuatorInfo)- [DeleteCacheRequest](#bytebase-v1-DeleteCacheRequest)- [GetActuatorInfoRequest](#bytebase-v1-GetActuatorInfoRequest)- [Restriction](#bytebase-v1-Restriction)- [SetupSampleRequest](#bytebase-v1-SetupSampleRequest)-+- [ActuatorService](#bytebase-v1-ActuatorService)-+- [v1/ai_service.proto](#v1_ai_service-proto)- [AIChatMessage](#bytebase-v1-AIChatMessage)- [AIChatRequest](#bytebase-v1-AIChatRequest)@@ -399,11 +399,11 @@- [AIChatToolCall](#bytebase-v1-AIChatToolCall)- [AIChatToolDefinition](#bytebase-v1-AIChatToolDefinition)- [AIChatUsage](#bytebase-v1-AIChatUsage)-+- [AIChatMessageRole](#bytebase-v1-AIChatMessageRole)-+- [AIService](#bytebase-v1-AIService)-+- [v1/iam_policy.proto](#v1_iam_policy-proto)- [Binding](#bytebase-v1-Binding)- [BindingDelta](#bytebase-v1-BindingDelta)@@ -411,9 +411,9 @@- [IamPolicy](#bytebase-v1-IamPolicy)- [PolicyDelta](#bytebase-v1-PolicyDelta)- [SetIamPolicyRequest](#bytebase-v1-SetIamPolicyRequest)-+- [BindingDelta.Action](#bytebase-v1-BindingDelta-Action)-+- [v1/audit_log_service.proto](#v1_audit_log_service-proto)- [AuditData](#bytebase-v1-AuditData)- [AuditLog](#bytebase-v1-AuditLog)@@ -422,11 +422,11 @@- [RequestMetadata](#bytebase-v1-RequestMetadata)- [SearchAuditLogsRequest](#bytebase-v1-SearchAuditLogsRequest)- [SearchAuditLogsResponse](#bytebase-v1-SearchAuditLogsResponse)-+- [AuditLog.Severity](#bytebase-v1-AuditLog-Severity)-+- [AuditLogService](#bytebase-v1-AuditLogService)-+- [v1/user_service.proto](#v1_user_service-proto)- [BatchGetUsersRequest](#bytebase-v1-BatchGetUsersRequest)- [BatchGetUsersResponse](#bytebase-v1-BatchGetUsersResponse)@@ -440,9 +440,9 @@- [UpdateUserRequest](#bytebase-v1-UpdateUserRequest)- [User](#bytebase-v1-User)- [User.Profile](#bytebase-v1-User-Profile)-+- [UserService](#bytebase-v1-UserService)-+- [v1/auth_service.proto](#v1_auth_service-proto)- [ExchangeTokenRequest](#bytebase-v1-ExchangeTokenRequest)- [ExchangeTokenResponse](#bytebase-v1-ExchangeTokenResponse)@@ -459,17 +459,17 @@- [SendEmailLoginCodeRequest](#bytebase-v1-SendEmailLoginCodeRequest)- [SignupRequest](#bytebase-v1-SignupRequest)- [SwitchWorkspaceRequest](#bytebase-v1-SwitchWorkspaceRequest)-+- [AuthService](#bytebase-v1-AuthService)-+- [v1/cel_service.proto](#v1_cel_service-proto)- [BatchDeparseRequest](#bytebase-v1-BatchDeparseRequest)- [BatchDeparseResponse](#bytebase-v1-BatchDeparseResponse)- [BatchParseRequest](#bytebase-v1-BatchParseRequest)- [BatchParseResponse](#bytebase-v1-BatchParseResponse)-+- [CelService](#bytebase-v1-CelService)-+- [v1/database_catalog_service.proto](#v1_database_catalog_service-proto)- [ColumnCatalog](#bytebase-v1-ColumnCatalog)- [ColumnCatalog.LabelsEntry](#bytebase-v1-ColumnCatalog-LabelsEntry)@@ -483,11 +483,11 @@- [TableCatalog](#bytebase-v1-TableCatalog)- [TableCatalog.Columns](#bytebase-v1-TableCatalog-Columns)- [UpdateDatabaseCatalogRequest](#bytebase-v1-UpdateDatabaseCatalogRequest)-+- [ObjectSchema.Type](#bytebase-v1-ObjectSchema-Type)-+- [DatabaseCatalogService](#bytebase-v1-DatabaseCatalogService)-+- [v1/database_group_service.proto](#v1_database_group_service-proto)- [CreateDatabaseGroupRequest](#bytebase-v1-CreateDatabaseGroupRequest)- [DatabaseGroup](#bytebase-v1-DatabaseGroup)@@ -497,11 +497,11 @@- [ListDatabaseGroupsRequest](#bytebase-v1-ListDatabaseGroupsRequest)- [ListDatabaseGroupsResponse](#bytebase-v1-ListDatabaseGroupsResponse)- [UpdateDatabaseGroupRequest](#bytebase-v1-UpdateDatabaseGroupRequest)-+- [DatabaseGroupView](#bytebase-v1-DatabaseGroupView)-+- [DatabaseGroupService](#bytebase-v1-DatabaseGroupService)-+- [v1/group_service.proto](#v1_group_service-proto)- [BatchGetGroupsRequest](#bytebase-v1-BatchGetGroupsRequest)- [BatchGetGroupsResponse](#bytebase-v1-BatchGetGroupsResponse)@@ -513,11 +513,11 @@- [ListGroupsRequest](#bytebase-v1-ListGroupsRequest)- [ListGroupsResponse](#bytebase-v1-ListGroupsResponse)- [UpdateGroupRequest](#bytebase-v1-UpdateGroupRequest)-+- [GroupMember.Role](#bytebase-v1-GroupMember-Role)-+- [GroupService](#bytebase-v1-GroupService)-+- [v1/idp_service.proto](#v1_idp_service-proto)- [CreateIdentityProviderRequest](#bytebase-v1-CreateIdentityProviderRequest)- [DeleteIdentityProviderRequest](#bytebase-v1-DeleteIdentityProviderRequest)@@ -537,13 +537,13 @@- [TestIdentityProviderResponse.ClaimsEntry](#bytebase-v1-TestIdentityProviderResponse-ClaimsEntry)- [TestIdentityProviderResponse.UserInfoEntry](#bytebase-v1-TestIdentityProviderResponse-UserInfoEntry)- [UpdateIdentityProviderRequest](#bytebase-v1-UpdateIdentityProviderRequest)-+- [IdentityProviderType](#bytebase-v1-IdentityProviderType)- [LDAPIdentityProviderConfig.SecurityProtocol](#bytebase-v1-LDAPIdentityProviderConfig-SecurityProtocol)- [OAuth2AuthStyle](#bytebase-v1-OAuth2AuthStyle)-+- [IdentityProviderService](#bytebase-v1-IdentityProviderService)-+- [v1/org_policy_service.proto](#v1_org_policy_service-proto)- [CreatePolicyRequest](#bytebase-v1-CreatePolicyRequest)- [DeletePolicyRequest](#bytebase-v1-DeletePolicyRequest)@@ -560,12 +560,12 @@- [TagPolicy](#bytebase-v1-TagPolicy)- [TagPolicy.TagsEntry](#bytebase-v1-TagPolicy-TagsEntry)- [UpdatePolicyRequest](#bytebase-v1-UpdatePolicyRequest)-+- [PolicyResourceType](#bytebase-v1-PolicyResourceType)- [PolicyType](#bytebase-v1-PolicyType)-+- [OrgPolicyService](#bytebase-v1-OrgPolicyService)-+- [v1/project_service.proto](#v1_project_service-proto)- [Activity](#bytebase-v1-Activity)- [AddWebhookRequest](#bytebase-v1-AddWebhookRequest)@@ -590,11 +590,11 @@- [UpdateProjectRequest](#bytebase-v1-UpdateProjectRequest)- [UpdateWebhookRequest](#bytebase-v1-UpdateWebhookRequest)- [Webhook](#bytebase-v1-Webhook)-+- [Activity.Type](#bytebase-v1-Activity-Type)-+- [ProjectService](#bytebase-v1-ProjectService)-+- [v1/release_service.proto](#v1_release_service-proto)- [CheckReleaseRequest](#bytebase-v1-CheckReleaseRequest)- [CheckReleaseResponse](#bytebase-v1-CheckReleaseResponse)@@ -612,11 +612,11 @@- [UndeleteReleaseRequest](#bytebase-v1-UndeleteReleaseRequest)- [UpdateReleaseRequest](#bytebase-v1-UpdateReleaseRequest)- [VCSUser](#bytebase-v1-VCSUser)-+- [Release.Type](#bytebase-v1-Release-Type)-+- [ReleaseService](#bytebase-v1-ReleaseService)-+- [v1/review_config_service.proto](#v1_review_config_service-proto)- [CreateReviewConfigRequest](#bytebase-v1-CreateReviewConfigRequest)- [DeleteReviewConfigRequest](#bytebase-v1-DeleteReviewConfigRequest)@@ -632,12 +632,12 @@- [SQLReviewRule.StringArrayRulePayload](#bytebase-v1-SQLReviewRule-StringArrayRulePayload)- [SQLReviewRule.StringRulePayload](#bytebase-v1-SQLReviewRule-StringRulePayload)- [UpdateReviewConfigRequest](#bytebase-v1-UpdateReviewConfigRequest)-+- [SQLReviewRule.Level](#bytebase-v1-SQLReviewRule-Level)- [SQLReviewRule.Type](#bytebase-v1-SQLReviewRule-Type)-+- [ReviewConfigService](#bytebase-v1-ReviewConfigService)-+- [v1/revision_service.proto](#v1_revision_service-proto)- [BatchCreateRevisionsRequest](#bytebase-v1-BatchCreateRevisionsRequest)- [BatchCreateRevisionsResponse](#bytebase-v1-BatchCreateRevisionsResponse)@@ -647,11 +647,11 @@- [ListRevisionsRequest](#bytebase-v1-ListRevisionsRequest)- [ListRevisionsResponse](#bytebase-v1-ListRevisionsResponse)- [Revision](#bytebase-v1-Revision)-+- [Revision.Type](#bytebase-v1-Revision-Type)-+- [RevisionService](#bytebase-v1-RevisionService)-+- [v1/role_service.proto](#v1_role_service-proto)- [CreateRoleRequest](#bytebase-v1-CreateRoleRequest)- [DeleteRoleRequest](#bytebase-v1-DeleteRoleRequest)@@ -660,11 +660,11 @@- [ListRolesResponse](#bytebase-v1-ListRolesResponse)- [Role](#bytebase-v1-Role)- [UpdateRoleRequest](#bytebase-v1-UpdateRoleRequest)-+- [Role.Type](#bytebase-v1-Role-Type)-+- [RoleService](#bytebase-v1-RoleService)-+- [v1/service_account_service.proto](#v1_service_account_service-proto)- [CreateServiceAccountRequest](#bytebase-v1-CreateServiceAccountRequest)- [DeleteServiceAccountRequest](#bytebase-v1-DeleteServiceAccountRequest)@@ -674,18 +674,18 @@- [ServiceAccount](#bytebase-v1-ServiceAccount)- [UndeleteServiceAccountRequest](#bytebase-v1-UndeleteServiceAccountRequest)- [UpdateServiceAccountRequest](#bytebase-v1-UpdateServiceAccountRequest)-+- [ServiceAccountService](#bytebase-v1-ServiceAccountService)-+- [v1/sheet_service.proto](#v1_sheet_service-proto)- [BatchCreateSheetsRequest](#bytebase-v1-BatchCreateSheetsRequest)- [BatchCreateSheetsResponse](#bytebase-v1-BatchCreateSheetsResponse)- [CreateSheetRequest](#bytebase-v1-CreateSheetRequest)- [GetSheetRequest](#bytebase-v1-GetSheetRequest)- [Sheet](#bytebase-v1-Sheet)-+- [SheetService](#bytebase-v1-SheetService)-+- [v1/subscription_service.proto](#v1_subscription_service-proto)- [CancelPurchaseRequest](#bytebase-v1-CancelPurchaseRequest)- [CreatePurchaseRequest](#bytebase-v1-CreatePurchaseRequest)@@ -707,15 +707,15 @@- [UploadLicenseRequest](#bytebase-v1-UploadLicenseRequest)- [VerifyCheckoutSessionRequest](#bytebase-v1-VerifyCheckoutSessionRequest)- [VerifyCheckoutSessionResponse](#bytebase-v1-VerifyCheckoutSessionResponse)-+- [BillingInterval](#bytebase-v1-BillingInterval)- [PlanFeature](#bytebase-v1-PlanFeature)- [PlanType](#bytebase-v1-PlanType)- [PurchaseDiscount.Type](#bytebase-v1-PurchaseDiscount-Type)- [PurchasePlanAdditional.Type](#bytebase-v1-PurchasePlanAdditional-Type)-+- [SubscriptionService](#bytebase-v1-SubscriptionService)-+- [v1/workload_identity_service.proto](#v1_workload_identity_service-proto)- [CreateWorkloadIdentityRequest](#bytebase-v1-CreateWorkloadIdentityRequest)- [DeleteWorkloadIdentityRequest](#bytebase-v1-DeleteWorkloadIdentityRequest)@@ -726,11 +726,11 @@- [UpdateWorkloadIdentityRequest](#bytebase-v1-UpdateWorkloadIdentityRequest)- [WorkloadIdentity](#bytebase-v1-WorkloadIdentity)- [WorkloadIdentityConfig](#bytebase-v1-WorkloadIdentityConfig)-+- [WorkloadIdentityConfig.ProviderType](#bytebase-v1-WorkloadIdentityConfig-ProviderType)-+- [WorkloadIdentityService](#bytebase-v1-WorkloadIdentityService)-+- [v1/worksheet_service.proto](#v1_worksheet_service-proto)- [BatchUpdateWorksheetOrganizerRequest](#bytebase-v1-BatchUpdateWorksheetOrganizerRequest)- [BatchUpdateWorksheetOrganizerResponse](#bytebase-v1-BatchUpdateWorksheetOrganizerResponse)@@ -743,11 +743,11 @@- [UpdateWorksheetRequest](#bytebase-v1-UpdateWorksheetRequest)- [Worksheet](#bytebase-v1-Worksheet)- [WorksheetOrganizer](#bytebase-v1-WorksheetOrganizer)-+- [Worksheet.Visibility](#bytebase-v1-Worksheet-Visibility)-+- [WorksheetService](#bytebase-v1-WorksheetService)-+- [v1/workspace_service.proto](#v1_workspace_service-proto)- [DeleteWorkspaceRequest](#bytebase-v1-DeleteWorkspaceRequest)- [GetWorkspaceRequest](#bytebase-v1-GetWorkspaceRequest)@@ -756,9 +756,9 @@- [ListWorkspacesResponse](#bytebase-v1-ListWorkspacesResponse)- [UpdateWorkspaceRequest](#bytebase-v1-UpdateWorkspaceRequest)- [Workspace](#bytebase-v1-Workspace)-+- [WorkspaceService](#bytebase-v1-WorkspaceService)-+- [Scalar Value Types](#scalar-value-types)@@ -769,7 +769,7 @@## v1/annotation.proto-+<a name="bytebase-v1-AuthMethod"></a>@@ -784,7 +784,7 @@ Authorization method for RPC calls.| CUSTOM | 2 | Custom authorization logic. |-+<a name="v1_annotation-proto-extensions"></a>@@ -797,9 +797,9 @@ Authorization method for RPC calls.| auth_method | AuthMethod | .google.protobuf.MethodOptions | 100002 | The authorization method to use for this RPC. || permission | string | .google.protobuf.MethodOptions | 100001 | The permission required to call this method. |--++@@ -969,7 +969,7 @@ Examples: - creator == "users/[email protected]" - status == "ACTIVE&#-+<a name="bytebase-v1-AccessGrant-Status"></a>@@ -985,9 +985,9 @@ The status of the access grant.| REVOKED | 3 | The access grant has been revoked. |--++<a name="bytebase-v1-AccessGrantService"></a>@@ -1004,7 +1004,7 @@ AccessGrantService manages temporary access grants within projects.| RevokeAccessGrant | [RevokeAccessGrantRequest](#bytebase-v1-RevokeAccessGrantRequest) | [AccessGrant](#bytebase-v1-AccessGrant) | Revokes an active access grant. || SearchMyAccessGrants | [SearchMyAccessGrantsRequest](#bytebase-v1-SearchMyAccessGrantsRequest) | [SearchMyAccessGrantsResponse](#bytebase-v1-SearchMyAccessGrantsResponse) | Searches access grants created by the caller. |-+@@ -1080,7 +1080,7 @@ Check the documentation of the field using Range for specific semantics.-+<a name="bytebase-v1-ApprovalStatus"></a>@@ -1263,11 +1263,11 @@ Webhook integration type.| GOOGLE_CHAT | 8 | Google Chat integration. |---+++@@ -2022,7 +2022,7 @@ PostgreSQL session information read from `pg_stat_activity`.-+<a name="bytebase-v1-Task-Status"></a>@@ -2121,9 +2121,9 @@ The type of log entry.| GHOST_MIGRATION | 10 | gh-ost online migration. |--++<a name="bytebase-v1-RolloutService"></a>@@ -2145,7 +2145,7 @@ RolloutService manages the execution of deployment plans.| BatchCancelTaskRuns | [BatchCancelTaskRunsRequest](#bytebase-v1-BatchCancelTaskRunsRequest) | [BatchCancelTaskRunsResponse](#bytebase-v1-BatchCancelTaskRunsResponse) | Cancels multiple task runs. PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive a best-effort cancellation request and may continue running if the request is missed or the executor does not stop. The response does not report which task runs were actually canceled. Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment) || PreviewTaskRunRollback | [PreviewTaskRunRollbackRequest](#bytebase-v1-PreviewTaskRunRollbackRequest) | [PreviewTaskRunRollbackResponse](#bytebase-v1-PreviewTaskRunRollbackResponse) | Generates rollback SQL for a completed task run. Permissions required: bb.taskRuns.list |-+@@ -2211,11 +2211,11 @@ When paginating, all other parameters provided to `ListInstanceRoles` must match---+++<a name="bytebase-v1-InstanceRoleService"></a>@@ -2227,7 +2227,7 @@ InstanceRoleService manages database roles within instances.| ----------- | ------------ | ------------- | ------------|| ListInstanceRoles | [ListInstanceRolesRequest](#bytebase-v1-ListInstanceRolesRequest) | [ListInstanceRolesResponse](#bytebase-v1-ListInstanceRolesResponse) | Lists all database roles in an instance. Permissions required: bb.instanceRoles.list |-+@@ -2323,6 +2323,7 @@ InstanceRoleService manages database roles within instances.This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. || validate_only | [bool](#bool) | | Validate only also tests the data source connection. |+| project | [string](#string) | | The project to assign newly discovered databases to during initial sync. Format: projects/{project} |@@ -2825,7 +2826,7 @@ The instance's `name` field is used to identify the instance to update. Form-+<a name="bytebase-v1-DataSource-AuthenticationType"></a>@@ -2938,9 +2939,9 @@ CloudSQLIPType selects which Cloud SQL IP to dial for Google Cloud SQL IAM conne| READ_ONLY | 2 | Read-only data source for query operations. |--++<a name="bytebase-v1-InstanceService"></a>@@ -2964,7 +2965,7 @@ InstanceService manages database instances and their connections.| RemoveDataSource | [RemoveDataSourceRequest](#bytebase-v1-RemoveDataSourceRequest) | [Instance](#bytebase-v1-Instance) | Removes a read-only data source from an instance. Permissions required: bb.instances.update || UpdateDataSource | [UpdateDataSourceRequest](#bytebase-v1-UpdateDataSourceRequest) | [Instance](#bytebase-v1-Instance) | Updates a data source configuration. Permissions required: bb.instances.update |-+@@ -4114,7 +4115,7 @@ ViewMetadata is the metadata for views.-+<a name="bytebase-v1-Changelog-Status"></a>@@ -4278,9 +4279,9 @@ LIST, HASH (https://www.postgresql.org/docs/current/ddl-partitioning.html)| SUSPENDED | 2 | |--++<a name="bytebase-v1-DatabaseService"></a>@@ -4305,7 +4306,7 @@ DatabaseService manages databases and their schemas.| GetChangelog | [GetChangelogRequest](#bytebase-v1-GetChangelogRequest) | [Changelog](#bytebase-v1-Changelog) | Retrieves a specific changelog entry. Permissions required: bb.changelogs.get || GetSchemaString | [GetSchemaStringRequest](#bytebase-v1-GetSchemaStringRequest) | [GetSchemaStringResponse](#bytebase-v1-GetSchemaStringResponse) | Generates schema DDL for a database object. Permissions required: bb.databases.getSchema |-+@@ -4862,7 +4863,7 @@ For example: project == "projects/{project}" database == "instances/-+<a name="bytebase-v1-Advice-Level"></a>@@ -4961,9 +4962,9 @@ RuleType indicates the source of the linting rule.| EXCEPTION | 6 | Exception message indicating error conditions. |--++<a name="bytebase-v1-SQLService"></a>@@ -4981,7 +4982,7 @@ SQLService executes SQL queries and manages query operations.| DiffMetadata | [DiffMetadataRequest](#bytebase-v1-DiffMetadataRequest) | [DiffMetadataResponse](#bytebase-v1-DiffMetadataResponse) | Computes schema differences between two database metadata. Permissions required: None || AICompletion | [AICompletionRequest](#bytebase-v1-AICompletionRequest) | [AICompletionResponse](#bytebase-v1-AICompletionResponse) | Provides AI-powered SQL completion and generation. Permissions required: None (authenticated users only, requires AI to be enabled) |-+@@ -5371,7 +5372,7 @@ The plan's `name` field is used to identify the plan to update. Format: proj-+<a name="bytebase-v1-PlanCheckRun-Result-Type"></a>@@ -5402,9 +5403,9 @@ The plan's `name` field is used to identify the plan to update. Format: proj| CANCELED | 4 | |--++<a name="bytebase-v1-PlanService"></a>@@ -5422,7 +5423,7 @@ PlanService manages deployment plans for database changes.| RunPlanChecks | [RunPlanChecksRequest](#bytebase-v1-RunPlanChecksRequest) | [RunPlanChecksResponse](#bytebase-v1-RunPlanChecksResponse) | Executes validation checks on a deployment plan. Permissions required: bb.planCheckRuns.run || CancelPlanCheckRun | [CancelPlanCheckRunRequest](#bytebase-v1-CancelPlanCheckRunRequest) | [CancelPlanCheckRunResponse](#bytebase-v1-CancelPlanCheckRunResponse) | Cancels the plan check run for a deployment plan. Permissions required: bb.planCheckRuns.run |-+@@ -5897,7 +5898,7 @@ The issue's `name` field is used to identify the issue to update. Format: pr-+<a name="bytebase-v1-Issue-Approver-Status"></a>@@ -5956,9 +5957,9 @@ The status of an issue.| CANCELED | 3 | Issue is canceled. |--++<a name="bytebase-v1-IssueService"></a>@@ -5982,7 +5983,7 @@ IssueService manages issues for tracking database changes and tasks.| RequestIssue | [RequestIssueRequest](#bytebase-v1-RequestIssueRequest) | [Issue](#bytebase-v1-Issue) | Requests changes on an issue. Access determined by approval flow configuration - caller must be a designated approver for the current approval step. Permissions required: None (determined by approval flow) || RetryIssueApproval | [RetryIssueApprovalRequest](#bytebase-v1-RetryIssueApprovalRequest) | [Issue](#bytebase-v1-Issue) | Re-runs approval-template finding for an issue stuck in CHECKING. Useful when the synchronous post-create finding errored (e.g. against a malformed workspace approval rule) and the operator has since corrected it — without this, the issue would remain in CHECKING indefinitely because there is no other retry path for non-DATABASE_CHANGE issue types. Idempotent: returns the existing issue unchanged when approval-finding has already completed. Permissions required: None (caller must be the issue creator; mirrors RequestIssue's authorization model). |-+@@ -6758,7 +6759,7 @@ For examples: resource.environment_id == "prod" && statement.aff-+<a name="bytebase-v1-AISetting-Provider"></a>@@ -6876,9 +6877,9 @@ For examples: resource.environment_id == "prod" && statement.aff| REQUEST_ACCESS | 5 | |--++<a name="bytebase-v1-SettingService"></a>@@ -6893,7 +6894,7 @@ SettingService manages workspace-level settings and configurations.| UpdateSetting | [UpdateSettingRequest](#bytebase-v1-UpdateSettingRequest) | [Setting](#bytebase-v1-Setting) | Updates a workspace setting. Permissions required: bb.settings.set || TestEmailSetting | [TestEmailSettingRequest](#bytebase-v1-TestEmailSettingRequest) | [TestEmailSettingResponse](#bytebase-v1-TestEmailSettingResponse) | Sends a test email using the provided config (without persisting). Permissions required: bb.settings.set |-+@@ -6993,11 +6994,11 @@ Request message for setting up sample data.---+++<a name="bytebase-v1-ActuatorService"></a>@@ -7011,7 +7012,7 @@ ActuatorService manages system health and operational information.| SetupSample | [SetupSampleRequest](#bytebase-v1-SetupSampleRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Sets up sample data for demonstration and testing purposes. Permissions required: bb.projects.create || DeleteCache | [DeleteCacheRequest](#bytebase-v1-DeleteCacheRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Clears the system cache to force data refresh. Permissions required: None |-+@@ -7122,7 +7123,7 @@ Token usage for a single AI provider call.-+<a name="bytebase-v1-AIChatMessageRole"></a>@@ -7139,9 +7140,9 @@ Role of a chat message.| AI_CHAT_MESSAGE_ROLE_TOOL | 4 | Tool result message. |--++<a name="bytebase-v1-AIService"></a>@@ -7153,7 +7154,7 @@ AIService provides AI chat capabilities for the page agent.| ----------- | ------------ | ------------- | ------------|| Chat | [AIChatRequest](#bytebase-v1-AIChatRequest) | [AIChatResponse](#bytebase-v1-AIChatResponse) | Chat sends a conversation with tool definitions to the configured AI provider and returns the AI response. |-+@@ -7268,7 +7269,7 @@ Request message for setting an IAM policy.-+<a name="bytebase-v1-BindingDelta-Action"></a>@@ -7283,11 +7284,11 @@ Type of action performed on a binding.| REMOVE | 2 | Remove a binding. |---+++@@ -7429,7 +7430,7 @@ Response message for searching audit logs.-+<a name="bytebase-v1-AuditLog-Severity"></a>@@ -7450,9 +7451,9 @@ Severity level for audit log entries.| EMERGENCY | 8 | System is unusable. |--++<a name="bytebase-v1-AuditLogService"></a>@@ -7465,7 +7466,7 @@ AuditLogService manages audit logs for system activities and API calls.| SearchAuditLogs | [SearchAuditLogsRequest](#bytebase-v1-SearchAuditLogsRequest) | [SearchAuditLogsResponse](#bytebase-v1-SearchAuditLogsResponse) | Searches audit logs with optional filtering and pagination. Permissions required: bb.auditLogs.search || ExportAuditLogs | [ExportAuditLogsRequest](#bytebase-v1-ExportAuditLogsRequest) | [ExportAuditLogsResponse](#bytebase-v1-ExportAuditLogsResponse) | Exports audit logs in a specified format for external analysis. Permissions required: bb.auditLogs.export |-+@@ -7688,11 +7689,11 @@ The user's `name` field is used to identify the user to update. Format: user---+++<a name="bytebase-v1-UserService"></a>@@ -7712,7 +7713,7 @@ UserService manages user accounts and authentication.| UndeleteUser | [UndeleteUserRequest](#bytebase-v1-UndeleteUserRequest) | [User](#bytebase-v1-User) | Restores a deleted user. Permissions required: bb.users.undelete || UpdateEmail | [UpdateEmailRequest](#bytebase-v1-UpdateEmailRequest) | [User](#bytebase-v1-User) | Updates a user's email address. Permissions required: bb.users.updateEmail |-+@@ -7956,11 +7957,11 @@ Response from refreshing the access token.---+++<a name="bytebase-v1-AuthService"></a>@@ -7980,7 +7981,7 @@ AuthService handles user authentication operations.| ResetPassword | [ResetPasswordRequest](#bytebase-v1-ResetPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Resets the user's password using a password reset token from email. Permissions required: None (validates via token) || SendEmailLoginCode | [SendEmailLoginCodeRequest](#bytebase-v1-SendEmailLoginCodeRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Sends a 6-digit verification code to the email for login/signup. Always returns success (no email enumeration). Enforces 60-sec resend cooldown. Permissions required: None |-+@@ -8050,11 +8051,11 @@ Response message for batch parsing CEL expressions.---+++<a name="bytebase-v1-CelService"></a>@@ -8067,7 +8068,7 @@ CelService manages CEL (Common Expression Language) parsing and formatting opera| BatchParse | [BatchParseRequest](#bytebase-v1-BatchParseRequest) | [BatchParseResponse](#bytebase-v1-BatchParseResponse) | Parses multiple CEL expression strings into AST representations. Permissions required: None || BatchDeparse | [BatchDeparseRequest](#bytebase-v1-BatchDeparseRequest) | [BatchDeparseResponse](#bytebase-v1-BatchDeparseResponse) | Converts multiple CEL AST representations back into expression strings. Permissions required: None |-+@@ -8274,7 +8275,7 @@ The catalog's `name` field is used to identify the database catalog to updat-+<a name="bytebase-v1-ObjectSchema-Type"></a>@@ -8292,9 +8293,9 @@ Object schema data types.| ARRAY | 5 | Array type. |--++<a name="bytebase-v1-DatabaseCatalogService"></a>@@ -8307,7 +8308,7 @@ DatabaseCatalogService manages database schema metadata and classification.| GetDatabaseCatalog | [GetDatabaseCatalogRequest](#bytebase-v1-GetDatabaseCatalogRequest) | [DatabaseCatalog](#bytebase-v1-DatabaseCatalog) | Gets the catalog metadata for a database. Permissions required: bb.databaseCatalogs.get || UpdateDatabaseCatalog | [UpdateDatabaseCatalogRequest](#bytebase-v1-UpdateDatabaseCatalogRequest) | [DatabaseCatalog](#bytebase-v1-DatabaseCatalog) | Updates catalog metadata such as classifications and labels. Permissions required: bb.databaseCatalogs.update |-+@@ -8455,7 +8456,7 @@ The database group's `name` field is used to identify the database group to-+<a name="bytebase-v1-DatabaseGroupView"></a>@@ -8470,9 +8471,9 @@ View options for database group responses.| DATABASE_GROUP_VIEW_FULL | 2 | Include everything. |--++<a name="bytebase-v1-DatabaseGroupService"></a>@@ -8488,7 +8489,7 @@ DatabaseGroupService manages database groups for organizing databases by criteri| UpdateDatabaseGroup | [UpdateDatabaseGroupRequest](#bytebase-v1-UpdateDatabaseGroupRequest) | [DatabaseGroup](#bytebase-v1-DatabaseGroup) | Updates a database group. Permissions required: bb.databaseGroups.update When allow_missing=true, also requires: bb.databaseGroups.create || DeleteDatabaseGroup | [DeleteDatabaseGroupRequest](#bytebase-v1-DeleteDatabaseGroupRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Deletes a database group. Permissions required: bb.databaseGroups.delete |-+@@ -8670,7 +8671,7 @@ The group's `name` field is used to identify the group to update. Format: gr-+<a name="bytebase-v1-GroupMember-Role"></a>@@ -8685,9 +8686,9 @@ The role of a group member.| MEMBER | 2 | Group member. |--++<a name="bytebase-v1-GroupService"></a>@@ -8704,7 +8705,7 @@ GroupService manages user groups for organizing users and permissions.| UpdateGroup | [UpdateGroupRequest](#bytebase-v1-UpdateGroupRequest) | [Group](#bytebase-v1-Group) | Updates a group. Group owners or users with bb.groups.update permission can update. Permissions required: bb.groups.update OR caller is group owner When allow_missing=true, also requires: bb.groups.create || DeleteGroup | [DeleteGroupRequest](#bytebase-v1-DeleteGroupRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Deletes a group. Group owners or users with bb.groups.delete permission can delete. Permissions required: bb.groups.delete OR caller is group owner |-+@@ -9031,7 +9032,7 @@ The identity provider's `name` field is used to identify the identity provid-+<a name="bytebase-v1-IdentityProviderType"></a>@@ -9073,9 +9074,9 @@ The identity provider's `name` field is used to identify the identity provid| IN_HEADER | 2 | IN_HEADER sends the client_id and client_password using HTTP Basic Authorization. This is an optional style described in the OAuth2 RFC 6749 section 2.3.1. |--++<a name="bytebase-v1-IdentityProviderService"></a>@@ -9092,7 +9093,7 @@ IdentityProviderService manages external identity providers for SSO authenticati| DeleteIdentityProvider | [DeleteIdentityProviderRequest](#bytebase-v1-DeleteIdentityProviderRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Deletes an identity provider. Permissions required: bb.identityProviders.delete || TestIdentityProvider | [TestIdentityProviderRequest](#bytebase-v1-TestIdentityProviderRequest) | [TestIdentityProviderResponse](#bytebase-v1-TestIdentityProviderResponse) | Tests the connection and configuration of an identity provider. Permissions required: bb.identityProviders.update |-+@@ -9362,7 +9363,7 @@ The policy's `name` field is used to identify the instance to update. Format-+<a name="bytebase-v1-PolicyResourceType"></a>@@ -9394,9 +9395,9 @@ The type of organizational policy.| DATA_QUERY | 6 | Query data access policy. |--++<a name="bytebase-v1-OrgPolicyService"></a>@@ -9412,7 +9413,7 @@ OrgPolicyService manages organizational policies at various resource levels.| UpdatePolicy | [UpdatePolicyRequest](#bytebase-v1-UpdatePolicyRequest) | [Policy](#bytebase-v1-Policy) | Updates an existing organizational policy. Permissions required: bb.policies.update || DeletePolicy | [DeletePolicyRequest](#bytebase-v1-DeletePolicyRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Deletes an organizational policy. Permissions required: bb.policies.delete |-+@@ -9819,7 +9820,7 @@ The project's `name` field is used to identify the project to update. Format-+<a name="bytebase-v1-Activity-Type"></a>@@ -9838,9 +9839,9 @@ Activity type enumeration.| ISSUE_APPROVED | 15 | ISSUE_APPROVED represents an issue being fully approved. |--++<a name="bytebase-v1-ProjectService"></a>@@ -9866,7 +9867,7 @@ ProjectService manages projects that group databases and changes.| RemoveWebhook | [RemoveWebhookRequest](#bytebase-v1-RemoveWebhookRequest) | [Project](#bytebase-v1-Project) | Removes a webhook from a project. Permissions required: bb.projects.update || TestWebhook | [TestWebhookRequest](#bytebase-v1-TestWebhookRequest) | [TestWebhookResponse](#bytebase-v1-TestWebhookResponse) | Tests a webhook by sending a test notification. Permissions required: bb.projects.update |-+@@ -10158,7 +10159,7 @@ Version control system source information.-+<a name="bytebase-v1-Release-Type"></a>@@ -10173,9 +10174,9 @@ The type of schema change.| DECLARATIVE | 2 | Declarative schema definition. |--++<a name="bytebase-v1-ReleaseService"></a>@@ -10194,7 +10195,7 @@ ReleaseService manages releases for coordinating deployments.| CheckRelease | [CheckReleaseRequest](#bytebase-v1-CheckReleaseRequest) | [CheckReleaseResponse](#bytebase-v1-CheckReleaseResponse) | Validates a release by dry-running checks on target databases. Permissions required: bb.releases.check || ListReleaseCategories | [ListReleaseCategoriesRequest](#bytebase-v1-ListReleaseCategoriesRequest) | [ListReleaseCategoriesResponse](#bytebase-v1-ListReleaseCategoriesResponse) | Lists all unique categories in a project. Permissions required: bb.releases.list |-+@@ -10427,7 +10428,7 @@ The name field is used to identify the SQL review config to update. |-+<a name="bytebase-v1-SQLReviewRule-Level"></a>@@ -10557,9 +10558,9 @@ The severity level for SQL review rules.| STATEMENT_DISALLOW_TRUNCATE | 111 | |--++<a name="bytebase-v1-ReviewConfigService"></a>@@ -10575,7 +10576,7 @@ ReviewConfigService manages approval flow configurations.| UpdateReviewConfig | [UpdateReviewConfigRequest](#bytebase-v1-UpdateReviewConfigRequest) | [ReviewConfig](#bytebase-v1-ReviewConfig) | Updates a SQL review configuration. Permissions required: bb.reviewConfigs.update When allow_missing=true, also requires: bb.reviewConfigs.create || DeleteReviewConfig | [DeleteReviewConfigRequest](#bytebase-v1-DeleteReviewConfigRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Deletes a SQL review configuration. Permissions required: bb.reviewConfigs.delete |-+@@ -10723,7 +10724,7 @@ When paginating, all other parameters provided to `ListRevisions` must match the-+<a name="bytebase-v1-Revision-Type"></a>@@ -10738,9 +10739,9 @@ The type of schema revision.| DECLARATIVE | 2 | Declarative schema definition. |--++<a name="bytebase-v1-RevisionService"></a>@@ -10755,7 +10756,7 @@ RevisionService manages schema revision history.| BatchCreateRevisions | [BatchCreateRevisionsRequest](#bytebase-v1-BatchCreateRevisionsRequest) | [BatchCreateRevisionsResponse](#bytebase-v1-BatchCreateRevisionsResponse) | Creates multiple schema revisions in a single operation. Permissions required: bb.revisions.create || DeleteRevision | [DeleteRevisionRequest](#bytebase-v1-DeleteRevisionRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Deletes a schema revision. Permissions required: bb.revisions.delete |-+@@ -10874,7 +10875,7 @@ Role defines a set of permissions that can be assigned to users.-+<a name="bytebase-v1-Role-Type"></a>@@ -10889,9 +10890,9 @@ Role defines a set of permissions that can be assigned to users.| CUSTOM | 2 | User-defined role that can be modified. |--++<a name="bytebase-v1-RoleService"></a>@@ -10907,7 +10908,7 @@ RoleService manages workspace roles and permissions.| UpdateRole | [UpdateRoleRequest](#bytebase-v1-UpdateRoleRequest) | [Role](#bytebase-v1-Role) | Updates a role's properties. Permissions required: bb.roles.update When allow_missing=true, also requires: bb.roles.create || DeleteRole | [DeleteRoleRequest](#bytebase-v1-DeleteRoleRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Deletes a custom role. Permissions required: bb.roles.delete |-+@@ -11058,11 +11059,11 @@ The service account's `name` field is used to identify the service account t---+++<a name="bytebase-v1-ServiceAccountService"></a>@@ -11079,7 +11080,7 @@ ServiceAccountService manages service accounts for API integrations.| DeleteServiceAccount | [DeleteServiceAccountRequest](#bytebase-v1-DeleteServiceAccountRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Deletes a service account. Permissions required: bb.serviceAccounts.delete || UndeleteServiceAccount | [UndeleteServiceAccountRequest](#bytebase-v1-UndeleteServiceAccountRequest) | [ServiceAccount](#bytebase-v1-ServiceAccount) | Restores a deleted service account. Permissions required: bb.serviceAccounts.undelete |-+@@ -11169,11 +11170,11 @@ ServiceAccountService manages service accounts for API integrations.---+++<a name="bytebase-v1-SheetService"></a>@@ -11187,7 +11188,7 @@ SheetService manages SQL scripts and saved queries.| BatchCreateSheets | [BatchCreateSheetsRequest](#bytebase-v1-BatchCreateSheetsRequest) | [BatchCreateSheetsResponse](#bytebase-v1-BatchCreateSheetsResponse) | Creates multiple SQL sheets in a single operation. Permissions required: bb.sheets.create || GetSheet | [GetSheetRequest](#bytebase-v1-GetSheetRequest) | [Sheet](#bytebase-v1-Sheet) | Retrieves a SQL sheet by name. Permissions required: bb.sheets.get |-+@@ -11511,7 +11512,7 @@ PlanLimitConfig represents a single plan's configuration-+<a name="bytebase-v1-BillingInterval"></a>@@ -11648,9 +11649,9 @@ PlanFeature represents the available features in Bytebase| USER | 1 | |--++<a name="bytebase-v1-SubscriptionService"></a>@@ -11670,7 +11671,7 @@ SubscriptionService manages enterprise subscriptions and licensing.| VerifyCheckoutSession | [VerifyCheckoutSessionRequest](#bytebase-v1-VerifyCheckoutSessionRequest) | [VerifyCheckoutSessionResponse](#bytebase-v1-VerifyCheckoutSessionResponse) | VerifyCheckoutSession verifies a Stripe Checkout Session status (SaaS only). || ListPurchasePlans | [ListPurchasePlansRequest](#bytebase-v1-ListPurchasePlansRequest) | [ListPurchasePlansResponse](#bytebase-v1-ListPurchasePlansResponse) | ListPurchasePlans returns available plans for self-service purchase. |-+@@ -11839,7 +11840,7 @@ WorkloadIdentityConfig for API layer-+<a name="bytebase-v1-WorkloadIdentityConfig-ProviderType"></a>@@ -11854,9 +11855,9 @@ ProviderType identifies the CI/CD platform.| GITLAB | 2 | |--++<a name="bytebase-v1-WorkloadIdentityService"></a>@@ -11873,7 +11874,7 @@ WorkloadIdentityService manages workload identities for external CI/CD integrati| DeleteWorkloadIdentity | [DeleteWorkloadIdentityRequest](#bytebase-v1-DeleteWorkloadIdentityRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Deletes a workload identity. Permissions required: bb.workloadIdentities.delete || UndeleteWorkloadIdentity | [UndeleteWorkloadIdentityRequest](#bytebase-v1-UndeleteWorkloadIdentityRequest) | [WorkloadIdentity](#bytebase-v1-WorkloadIdentity) | Restores a deleted workload identity. Permissions required: bb.workloadIdentities.undelete |-+@@ -12074,7 +12075,7 @@ The worksheet's `name` field is used to identify the worksheet to update. Fo-+<a name="bytebase-v1-Worksheet-Visibility"></a>@@ -12090,9 +12091,9 @@ The worksheet's `name` field is used to identify the worksheet to update. Fo| PRIVATE | 3 | Private, only worksheet OWNER can read/write. |--++<a name="bytebase-v1-WorksheetService"></a>@@ -12110,7 +12111,7 @@ WorksheetService manages SQL worksheets for query development.| BatchUpdateWorksheetOrganizer | [BatchUpdateWorksheetOrganizerRequest](#bytebase-v1-BatchUpdateWorksheetOrganizerRequest) | [BatchUpdateWorksheetOrganizerResponse](#bytebase-v1-BatchUpdateWorksheetOrganizerResponse) | Batch update the organizers of worksheets. The access is the same as UpdateWorksheet method. Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets) || DeleteWorksheet | [DeleteWorksheetRequest](#bytebase-v1-DeleteWorksheetRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Delete a worksheet. The access is the same as UpdateWorksheet method. Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets) |-+@@ -12223,11 +12224,11 @@ WorksheetService manages SQL worksheets for query development.---+++<a name="bytebase-v1-WorkspaceService"></a>@@ -12245,7 +12246,7 @@ WorkspaceService manages workspace-level operations and profile.| LeaveWorkspace | [LeaveWorkspaceRequest](#bytebase-v1-LeaveWorkspaceRequest) | [LoginResponse](#bytebase-v1-LoginResponse) | Removes the calling user from a workspace and switches to the next available workspace. Available to any workspace member. Fails if the caller is the last workspace admin. || SetIamPolicy | [SetIamPolicyRequest](#bytebase-v1-SetIamPolicyRequest) | [IamPolicy](#bytebase-v1-IamPolicy) | Sets IAM policy for the workspace. Permissions required: bb.workspaces.setIamPolicy |-+diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex 041906b1ad..ed32da8340 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -7196,6 +7196,14 @@ are /[a-z][0-9]-/. </p></td><td><p>Validate only also tests the data source connection. </p></td></tr>+ <tr>+ <td>project</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>The project to assign newly discovered databases to during initial sync.+Format: projects/{project} </p></td>+ </tr>+</tbody></table>diff --git a/proto/v1/v1/instance_service.proto b/proto/v1/v1/instance_service.protoindex bd7b21fd93..51fde418d5 100644--- a/proto/v1/v1/instance_service.proto+++ b/proto/v1/v1/instance_service.proto@@ -262,6 +262,10 @@ message CreateInstanceRequest {// Validate only also tests the data source connection.bool validate_only = 3;++ // The project to assign newly discovered databases to during initial sync.+ // Format: projects/{project}+ string project = 4;}message UpdateInstanceRequest {