Skip to content

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

fix typo (#48)

p0ny6eb56025694d
diff --git a/server/instance.go b/server/instance.go
index ac187adb9c..6ce43bb372 100644
--- a/server/instance.go
+++ b/server/instance.go
@@ -38,7 +38,7 @@ func (s *Server) registerInstanceRoutes(g *echo.Group) {
// Try creating the "bytebase" db in the added instance if needed.
// Since we allow user to add new instance upfront even providing the incorrect username/password,
- // thus it's OK if it fails. Frontend will surface relavant info suggesting the "bytebase" db hasn't created yet.
+ // thus it's OK if it fails. Frontend will surface relevant info suggesting the "bytebase" db hasn't created yet.
db, err := GetDatabaseDriver(ctx, instance, "", s.l)
if err == nil {
defer db.Close(ctx)
@@ -300,7 +300,7 @@ func (s *Server) registerInstanceRoutes(g *echo.Group) {
ctx := context.Background()
id, err := strconv.Atoi(c.Param("instanceID"))
if err != nil {
- return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Intance ID is not a number: %s", c.Param("instanceID"))).SetInternal(err)
+ return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Instance ID is not a number: %s", c.Param("instanceID"))).SetInternal(err)
}
historyID, err := strconv.Atoi(c.Param("historyID"))
diff --git a/server/server.go b/server/server.go
index f60135355c..a357fa43fc 100644
--- a/server/server.go
+++ b/server/server.go
@@ -93,7 +93,7 @@ func NewServer(logger *zap.Logger, version string, host string, port int, fronte
e.HideBanner = true
e.HidePort = true
- // Disallow to be embeded in an iframe
+ // Disallow to be embedded in an iframe
e.Use(middleware.SecureWithConfig(middleware.SecureConfig{
XFrameOptions: "DENY",
}))
diff --git a/server/task.go b/server/task.go
index 84d6881063..6125701f8d 100644
--- a/server/task.go
+++ b/server/task.go
@@ -61,7 +61,7 @@ func (s *Server) registerTaskRoutes(g *echo.Group) {
if task.Type == api.TaskDatabaseSchemaUpdate {
payload := &api.TaskDatabaseSchemaUpdatePayload{}
if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {
- return echo.NewHTTPError(http.StatusBadRequest, "Malformatted database schema udpate payload").SetInternal(err)
+ return echo.NewHTTPError(http.StatusBadRequest, "Malformatted database schema update payload").SetInternal(err)
}
payload.Statement = *taskPatch.Statement
bytes, err := json.Marshal(payload)
diff --git a/server/task_scheduler.go b/server/task_scheduler.go
index c85f53daa8..350271365d 100644
--- a/server/task_scheduler.go
+++ b/server/task_scheduler.go
@@ -281,7 +281,7 @@ func (s *TaskScheduler) ScheduleIfNeeded(ctx context.Context, task *api.Task) (*
return updatedTask, nil
}
-// Returns true only if there is NO warning and error. User can still manualy run the task if there is warning.
+// Returns true only if there is NO warning and error. User can still manually run the task if there is warning.
// But this method is used for gating the automatic run, so we are more cautious here.
func passCheck(ctx context.Context, server *Server, task *api.Task, checkType api.TaskCheckType) (bool, error) {
statusList := []api.TaskCheckRunStatus{api.TaskCheckRunDone, api.TaskCheckRunFailed}
diff --git a/server/webhook.go b/server/webhook.go
index e13ae59d27..7f454e4c9a 100644
--- a/server/webhook.go
+++ b/server/webhook.go
@@ -197,20 +197,20 @@ func (s *Server) registerWebhookRoutes(g *echo.Group) {
// to identify ambiguity.
// Further filter by environment name if applicable.
- filterdDatabaseList := []*api.Database{}
+ filteredDatabaseList := []*api.Database{}
if mi.Environment != "" {
for _, database := range databaseList {
// Environment name comparision is case insensitive
if strings.EqualFold(database.Instance.Environment.Name, mi.Environment) {
- filterdDatabaseList = append(filterdDatabaseList, database)
+ filteredDatabaseList = append(filteredDatabaseList, database)
}
}
- if len(filterdDatabaseList) == 0 {
+ if len(filteredDatabaseList) == 0 {
createIgnoredFileActivity(fmt.Errorf("project does not contain committed file database %q for environment %q", mi.Database, mi.Environment))
continue
}
} else {
- filterdDatabaseList = databaseList
+ filteredDatabaseList = databaseList
}
var pipelineApprovalByEnv = map[int]api.PipelineApprovalValue{}
@@ -218,7 +218,7 @@ func (s *Server) registerWebhookRoutes(g *echo.Group) {
// It could happen that for a particular environment a project contain 2 database with the same name.
// We will emit warning in this case.
var databaseListByEnv = map[int][]*api.Database{}
- for _, database := range filterdDatabaseList {
+ for _, database := range filteredDatabaseList {
list, ok := databaseListByEnv[database.Instance.EnvironmentID]
if ok {
databaseListByEnv[database.Instance.EnvironmentID] = append(list, database)
@@ -239,11 +239,11 @@ func (s *Server) registerWebhookRoutes(g *echo.Group) {
}
var multipleDatabaseForSameEnv = false
- for environemntID, databaseList := range databaseListByEnv {
+ for environmentID, databaseList := range databaseListByEnv {
if len(databaseList) > 1 {
multipleDatabaseForSameEnv = true
- s.l.Warn(fmt.Sprintf("Ignored committed file, multiple ambiguous databases named %q for environment %d.", mi.Database, environemntID),
+ s.l.Warn(fmt.Sprintf("Ignored committed file, multiple ambiguous databases named %q for environment %d.", mi.Database, environmentID),
zap.Int("project_id", repository.ProjectID),
zap.String("file", added),
)
@@ -257,7 +257,7 @@ func (s *Server) registerWebhookRoutes(g *echo.Group) {
// Compose the new issue
stageList := []api.StageCreate{}
- for _, database := range filterdDatabaseList {
+ for _, database := range filteredDatabaseList {
databaseID := database.ID
taskStatus := api.TaskPendingApproval
if pipelineApprovalByEnv[database.Instance.Environment.ID] == api.PipelineApprovalValueManualNever {
@@ -301,7 +301,7 @@ func (s *Server) registerWebhookRoutes(g *echo.Group) {
createdMessageList = append(createdMessageList, fmt.Sprintf("Created issue %q on adding %s", issue.Name, added))
- // Create a project activity after sucessfully creating the issue as the result of the push event
+ // Create a project activity after successfully creating the issue as the result of the push event
{
bytes, err := json.Marshal(api.ActivityProjectRepositoryPushPayload{
VCSPushEvent: vcsPushEvent,