Fix PR review comments on cookie banner branding

- Add scope parameter to UpdateShowBranding to prevent cross-tenant updates
- Use cmd.Context() instead of context.Background() in proboctl CLI
- Drop SQL column default after backfill in migration
- Add bounds check for int-to-int32 conversion in PG_POOL_SIZE
- Update branding link to getprobo.com homepage

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-22 15:02:59 +04:00
parent b1607d76c5
commit d71915abd4
6 changed files with 18 additions and 7 deletions

View File

@@ -15,7 +15,6 @@
package cookiebanner
import (
"context"
"fmt"
"strconv"
@@ -61,7 +60,7 @@ func newCmdSetBranding(newPG pgClientFactory) *cobra.Command {
defer pgClient.Close()
svc := cookiebanner.NewService(pgClient)
if err := svc.SetShowBranding(context.Background(), bannerID, show); err != nil {
if err := svc.SetShowBranding(cmd.Context(), bannerID, show); err != nil {
return err
}

View File

@@ -16,6 +16,7 @@ package proboctl
import (
"fmt"
"math"
"os"
"strconv"
@@ -72,6 +73,9 @@ func newPGClient(flagDSN string) (*pg.Client, error) {
}
poolSize := envIntOrDefault("PG_POOL_SIZE", 2)
if poolSize < 0 || poolSize > math.MaxInt32 {
return nil, fmt.Errorf("PG_POOL_SIZE %d out of range", poolSize)
}
opts := []pg.Option{
pg.WithAddr(addr),