Skip to content

Commit

Permalink
BREAKING CHANGE: deprecate fly regions for branches
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge committed Dec 4, 2024
1 parent 15833d1 commit 2e78db1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 55 deletions.
23 changes: 3 additions & 20 deletions cmd/branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"os"
"sort"

"github.com/go-errors/errors"
"github.com/spf13/afero"
Expand All @@ -29,7 +28,7 @@ var (
}

branchRegion = utils.EnumFlag{
Allowed: flyRegions(),
Allowed: awsRegions(),
}
persistent bool

Expand Down Expand Up @@ -96,9 +95,8 @@ var (
string(api.BranchResponseStatusFUNCTIONSFAILED),
},
}
branchName string
gitBranch string
resetOnPush bool
branchName string
gitBranch string

branchUpdateCmd = &cobra.Command{
Use: "update [branch-id]",
Expand All @@ -114,9 +112,6 @@ var (
if cmdFlags.Changed("git-branch") {
body.GitBranch = &gitBranch
}
if cmdFlags.Changed("reset-on-push") {
body.ResetOnPush = &resetOnPush
}
if cmdFlags.Changed("persistent") {
body.Persistent = &persistent
}
Expand Down Expand Up @@ -176,7 +171,6 @@ func init() {
updateFlags := branchUpdateCmd.Flags()
updateFlags.StringVar(&branchName, "name", "", "Rename the preview branch.")
updateFlags.StringVar(&gitBranch, "git-branch", "", "Change the associated git branch.")
updateFlags.BoolVar(&resetOnPush, "reset-on-push", false, "Reset the preview branch on git push.")
updateFlags.BoolVar(&persistent, "persistent", false, "Switch between ephemeral and persistent branch.")
updateFlags.Var(&branchStatus, "status", "Override the current branch status.")
branchesCmd.AddCommand(branchUpdateCmd)
Expand All @@ -185,17 +179,6 @@ func init() {
rootCmd.AddCommand(branchesCmd)
}

func flyRegions() []string {
result := make([]string, len(utils.FlyRegions))
i := 0
for k := range utils.FlyRegions {
result[i] = k
i++
}
sort.Strings(result)
return result
}

func promptBranchId(ctx context.Context, ref string) error {
resp, err := utils.GetSupabase().V1ListAllBranchesWithResponse(ctx, ref)
if err != nil {
Expand Down
35 changes: 0 additions & 35 deletions internal/utils/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,41 +217,6 @@ var RegionMap = map[string]string{
"us-west-2": "West US (Oregon)",
}

var FlyRegions = map[string]string{
"ams": "Amsterdam, Netherlands",
"arn": "Stockholm, Sweden",
"bog": "Bogotá, Colombia",
"bos": "Boston, Massachusetts (US)",
"cdg": "Paris, France",
"den": "Denver, Colorado (US)",
"dfw": "Dallas, Texas (US",
"ewr": "Secaucus, NJ (US)",
"fra": "Frankfurt, Germany",
"gdl": "Guadalajara, Mexico",
"gig": "Rio de Janeiro, Brazil",
"gru": "Sao Paulo, Brazil",
"hkg": "Hong Kong, Hong Kong",
"iad": "Ashburn, Virginia (US",
"jnb": "Johannesburg, South Africa",
"lax": "Los Angeles, California (US",
"lhr": "London, United Kingdom",
"maa": "Chennai (Madras), India",
"mad": "Madrid, Spain",
"mia": "Miami, Florida (US)",
"nrt": "Tokyo, Japan",
"ord": "Chicago, Illinois (US",
"otp": "Bucharest, Romania",
"qro": "Querétaro, Mexico",
"scl": "Santiago, Chile",
"sea": "Seattle, Washington (US",
"sin": "Singapore, Singapore",
"sjc": "San Jose, California (US",
"syd": "Sydney, Australia",
"waw": "Warsaw, Poland",
"yul": "Montreal, Canada",
"yyz": "Toronto, Canada",
}

func GetSupabaseAPIHost() string {
apiHost := viper.GetString("INTERNAL_API_HOST")
if apiHost == "" {
Expand Down

0 comments on commit 2e78db1

Please sign in to comment.