Skip to content

Commit

Permalink
NOREF: CR and TDL table name constants (#917)
Browse files Browse the repository at this point in the history
feat: add CR and TDL table name constants, remove plan_cr_tdl reference
  • Loading branch information
StevenWadeOddball authored Jan 25, 2024
1 parent 1f2be4c commit 5599d69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 4 additions & 2 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const (
PlanBasics = "plan_basics"
OperationalSolutionSubtask = "operational_solution_subtask"
ModelPlan = "model_plan"
PlanCrTdl = "plan_cr_tdl"
PlanCr = "plan_cr"
PlanTdl = "plan_tdl"
)

// Constants for humanized table names
Expand All @@ -47,7 +48,8 @@ var humanizedTableNames = map[string]string{
PlanBasics: "Model Basics",
OperationalSolutionSubtask: "Operational Solution Subtask",
ModelPlan: "Model",
PlanCrTdl: "CR/TDL",
PlanCr: "CR",
PlanTdl: "TDL",
}

// GetHumanizedTableName returns the humanized name for the given table name
Expand Down
5 changes: 2 additions & 3 deletions pkg/worker/analyzed_audit_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,8 @@ func analyzeModelPlanAudits(audits []*models.AuditChange) (*models.AnalyzedModel
// analyzeCrTdlAudits analyzes if there were any CrTdl changes
func analyzeCrTdlAudits(audits []*models.AuditChange) (*models.AnalyzedCrTdls, error) {
filteredAudits := lo.Filter(audits, func(m *models.AuditChange, index int) bool {
return m.TableName == "plan_cr_tdl" || m.TableName == "plan_tdl" || m.TableName == "plan_cr"
}) // Note, plan_cr_tdl no longer exists, as it was renames to crs and a tdls table was created. the legacy audit changes still exist in that table
// TODO: after this has been deployed for a day, we should be able to remove the table name comparison to plan_cr_tdl
return m.TableName == "plan_tdl" || m.TableName == "plan_cr"
})

if len(filteredAudits) > 0 {
return &models.AnalyzedCrTdls{
Expand Down

0 comments on commit 5599d69

Please sign in to comment.