Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

23.4 KB
Raw Blame

gh-ost Task Run Log Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Add a dedicated gh-ost migration task-run log section with start/end timing, statement context, and error reporting.

Architecture: Extend the store log proto with GHOST_MIGRATION_START / GHOST_MIGRATION_END, expose them through the v1 API as one collapsed GHOST_MIGRATION timed entry, and emit the pair around migrator.Migrate(). The React task-run log viewer should treat gh-ost like other timed sections while using a distinct localized label.

Tech Stack: Go, protobuf/buf, Connect/gRPC generated code, React, TypeScript, i18next, Vitest.


File Map

  • Modify proto/store/store/task_run_log.proto: add store log types and payload messages.
  • Modify proto/v1/v1/rollout_service.proto: add public GHOST_MIGRATION entry type and payload message.
  • Regenerate generated protobuf artifacts with cd proto && buf generate.
  • Modify backend/api/v1/rollout_service_converter.go: collapse gh-ost start/end store logs into one v1 entry.
  • Create backend/api/v1/rollout_service_converter_test.go: unit test the conversion behavior.
  • Modify backend/plugin/db/driver.go: add ExecuteOptions helper methods for gh-ost start/end logging.
  • Modify backend/runner/taskrun/database_migrate_executor.go: pass execute options into gh-ost execution and emit logs around migrator.Migrate().
  • Modify backend/tests/rollout.go: add a rollout-returning test helper without changing existing helper callers.
  • Modify backend/tests/ghost_test.go: assert the successful gh-ost rollout exposes a gh-ost task-run log entry followed by database sync.
  • Modify frontend/src/react/components/task-run-log/model.ts: include gh-ost in timed-entry completion, error, duration, and detail handling.
  • Modify frontend/src/react/components/task-run-log/TaskRunLogViewer.tsx: add a section label for gh-ost.
  • Modify frontend/src/react/components/task-run-log/model.test.ts: add model coverage for gh-ost timed entries.
  • Modify locale files:
    • frontend/src/react/locales/en-US.json
    • frontend/src/react/locales/zh-CN.json
    • frontend/src/react/locales/ja-JP.json
    • frontend/src/react/locales/es-ES.json
    • frontend/src/react/locales/vi-VN.json
    • frontend/src/locales/en-US.json
    • frontend/src/locales/zh-CN.json
    • frontend/src/locales/ja-JP.json
    • frontend/src/locales/es-ES.json
    • frontend/src/locales/vi-VN.json

Task 1: Proto Shape and API Conversion

Files:

  • Modify: proto/store/store/task_run_log.proto

  • Modify: proto/v1/v1/rollout_service.proto

  • Generated by command: backend/generated-go/store/task_run_log.pb.go

  • Generated by command: backend/generated-go/v1/rollout_service.pb.go

  • Generated by command: backend/generated-go/v1/rollout_service.pb.gw.go

  • Generated by command: backend/generated-go/v1/rollout_service_grpc.pb.go

  • Generated by command: backend/generated-go/v1/v1connect/rollout_service.connect.go

  • Generated by command: frontend/src/types/proto-es/v1/rollout_service_pb.d.ts

  • Generated by command: frontend/src/types/proto-es/v1/rollout_service_pb.js

  • Generated by command: proto/gen/grpc-doc/store/README.md

  • Generated by command: proto/gen/grpc-doc/store/index.html

  • Generated by command: proto/gen/grpc-doc/v1/README.md

  • Generated by command: proto/gen/grpc-doc/v1/index.html

  • Generated by command: proto/gen/grpc-doc/openapi.yaml

  • Generated by command: backend/api/mcp/gen/openapi.yaml

  • Modify: backend/api/v1/rollout_service_converter.go

  • Create: backend/api/v1/rollout_service_converter_test.go

  • Step 1: Write the failing converter test

Create backend/api/v1/rollout_service_converter_test.go:

package v1

import (
	"testing"
	"time"

	"github.com/stretchr/testify/require"

	storepb "github.com/bytebase/bytebase/backend/generated-go/store"
	v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"
	"github.com/bytebase/bytebase/backend/store"
)

func TestConvertToTaskRunLogEntries_GhostMigration(t *testing.T) {
	start := time.Date(2026, 5, 8, 10, 0, 0, 0, time.UTC)
	end := start.Add(3 * time.Second)

	entries := convertToTaskRunLogEntries([]*store.TaskRunLog{
		{
			T: start,
			Payload: &storepb.TaskRunLog{
				Type:      storepb.TaskRunLog_GHOST_MIGRATION_START,
				ReplicaId: "replica-a",
				GhostMigrationStart: &storepb.TaskRunLog_GhostMigrationStart{
					Statement: "ALTER TABLE book ADD COLUMN author VARCHAR(54)",
				},
			},
		},
		{
			T: end,
			Payload: &storepb.TaskRunLog{
				Type:      storepb.TaskRunLog_GHOST_MIGRATION_END,
				ReplicaId: "replica-a",
				GhostMigrationEnd: &storepb.TaskRunLog_GhostMigrationEnd{
					Error: "copy failed",
				},
			},
		},
	})

	require.Len(t, entries, 1)
	entry := entries[0]
	require.Equal(t, v1pb.TaskRunLogEntry_GHOST_MIGRATION, entry.Type)
	require.Equal(t, "replica-a", entry.ReplicaId)
	require.NotNil(t, entry.GhostMigration)
	require.Equal(t, "ALTER TABLE book ADD COLUMN author VARCHAR(54)", entry.GhostMigration.Statement)
	require.Equal(t, start.Unix(), entry.GhostMigration.StartTime.AsTime().Unix())
	require.Equal(t, end.Unix(), entry.GhostMigration.EndTime.AsTime().Unix())
	require.Equal(t, "copy failed", entry.GhostMigration.Error)
}
  • Step 2: Run test to verify it fails

Run:

go test -v -count=1 ./backend/api/v1 -run ^TestConvertToTaskRunLogEntries_GhostMigration$

Expected: FAIL at compile time because TaskRunLog_GHOST_MIGRATION_START, TaskRunLog_GhostMigrationStart, TaskRunLogEntry_GHOST_MIGRATION, and GhostMigration do not exist yet.

  • Step 3: Add store proto fields

In proto/store/store/task_run_log.proto, update the enum and fields:

    GHOST_MIGRATION_START = 15;
    GHOST_MIGRATION_END = 16;

Add fields after ReleaseFileExecute release_file_execute = 16;:

  GhostMigrationStart ghost_migration_start = 17;
  GhostMigrationEnd ghost_migration_end = 18;

Add messages after ReleaseFileExecute:

  message GhostMigrationStart {
    // The cleaned ALTER statement passed to gh-ost.
    string statement = 1;
  }
  message GhostMigrationEnd {
    string error = 1;
  }
  • Step 4: Add v1 proto fields

In proto/v1/v1/rollout_service.proto, add a new enum value after RELEASE_FILE_EXECUTE = 9;:

    // gh-ost online migration.
    GHOST_MIGRATION = 10;

Add a field after ReleaseFileExecute release_file_execute = 12;:

  // gh-ost migration details (if type is GHOST_MIGRATION).
  GhostMigration ghost_migration = 13;

Add this nested message near the other timed operation messages:

  // gh-ost migration details.
  message GhostMigration {
    // When the gh-ost migration started.
    google.protobuf.Timestamp start_time = 1;
    // When the gh-ost migration ended.
    google.protobuf.Timestamp end_time = 2;
    // Error message if the gh-ost migration failed.
    string error = 3;
    // The cleaned ALTER statement passed to gh-ost.
    string statement = 4;
  }
  • Step 5: Format and generate proto artifacts

Run:

buf format -w proto
buf lint proto
cd proto && buf generate

Expected: all commands exit 0. Generated Go, frontend ES types, grpc-doc, OpenAPI, and MCP OpenAPI files update.

  • Step 6: Implement API conversion

In backend/api/v1/rollout_service_converter.go, extend convertToTaskRunLogEntries with these switch cases before default:

		case storepb.TaskRunLog_GHOST_MIGRATION_START:
			entries = append(entries, &v1pb.TaskRunLogEntry{
				Type:      v1pb.TaskRunLogEntry_GHOST_MIGRATION,
				LogTime:   timestamppb.New(l.T),
				ReplicaId: l.Payload.ReplicaId,
				GhostMigration: &v1pb.TaskRunLogEntry_GhostMigration{
					StartTime: timestamppb.New(l.T),
					Statement: l.Payload.GhostMigrationStart.Statement,
				},
			})

		case storepb.TaskRunLog_GHOST_MIGRATION_END:
			if len(entries) == 0 {
				continue
			}
			prev := entries[len(entries)-1]
			if prev == nil || prev.Type != v1pb.TaskRunLogEntry_GHOST_MIGRATION {
				continue
			}
			prev.GhostMigration.EndTime = timestamppb.New(l.T)
			prev.GhostMigration.Error = l.Payload.GhostMigrationEnd.Error
  • Step 7: Run converter test

Run:

go test -v -count=1 ./backend/api/v1 -run ^TestConvertToTaskRunLogEntries_GhostMigration$

Expected: PASS.

  • Step 8: Commit proto and converter slice

Run:

git add proto/store/store/task_run_log.proto proto/v1/v1/rollout_service.proto backend/generated-go proto/gen/grpc-doc backend/api/mcp/gen/openapi.yaml frontend/src/types/proto-es/v1/rollout_service_pb.d.ts frontend/src/types/proto-es/v1/rollout_service_pb.js backend/api/v1/rollout_service_converter.go backend/api/v1/rollout_service_converter_test.go
git commit -m "feat: add gh-ost task run log type"

Expected: commit succeeds.

Task 2: Backend gh-ost Log Emission

Files:

  • Modify: backend/plugin/db/driver.go

  • Modify: backend/runner/taskrun/database_migrate_executor.go

  • Modify: backend/tests/rollout.go

  • Modify: backend/tests/ghost_test.go

  • Step 1: Add rollout-returning test helper

In backend/tests/rollout.go, change changeDatabase to call a new helper:

func (ctl *controller) changeDatabase(ctx context.Context, project *v1pb.Project, database *v1pb.Database, sheet *v1pb.Sheet, _ bool) error {
	_, err := ctl.changeDatabaseAndReturnRollout(ctx, project, database, sheet)
	return err
}

func (ctl *controller) changeDatabaseAndReturnRollout(ctx context.Context, project *v1pb.Project, database *v1pb.Database, sheet *v1pb.Sheet) (*v1pb.Rollout, error) {
	spec := &v1pb.Plan_Spec{
		Id: uuid.NewString(),
		Config: &v1pb.Plan_Spec_ChangeDatabaseConfig{
			ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{
				Targets: []string{database.Name},
				Sheet:   sheet.Name,
			},
		},
	}
	return ctl.changeDatabaseWithConfigAndReturnRollout(ctx, project, spec)
}

Then change changeDatabaseWithConfig to call a new helper:

func (ctl *controller) changeDatabaseWithConfig(ctx context.Context, project *v1pb.Project, spec *v1pb.Plan_Spec) error {
	_, err := ctl.changeDatabaseWithConfigAndReturnRollout(ctx, project, spec)
	return err
}

Move the existing body of changeDatabaseWithConfig into:

func (ctl *controller) changeDatabaseWithConfigAndReturnRollout(ctx context.Context, project *v1pb.Project, spec *v1pb.Plan_Spec) (*v1pb.Rollout, error) {
	planResp, err := ctl.planServiceClient.CreatePlan(ctx, connect.NewRequest(&v1pb.CreatePlanRequest{
		Parent: project.Name,
		Plan: &v1pb.Plan{
			Specs: []*v1pb.Plan_Spec{spec},
		},
	}))
	if err != nil {
		return nil, errors.Wrapf(err, "failed to create plan")
	}
	plan := planResp.Msg
	issueResp, err := ctl.issueServiceClient.CreateIssue(ctx, connect.NewRequest(&v1pb.CreateIssueRequest{
		Parent: project.Name,
		Issue: &v1pb.Issue{
			Type:        v1pb.Issue_DATABASE_CHANGE,
			Title:       "change database",
			Description: "change database",
			Plan:        plan.Name,
		},
	}))
	if err != nil {
		return nil, errors.Wrapf(err, "failed to create issue")
	}
	issue := issueResp.Msg
	rolloutResp, err := ctl.rolloutServiceClient.CreateRollout(ctx, connect.NewRequest(&v1pb.CreateRolloutRequest{Parent: plan.Name}))
	if err != nil {
		return nil, errors.Wrapf(err, "failed to create rollout")
	}
	rollout := rolloutResp.Msg
	if err := ctl.waitRollout(ctx, issue.Name, rollout.Name); err != nil {
		return nil, err
	}
	return rollout, nil
}
  • Step 2: Write the failing integration assertion

In backend/tests/ghost_test.go, replace the second migration run:

	err = ctl.changeDatabase(ctx, ctl.project, database, sheet2, true)
	a.NoError(err)

with:

	rollout, err := ctl.changeDatabaseAndReturnRollout(ctx, ctl.project, database, sheet2)
	a.NoError(err)

After the existing a.Equal(wantDBSchema2, dbMetadata.Schema), add:

	var taskRunName string
	for _, stage := range rollout.Stages {
		for _, task := range stage.Tasks {
			taskRunsResp, err := ctl.rolloutServiceClient.ListTaskRuns(ctx, connect.NewRequest(&v1pb.ListTaskRunsRequest{
				Parent: task.Name,
			}))
			a.NoError(err)
			if len(taskRunsResp.Msg.TaskRuns) > 0 {
				taskRunName = taskRunsResp.Msg.TaskRuns[0].Name
			}
		}
	}
	a.NotEmpty(taskRunName)

	logResp, err := ctl.rolloutServiceClient.GetTaskRunLog(ctx, connect.NewRequest(&v1pb.GetTaskRunLogRequest{
		Parent: taskRunName,
	}))
	a.NoError(err)

	var ghostEntry *v1pb.TaskRunLogEntry
	var databaseSyncEntry *v1pb.TaskRunLogEntry
	for _, entry := range logResp.Msg.Entries {
		switch entry.Type {
		case v1pb.TaskRunLogEntry_GHOST_MIGRATION:
			ghostEntry = entry
		case v1pb.TaskRunLogEntry_DATABASE_SYNC:
			databaseSyncEntry = entry
		default:
		}
	}
	a.NotNil(ghostEntry)
	a.NotNil(ghostEntry.GetGhostMigration())
	a.Contains(ghostEntry.GetGhostMigration().Statement, "ALTER TABLE book ADD author VARCHAR(54)")
	a.NotNil(ghostEntry.GetGhostMigration().StartTime)
	a.NotNil(ghostEntry.GetGhostMigration().EndTime)
	a.Empty(ghostEntry.GetGhostMigration().Error)
	a.NotNil(databaseSyncEntry)
  • Step 3: Run integration test to verify it fails

Run:

go test -v -count=1 ./backend/tests -run ^TestGhostSchemaUpdate$ -timeout 5m

Expected: FAIL because no GHOST_MIGRATION entry is emitted.

  • Step 4: Add gh-ost logging helpers

In backend/plugin/db/driver.go, add methods after LogCommandResponse:

func (o *ExecuteOptions) LogGhostMigrationStart(statement string) {
	if o == nil || o.CreateTaskRunLog == nil {
		return
	}
	err := o.CreateTaskRunLog(time.Now(), &storepb.TaskRunLog{
		Type: storepb.TaskRunLog_GHOST_MIGRATION_START,
		GhostMigrationStart: &storepb.TaskRunLog_GhostMigrationStart{
			Statement: statement,
		},
	})
	if err != nil {
		slog.Warn("failed to log gh-ost migration start", log.BBError(err))
	}
}

func (o *ExecuteOptions) LogGhostMigrationEnd(rerr string) {
	if o == nil || o.CreateTaskRunLog == nil {
		return
	}
	err := o.CreateTaskRunLog(time.Now(), &storepb.TaskRunLog{
		Type: storepb.TaskRunLog_GHOST_MIGRATION_END,
		GhostMigrationEnd: &storepb.TaskRunLog_GhostMigrationEnd{
			Error: rerr,
		},
	})
	if err != nil {
		slog.Warn("failed to log gh-ost migration end", log.BBError(err))
	}
}
  • Step 5: Emit gh-ost logs from executor

Change the executeGhostMigration signature in backend/runner/taskrun/database_migrate_executor.go:

func executeGhostMigration(ctx context.Context, driverCtx context.Context, task *store.TaskMessage, sheet *store.SheetMessage, instance *store.InstanceMessage, database *store.DatabaseMessage, driver db.Driver, opts *db.ExecuteOptions) error {

After migrator := logic.NewMigrator(migrationContext, "bb"), add:

	opts.LogGhostMigrationStart(statement)

Change the select block:

	select {
	case err := <-migrationError:
		if err != nil {
			opts.LogGhostMigrationEnd(err.Error())
			return err
		}
		opts.LogGhostMigrationEnd("")
		return nil
	case <-driverCtx.Done():
		err := errors.New("task canceled")
		migrationContext.PanicAbort <- err
		opts.LogGhostMigrationEnd(err.Error())
		return err
	}

Update all call sites:

migrationErr := executeGhostMigration(ctx, driverCtx, task, sheet, instance, database, driver, &opts)

and:

err = executeGhostMigration(ctx, driverCtx, task, sheet, instance, database, driver, &opts)
  • Step 6: Format Go files

Run:

gofmt -w backend/plugin/db/driver.go backend/runner/taskrun/database_migrate_executor.go backend/tests/rollout.go backend/tests/ghost_test.go backend/api/v1/rollout_service_converter_test.go

Expected: command exits 0.

  • Step 7: Run backend tests

Run:

go test -v -count=1 ./backend/api/v1 -run ^TestConvertToTaskRunLogEntries_GhostMigration$
go test -v -count=1 ./backend/tests -run ^TestGhostSchemaUpdate$ -timeout 5m

Expected: both PASS.

  • Step 8: Commit backend emission slice

Run:

git add backend/plugin/db/driver.go backend/runner/taskrun/database_migrate_executor.go backend/tests/rollout.go backend/tests/ghost_test.go
git commit -m "feat: emit gh-ost task run logs"

Expected: commit succeeds.

Task 3: Frontend Task-Run Log Display

Files:

  • Modify: frontend/src/react/components/task-run-log/model.ts

  • Modify: frontend/src/react/components/task-run-log/model.test.ts

  • Modify: frontend/src/react/components/task-run-log/TaskRunLogViewer.tsx

  • Modify locale files listed in the File Map.

  • Step 1: Write failing model test

In frontend/src/react/components/task-run-log/model.test.ts, add this test after marks incomplete sections as running and errored sections as error:

  test("renders gh-ost migration as a timed section", () => {
    const detailText = {
      completed: "Completed",
    } satisfies TaskRunLogDetailText;

    const entries = [
      create(TaskRunLogEntrySchema, {
        type: TaskRunLogEntry_Type.GHOST_MIGRATION,
        logTime: ts(10),
        ghostMigration: {
          statement: "ALTER TABLE book ADD COLUMN author VARCHAR(54)",
          startTime: ts(10),
          endTime: ts(13),
          error: "",
        },
      }),
      create(TaskRunLogEntrySchema, {
        type: TaskRunLogEntry_Type.GHOST_MIGRATION,
        logTime: ts(20),
        ghostMigration: {
          statement: "ALTER TABLE book ADD COLUMN title VARCHAR(54)",
          startTime: ts(20),
          error: "copy failed",
        },
      }),
    ];

    const sections = buildSectionsFromEntries(entries, {
      getSectionLabel: (type) => String(type),
      detailText,
    });

    expect(sections[0]?.status).toBe("success");
    expect(sections[0]?.duration).toBe("3.0s");
    expect(sections[0]?.items[0]?.detail).toBe("Completed");
    expect(sections[1]?.status).toBe("error");
    expect(sections[1]?.items[0]?.detail).toBe("copy failed");
  });
  • Step 2: Run frontend test to verify it fails

Run:

pnpm --dir frontend test -- task-run-log/model.test.ts

Expected: FAIL because the frontend model does not handle GHOST_MIGRATION as a timed entry yet.

  • Step 3: Update task-run log model

In frontend/src/react/components/task-run-log/model.ts, add GHOST_MIGRATION to these switch statements.

In hasError:

    case TaskRunLogEntry_Type.GHOST_MIGRATION:
      return Boolean(entry.ghostMigration?.error);

In isComplete:

    case TaskRunLogEntry_Type.GHOST_MIGRATION:
      return Boolean(
        entry.ghostMigration?.startTime && entry.ghostMigration?.endTime
      );

In getEntryTimeRange:

    case TaskRunLogEntry_Type.GHOST_MIGRATION:
      return {
        start: getTimestampMs(entry.ghostMigration?.startTime),
        end: getTimestampMs(entry.ghostMigration?.endTime),
      };

In getEntryDetail:

    case TaskRunLogEntry_Type.GHOST_MIGRATION:
      return getTimedEntryDetail(
        entry.ghostMigration,
        runningByType?.[TaskRunLogEntry_Type.GHOST_MIGRATION] ?? "",
        completed
      );
  • Step 4: Add UI label

In frontend/src/react/components/task-run-log/TaskRunLogViewer.tsx, add to labelMap:

        [TaskRunLogEntry_Type.GHOST_MIGRATION]: t(
          "task-run.log-type.ghost-migration"
        ),

Do not add a gh-ost-specific running detail for the first pass.

  • Step 5: Add locale strings

Add task-run.log-type.ghost-migration to React flat locale files with these exact values:

"frontend/src/react/locales/en-US.json": "gh-ost migration"
"frontend/src/react/locales/zh-CN.json": "gh-ost 迁移"
"frontend/src/react/locales/ja-JP.json": "gh-ost migration"
"frontend/src/react/locales/es-ES.json": "Migración gh-ost"
"frontend/src/react/locales/vi-VN.json": "Di chuyển gh-ost"

For example, in frontend/src/react/locales/en-US.json, add:

"task-run.log-type.ghost-migration": "gh-ost migration"

In frontend/src/react/locales/zh-CN.json, add:

"task-run.log-type.ghost-migration": "gh-ost 迁移"

In frontend/src/react/locales/ja-JP.json, add:

"task-run.log-type.ghost-migration": "gh-ost migration"

In frontend/src/react/locales/es-ES.json, add:

"task-run.log-type.ghost-migration": "Migración gh-ost"

In frontend/src/react/locales/vi-VN.json, add:

"task-run.log-type.ghost-migration": "Di chuyển gh-ost"

Add nested locale keys under task-run.log-type in frontend/src/locales/*.json with these exact values:

"frontend/src/locales/en-US.json": "gh-ost migration"
"frontend/src/locales/zh-CN.json": "gh-ost 迁移"
"frontend/src/locales/ja-JP.json": "gh-ost migration"
"frontend/src/locales/es-ES.json": "Migración gh-ost"
"frontend/src/locales/vi-VN.json": "Di chuyển gh-ost"

In frontend/src/locales/en-US.json, add under task-run.log-type:

"ghost-migration": "gh-ost migration"

In frontend/src/locales/zh-CN.json, add under task-run.log-type:

"ghost-migration": "gh-ost 迁移"

In frontend/src/locales/ja-JP.json, add under task-run.log-type:

"ghost-migration": "gh-ost migration"

In frontend/src/locales/es-ES.json, add under task-run.log-type:

"ghost-migration": "Migración gh-ost"

In frontend/src/locales/vi-VN.json, add under task-run.log-type:

"ghost-migration": "Di chuyển gh-ost"
  • Step 6: Run frontend fix and tests

Run:

pnpm --dir frontend fix
pnpm --dir frontend test -- task-run-log/model.test.ts

Expected: both commands exit 0.

  • Step 7: Commit frontend display slice

Run:

git add frontend/src/react/components/task-run-log/model.ts frontend/src/react/components/task-run-log/model.test.ts frontend/src/react/components/task-run-log/TaskRunLogViewer.tsx frontend/src/react/locales frontend/src/locales
git commit -m "feat: show gh-ost task run log section"

Expected: commit succeeds.

Task 4: Verification and Cleanup

Files:

  • Read: git status --short

  • Read: git diff --stat

  • Step 1: Run proto checks

Run:

buf format -w proto
buf lint proto
cd proto && buf generate

Expected: all commands exit 0 and no new unexpected generated diff appears beyond already intended generated artifacts.

  • Step 2: Run Go formatting and targeted tests

Run:

gofmt -w backend/api/v1/rollout_service_converter.go backend/api/v1/rollout_service_converter_test.go backend/plugin/db/driver.go backend/runner/taskrun/database_migrate_executor.go backend/tests/rollout.go backend/tests/ghost_test.go
go test -v -count=1 ./backend/api/v1 -run ^TestConvertToTaskRunLogEntries_GhostMigration$
go test -v -count=1 ./backend/tests -run ^TestGhostSchemaUpdate$ -timeout 5m

Expected: all commands exit 0.

  • Step 3: Run frontend validation

Run:

pnpm --dir frontend fix
pnpm --dir frontend check
pnpm --dir frontend type-check
pnpm --dir frontend test -- task-run-log/model.test.ts

Expected: all commands exit 0.

  • Step 4: Run Go lint

Run:

golangci-lint run --allow-parallel-runners

Expected: exits 0. If it reports issues, run:

golangci-lint run --fix --allow-parallel-runners
golangci-lint run --allow-parallel-runners

Repeat until the non-fix lint command exits 0.

  • Step 5: Run backend build

Run:

go build -ldflags "-w -s" -p=16 -o ./bytebase-build/bytebase ./backend/bin/server/main.go

Expected: build exits 0.

  • Step 6: Inspect final diff

Run:

git status --short
git diff --stat

Expected: only files related to gh-ost task run logs are modified.