Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
4f0e7de
chore(deps): bump golang.org/x/oauth2 from 0.26.0 to 0.27.0 (#3203)
dependabot[bot] Feb 25, 2025
d958f7d
chore(deps): bump supabase/realtime from v2.34.31 to v2.34.33 in /pkg…
dependabot[bot] Feb 25, 2025
460ee25
chore(deps): bump supabase/supavisor from 2.3.9 to 2.3.10 in /pkg/con…
dependabot[bot] Feb 25, 2025
bff16cc
chore(deps): bump supabase/supavisor from 2.3.10 to 2.4.2 in /pkg/con…
dependabot[bot] Feb 26, 2025
6ccc4fd
chore(deps): bump supabase/realtime from v2.34.33 to v2.34.34 in /pkg…
dependabot[bot] Feb 26, 2025
a1aab11
fix: append config.toml when creating new function (#3212)
sweatybridge Feb 26, 2025
6e53df9
chore(deps): bump supabase/postgres from 15.8.1.044 to 15.8.1.045 in …
dependabot[bot] Feb 27, 2025
5590736
fix: output standard env vars from branches get
sweatybridge Feb 27, 2025
34e02d5
fix: filters should break to outer loop
sweatybridge Feb 27, 2025
e7e1126
chore: update unit tests
sweatybridge Feb 27, 2025
aacc914
fix: accept both branch ID and name
sweatybridge Feb 27, 2025
277f377
fix: support env output by default
sweatybridge Feb 27, 2025
32064ab
chore: dudupe output flag for gen keys
sweatybridge Feb 27, 2025
d3a60d1
fix: add pooler to start test (#3223)
sweatybridge Feb 27, 2025
37ebd41
fix: eliminate link warning on additional url (#3222)
sweatybridge Feb 27, 2025
df81dd6
fix: drop public views explicitly
jgoux Feb 27, 2025
8e04aef
handle materialized views as well
jgoux Feb 27, 2025
fe77207
fix: drop public views explicitly (#3224)
jgoux Feb 27, 2025
08dc55d
chore(deps): bump github.com/go-git/go-git/v5 from 5.13.2 to 5.14.0 (…
dependabot[bot] Feb 28, 2025
f35d660
chore(deps): bump supabase/realtime from v2.34.34 to v2.34.37 in /pkg…
dependabot[bot] Feb 28, 2025
074079e
chore(deps): bump supabase/postgres from 15.8.1.045 to 15.8.1.046 in …
dependabot[bot] Feb 28, 2025
9ce71ee
fix: remove dependency on global viper
sweatybridge Feb 28, 2025
bb8f041
chore: parse private keys when instantiating hook
sweatybridge Feb 28, 2025
3790739
fix: set openai api key as secret
sweatybridge Feb 28, 2025
7c0adfe
chore(deps): bump github.com/golangci/golangci-lint from 1.64.5 to 1.…
dependabot[bot] Mar 3, 2025
36d9512
chore(deps): bump supabase/postgres from 15.8.1.046 to 15.8.1.047 in …
dependabot[bot] Mar 3, 2025
50d2230
chore(deps): bump supabase/realtime from v2.34.37 to v2.34.39 in /pkg…
dependabot[bot] Mar 3, 2025
7a7abed
feat(config): add rate limit configuration for emails in toml (#3206)
avallete Mar 3, 2025
c84582c
feat: add mailpit image (#3121)
silentworks Mar 3, 2025
d0c0076
chore: remove unnecessary volume mount
sweatybridge Mar 3, 2025
ef7ed65
chore(deps): bump supabase/logflare from 1.11.0 to 1.12.0 in /pkg/con…
dependabot[bot] Mar 3, 2025
0ec16b8
chore(deps): bump github.com/docker/cli from 27.5.1+incompatible to 2…
dependabot[bot] Mar 3, 2025
22e97a1
fix: update docker client version
sweatybridge Mar 3, 2025
8256c57
chore(deps): bump github.com/containers/common from 0.62.0 to 0.62.1 …
dependabot[bot] Mar 4, 2025
b4794cb
chore(deps): bump google.golang.org/grpc from 1.70.0 to 1.71.0 (#3249)
dependabot[bot] Mar 5, 2025
eab3af8
chore(deps): bump supabase/supavisor from 2.3.10 to 2.4.6 in /pkg/con…
dependabot[bot] Mar 5, 2025
266ec80
chore(deps): bump supabase/postgres-meta from v0.86.0 to v0.86.1 in /…
dependabot[bot] Mar 5, 2025
a890d77
feat: support setting function secrets from config (#3246)
sweatybridge Mar 5, 2025
468ce0f
feat: add clerk third-party auth config (#3247)
hf Mar 5, 2025
24f8a32
fix: move function deploy to public package (#3253)
sweatybridge Mar 5, 2025
3767946
chore(deps): bump go.opentelemetry.io/otel from 1.34.0 to 1.35.0 (#3257)
dependabot[bot] Mar 6, 2025
09faa38
chore(deps): bump supabase/supavisor from 2.4.6 to 2.4.9 in /pkg/conf…
dependabot[bot] Mar 6, 2025
42f560e
chore(deps): bump supabase/realtime from v2.34.39 to v2.34.40 in /pkg…
dependabot[bot] Mar 6, 2025
840ffd6
chore(deps): bump supabase/postgres from 15.8.1.047 to 15.8.1.048 in …
dependabot[bot] Mar 7, 2025
11ad92f
chore(deps): bump supabase/supavisor from 2.4.9 to 2.4.12 in /pkg/con…
dependabot[bot] Mar 7, 2025
af8ad6e
chore(deps): bump supabase/gotrue from v2.169.0 to v2.170.0 in /pkg/c…
dependabot[bot] Mar 7, 2025
b02f6dc
chore(deps): bump golang.org/x/mod from 0.23.0 to 0.24.0 (#3260)
dependabot[bot] Mar 8, 2025
57af4da
chore(deps): bump golang.org/x/term from 0.29.0 to 0.30.0 (#3258)
dependabot[bot] Mar 8, 2025
106b2cc
chore(deps): bump golang.org/x/oauth2 from 0.27.0 to 0.28.0 (#3259)
dependabot[bot] Mar 8, 2025
fe35846
fix: clerk tpa domain pattern works for non-production mode domains (…
hf Mar 9, 2025
e1ae727
fix: bulk update after deploying multiple functions (#3277)
sweatybridge Mar 10, 2025
6ad2b98
fix: append to empty request array (#3279)
sweatybridge Mar 10, 2025
ce25538
chore(deps): bump supabase/storage-api from v1.19.1 to v1.19.2 in /pk…
dependabot[bot] Mar 11, 2025
02c25ef
chore(deps): bump supabase/logflare from 1.12.0 to 1.12.5 in /pkg/con…
dependabot[bot] Mar 11, 2025
7a6338a
fix: bump logflare version to 1.12.5
sweatybridge Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ updates:
interval: "daily"
ignore:
- dependency-name: "library/kong"
- dependency-name: "inbucket/inbucket"
- dependency-name: "axllent/mailpit"
- dependency-name: "darthsim/imgproxy"
- dependency-name: "timberio/vector"
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
cache: true
- run: go build main.go
- run: ./main init
- run: sed -i '/\[db.pooler\]/{n;s/.*/enabled = true/}' supabase/config.toml
- run: ./main start
env:
SUPABASE_INTERNAL_IMAGE_REGISTRY: ghcr.io
Expand Down
95 changes: 44 additions & 51 deletions cmd/branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"

"github.com/go-errors/errors"
"github.com/google/uuid"
"github.com/spf13/afero"
"github.com/spf13/cobra"
"github.com/supabase/cli/internal/branches/create"
Expand Down Expand Up @@ -75,14 +76,11 @@ var (
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
if len(args) == 0 {
if err := promptBranchId(ctx, flags.ProjectRef); err != nil {
return err
}
} else {
branchId = args[0]
fsys := afero.NewOsFs()
if err := promptBranchId(ctx, args, fsys); err != nil {
return err
}
return get.Run(ctx, branchId, afero.NewOsFs())
return get.Run(ctx, branchId, fsys)
},
}

Expand All @@ -101,7 +99,7 @@ var (
branchUpdateCmd = &cobra.Command{
Use: "update [branch-id]",
Short: "Update a preview branch",
Long: "Update a preview branch by its ID.",
Long: "Update a preview branch by its name or ID.",
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
cmdFlags := cmd.Flags()
Expand All @@ -119,30 +117,24 @@ var (
body.Status = (*api.UpdateBranchBodyStatus)(&branchStatus.Value)
}
ctx := cmd.Context()
if len(args) == 0 {
if err := promptBranchId(ctx, flags.ProjectRef); err != nil {
return err
}
} else {
branchId = args[0]
fsys := afero.NewOsFs()
if err := promptBranchId(ctx, args, fsys); err != nil {
return err
}
return update.Run(cmd.Context(), branchId, body, afero.NewOsFs())
return update.Run(cmd.Context(), branchId, body, fsys)
},
}

branchDeleteCmd = &cobra.Command{
Use: "delete [branch-id]",
Short: "Delete a preview branch",
Long: "Delete a preview branch by its ID.",
Long: "Delete a preview branch by its name or ID.",
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
if len(args) == 0 {
if err := promptBranchId(ctx, flags.ProjectRef); err != nil {
return err
}
} else {
branchId = args[0]
fsys := afero.NewOsFs()
if err := promptBranchId(ctx, args, fsys); err != nil {
return err
}
return delete.Run(ctx, branchId)
},
Expand All @@ -165,8 +157,6 @@ func init() {
createFlags.Var(&branchRegion, "region", "Select a region to deploy the branch database.")
createFlags.Var(&size, "size", "Select a desired instance size for the branch database.")
createFlags.BoolVar(&persistent, "persistent", false, "Whether to create a persistent branch.")
getFlags := branchGetCmd.Flags()
getFlags.VarP(&utils.OutputFormat, "output", "o", "Output format of branch details.")
branchesCmd.AddCommand(branchCreateCmd)
branchesCmd.AddCommand(branchListCmd)
branchesCmd.AddCommand(branchGetCmd)
Expand All @@ -181,40 +171,43 @@ func init() {
rootCmd.AddCommand(branchesCmd)
}

func promptBranchId(ctx context.Context, ref string) error {
resp, err := utils.GetSupabase().V1ListAllBranchesWithResponse(ctx, ref)
if err != nil {
return errors.Errorf("failed to list preview branches: %w", err)
}
if resp.JSON200 == nil {
return errors.New("Unexpected error listing preview branches: " + string(resp.Body))
}
console := utils.NewConsole()
if !console.IsTTY {
// Fallback to current git branch on GHA
gitBranch := keys.GetGitBranch(afero.NewOsFs())
title := "Enter the name of your branch: "
if len(gitBranch) > 0 {
title = fmt.Sprintf("%-2s (or leave blank to use %s): ", title, utils.Aqua(gitBranch))
func promptBranchId(ctx context.Context, args []string, fsys afero.Fs) error {
var filter []list.BranchFilter
if len(args) > 0 {
if branchId = args[0]; uuid.Validate(branchId) == nil {
return nil
}
// Try resolving as branch name
filter = append(filter, list.FilterByName(branchId))
} else if console := utils.NewConsole(); !console.IsTTY {
// Only read from stdin if the terminal is non-interactive
title := "Enter the name of your branch"
if branchId = keys.GetGitBranch(fsys); len(branchId) > 0 {
title += fmt.Sprintf(" (or leave blank to use %s)", utils.Aqua(branchId))
}
title += ": "
if name, err := console.PromptText(ctx, title); err != nil {
return err
} else if len(name) > 0 {
gitBranch = name
branchId = name
}
if len(gitBranch) == 0 {
return errors.New("git branch cannot be empty")
if len(branchId) == 0 {
return errors.New("branch name cannot be empty")
}
for _, branch := range *resp.JSON200 {
if branch.Name == gitBranch {
branchId = branch.Id
return nil
}
}
return errors.Errorf("Branch not found: %s", gitBranch)
filter = append(filter, list.FilterByName(branchId))
}
branches, err := list.ListBranch(ctx, flags.ProjectRef, filter...)
if err != nil {
return err
} else if len(branches) == 0 {
return errors.Errorf("branch not found: %s", branchId)
} else if len(branches) == 1 {
branchId = branches[0].Id
return nil
}
items := make([]utils.PromptItem, len(*resp.JSON200))
for i, branch := range *resp.JSON200 {
// Let user choose from a list of branches
items := make([]utils.PromptItem, len(branches))
for i, branch := range branches {
items[i] = utils.PromptItem{
Summary: branch.Name,
Details: branch.Id,
Expand Down
18 changes: 6 additions & 12 deletions cmd/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,7 @@ var (
Short: "Run code generation tools",
}

keyNames keys.CustomName
keyOutput = utils.EnumFlag{
Allowed: []string{
utils.OutputEnv,
utils.OutputJson,
utils.OutputToml,
utils.OutputYaml,
},
Value: utils.OutputEnv,
}
keyNames keys.CustomName

genKeysCmd = &cobra.Command{
Use: "keys",
Expand All @@ -47,7 +38,11 @@ var (
return cmd.Root().PersistentPreRunE(cmd, args)
},
RunE: func(cmd *cobra.Command, args []string) error {
return keys.Run(cmd.Context(), flags.ProjectRef, keyOutput.Value, keyNames, afero.NewOsFs())
format := utils.OutputFormat.Value
if format == utils.OutputPretty {
format = utils.OutputEnv
}
return keys.Run(cmd.Context(), flags.ProjectRef, format, keyNames, afero.NewOsFs())
},
}

Expand Down Expand Up @@ -114,7 +109,6 @@ func init() {
genCmd.AddCommand(genTypesCmd)
keyFlags := genKeysCmd.Flags()
keyFlags.StringVar(&flags.ProjectRef, "project-ref", "", "Project ref of the Supabase project.")
keyFlags.VarP(&keyOutput, "output", "o", "Output format of key variables.")
keyFlags.StringSliceVar(&override, "override-name", []string{}, "Override specific variable names.")
genCmd.AddCommand(genKeysCmd)
rootCmd.AddCommand(genCmd)
Expand Down
7 changes: 1 addition & 6 deletions cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ import (
var (
override []string
names status.CustomName
output = utils.EnumFlag{
Allowed: append([]string{utils.OutputEnv}, utils.OutputDefaultAllowed...),
Value: utils.OutputPretty,
}

statusCmd = &cobra.Command{
GroupID: groupLocalDev,
Expand All @@ -32,7 +28,7 @@ var (
},
RunE: func(cmd *cobra.Command, args []string) error {
ctx, _ := signal.NotifyContext(cmd.Context(), os.Interrupt)
return status.Run(ctx, names, output.Value, afero.NewOsFs())
return status.Run(ctx, names, utils.OutputFormat.Value, afero.NewOsFs())
},
Example: ` supabase status -o env --override-name api.url=NEXT_PUBLIC_SUPABASE_URL
supabase status -o json`,
Expand All @@ -41,7 +37,6 @@ var (

func init() {
flags := statusCmd.Flags()
flags.VarP(&output, "output", "o", "Output format of status variables.")
flags.StringSliceVar(&override, "override-name", []string{}, "Override specific variable names.")
rootCmd.AddCommand(statusCmd)
}
6 changes: 2 additions & 4 deletions examples/functions-deploy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ func main() {
}
}

// Requires edge runtime binary to be added to PATH
func deploy(ctx context.Context, fsys fs.FS) error {
project := os.Getenv("SUPABASE_PROJECT_ID")
apiClient := newAPIClient(os.Getenv("SUPABASE_ACCESS_TOKEN"))
eszipBundler := function.NewNativeBundler(".", fsys)
functionClient := function.NewEdgeRuntimeAPI(project, apiClient, eszipBundler)
functionClient := function.NewEdgeRuntimeAPI(project, apiClient)
fc := config.FunctionConfig{"my-slug": {
Entrypoint: "supabase/functions/my-slug/index.ts",
ImportMap: "supabase/functions/import_map.json",
}}
return functionClient.UpsertFunctions(ctx, fc)
return functionClient.Deploy(ctx, fc, fsys)
}

func newAPIClient(token string) api.ClientWithResponses {
Expand Down
Loading