Skip to content

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

chore: remove stage.Active (#8036)

p0ny1c9deb5f1c9a
diff --git a/backend/runner/approval/runner.go b/backend/runner/approval/runner.go
index a86b082604..223129d5d1 100644
--- a/backend/runner/approval/runner.go
+++ b/backend/runner/approval/runner.go
@@ -459,7 +459,6 @@ func getDatabaseGeneralIssueRisk(ctx context.Context, s *store.Store, licenseSer
if err != nil {
return 0, err
}
- // TODO(p0ny): implement sql type and affected rows
args := map[string]any{
"environment_id": environmentID,
"project_id": issue.Project.ResourceID,
diff --git a/backend/server/webhook.go b/backend/server/webhook.go
index 38abc05323..5fd0f96e16 100644
--- a/backend/server/webhook.go
+++ b/backend/server/webhook.go
@@ -2068,7 +2068,6 @@ func (s *Server) prepareIssueFromFile(
}
func (s *Server) tryUpdateTasksFromModifiedFile(ctx context.Context, databases []*store.DatabaseMessage, fileName, schemaVersion, statement string, pushEvent vcs.PushEvent) error {
- // TODO(p0ny): sheet, create new sheets and update task sheet id.
// For modified files, we try to update the existing issue's statement.
for _, database := range databases {
taskList, err := s.store.ListTasks(ctx, &api.TaskFind{
diff --git a/backend/store/stage.go b/backend/store/stage.go
index a6f94675b8..b193e0c120 100644
--- a/backend/store/stage.go
+++ b/backend/store/stage.go
@@ -14,10 +14,6 @@ type StageMessage struct {
PipelineID int
TaskList []*TaskMessage
- // Active is true if not all tasks are done within the stage.
- // Deprecated: deprecated in favor of TaskSchedulerV2, should be removed after we switch over.
- // TODO(p0ny): remove
- Active bool
// Output only.
ID int
@@ -113,8 +109,7 @@ func (s *Store) ListStageV2(ctx context.Context, pipelineUID int) ([]*StageMessa
stage.id,
stage.pipeline_id,
stage.environment_id,
- stage.name,
- (SELECT COUNT(1) > 0 FROM task WHERE task.pipeline_id = stage.pipeline_id AND task.stage_id <= stage.id AND task.status != 'DONE')
+ stage.name
FROM stage
WHERE %s ORDER BY id ASC`, strings.Join(where, " AND ")),
args...,
@@ -132,7 +127,6 @@ func (s *Store) ListStageV2(ctx context.Context, pipelineUID int) ([]*StageMessa
&stage.PipelineID,
&stage.EnvironmentID,
&stage.Name,
- &stage.Active,
); err != nil {
return nil, err
}
diff --git a/backend/utils/utils.go b/backend/utils/utils.go
index c54c5e9e66..8b4cd6e393 100644
--- a/backend/utils/utils.go
+++ b/backend/utils/utils.go
@@ -223,16 +223,6 @@ func NewMigrationContext(config GhostConfig) (*base.MigrationContext, error) {
return migrationContext, nil
}
-// GetActiveStage returns the first active stage among all stages.
-func GetActiveStage(stages []*store.StageMessage) *store.StageMessage {
- for _, stage := range stages {
- if stage.Active {
- return stage
- }
- }
- return nil
-}
-
// isMatchExpression checks whether a databases matches the query.
// labels is a mapping from database label key to value.
func isMatchExpression(labels map[string]string, expression *api.LabelSelectorRequirement) bool {