fix: better error on deprecated endpoints (#2763)

This commit is contained in:
abelanger5
2026-01-08 11:32:14 -05:00
committed by GitHub
parent 3bd605d4ed
commit 32188b5a85
3 changed files with 8 additions and 5 deletions
+6 -3
View File
@@ -335,7 +335,8 @@ func (t *APIServer) registerSpec(g *echo.Group, spec *openapi3.T) (*populator.Po
})
populatorMW.RegisterGetter("workflow-run", func(config *server.ServerConfig, parentId, id string) (result interface{}, uniqueParentId string, err error) {
return nil, "", fmt.Errorf("deprecated: use 'v1-workflow-run' getter with parent tenant id")
config.Logger.Error().Msgf("deprecated call to workflow-run with parent id %s and id %s: use 'v1-workflow-run' getter with parent tenant id", parentId, id)
return nil, "", echo.NewHTTPError(http.StatusBadRequest, "This endpoint is deprecated.")
})
populatorMW.RegisterGetter("scheduled-workflow-run", func(config *server.ServerConfig, parentId, id string) (result interface{}, uniqueParentId string, err error) {
@@ -367,7 +368,8 @@ func (t *APIServer) registerSpec(g *echo.Group, spec *openapi3.T) (*populator.Po
})
populatorMW.RegisterGetter("step-run", func(config *server.ServerConfig, parentId, id string) (result interface{}, uniqueParentId string, err error) {
return nil, "", fmt.Errorf("deprecated: use 'v1-task' getter with parent tenant id")
config.Logger.Error().Msgf("deprecated call to step-run with parent id %s and id %s: use 'v1-task' getter with parent tenant id", parentId, id)
return nil, "", echo.NewHTTPError(http.StatusBadRequest, "This endpoint is deprecated.")
})
populatorMW.RegisterGetter("event", func(config *server.ServerConfig, parentId, id string) (result interface{}, uniqueParentId string, err error) {
@@ -432,7 +434,8 @@ func (t *APIServer) registerSpec(g *echo.Group, spec *openapi3.T) (*populator.Po
})
populatorMW.RegisterGetter("webhook", func(config *server.ServerConfig, parentId, id string) (result interface{}, uniqueParentId string, err error) {
return nil, "", fmt.Errorf("deprecated: do not use")
config.Logger.Error().Msgf("deprecated call to webhook with parent id %s and id %s: do not use", parentId, id)
return nil, "", echo.NewHTTPError(http.StatusBadRequest, "This endpoint is deprecated.")
})
populatorMW.RegisterGetter("task", func(config *server.ServerConfig, parentId, id string) (result interface{}, uniqueParentId string, err error) {
+1 -1
View File
@@ -398,7 +398,7 @@ func (r *OLAPRepositoryImpl) UpdateTablePartitions(ctx context.Context) error {
}
for _, partition := range partitions {
r.l.Warn().Msgf("detaching partition %s", partition.PartitionName)
r.l.Debug().Msgf("detaching partition %s", partition.PartitionName)
conn, release, err := sqlchelpers.AcquireConnectionWithStatementTimeout(ctx, r.pool, r.l, 30*60*1000) // 30 minutes
+1 -1
View File
@@ -352,7 +352,7 @@ func (r *TaskRepositoryImpl) UpdateTablePartitions(ctx context.Context) error {
}
for _, partition := range partitions {
r.l.Warn().Msgf("detaching partition %s", partition.PartitionName)
r.l.Debug().Msgf("detaching partition %s", partition.PartitionName)
conn, release, err := sqlchelpers.AcquireConnectionWithStatementTimeout(ctx, r.pool, r.l, 30*60*1000) // 30 minutes