Skip to content

Commit 066c53a

Browse files
cstocktonChris Stocktonhf
authored
chore: rename packages to remove versioning information (#2023)
This prepares packages to match with the agreed upon end state in #2012 --------- Co-authored-by: Chris Stockton <[email protected]> Co-authored-by: Stojan Dimitrovski <[email protected]>
1 parent 269ddfe commit 066c53a

File tree

8 files changed

+26
-77
lines changed

8 files changed

+26
-77
lines changed

.github/workflows/dogfooding.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ on:
55
types: [submitted, edited]
66

77
pull_request:
8-
types:
9-
- opened
10-
branches:
11-
- '*'
8+
9+
push:
1210

1311
permissions:
1412
contents: read

internal/hooks/hooks.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"net/http"
55

66
"github.com/supabase/auth/internal/conf"
7+
"github.com/supabase/auth/internal/hooks/hookshttp"
8+
"github.com/supabase/auth/internal/hooks/hookspgfunc"
79
"github.com/supabase/auth/internal/hooks/v0hooks"
8-
"github.com/supabase/auth/internal/hooks/v0hooks/v0http"
9-
"github.com/supabase/auth/internal/hooks/v0hooks/v0pgfunc"
1010
"github.com/supabase/auth/internal/storage"
1111
)
1212

@@ -18,8 +18,8 @@ func NewManager(
1818
db *storage.Connection,
1919
config *conf.GlobalConfiguration,
2020
) *Manager {
21-
httpDr := v0http.New()
22-
pgfuncDr := v0pgfunc.New(db)
21+
httpDr := hookshttp.New()
22+
pgfuncDr := hookspgfunc.New(db)
2323
return &Manager{
2424
v0mgr: v0hooks.NewManager(config, httpDr, pgfuncDr),
2525
}

internal/hooks/v0hooks/v0http/v0http.go renamed to internal/hooks/hookshttp/hookshttp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package v0http
1+
package hookshttp
22

33
import (
44
"bytes"

internal/hooks/v0hooks/v0http/v0http_test.go renamed to internal/hooks/hookshttp/hookshttp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package v0http
1+
package hookshttp
22

33
import (
44
"bytes"

internal/hooks/v0hooks/v0pgfunc/v0pgfunc.go renamed to internal/hooks/hookspgfunc/hookspgfunc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package v0pgfunc
1+
package hookspgfunc
22

33
import (
44
"context"

internal/hooks/v0hooks/v0pgfunc/v0pgfunc_test.go renamed to internal/hooks/hookspgfunc/hookspgfunc_test.go

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package v0pgfunc
1+
package hookspgfunc
22

33
import (
44
"context"
@@ -8,8 +8,8 @@ import (
88
"github.com/gofrs/uuid"
99
"github.com/stretchr/testify/require"
1010
"github.com/supabase/auth/internal/conf"
11+
"github.com/supabase/auth/internal/e2e"
1112
"github.com/supabase/auth/internal/storage"
12-
"github.com/supabase/auth/internal/storage/test"
1313
)
1414

1515
type M = map[string]any
@@ -18,8 +18,8 @@ func TestDispatch(t *testing.T) {
1818
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
1919
defer cancel()
2020

21-
globalCfg := helpConfig(t, apiTestConfig)
22-
db := helpConn(t, globalCfg)
21+
globalCfg := e2e.Must(e2e.Config())
22+
db := e2e.Must(e2e.Conn(globalCfg))
2323

2424
type testCase struct {
2525
ctx context.Context
@@ -225,27 +225,3 @@ func TestDispatch(t *testing.T) {
225225
require.Equal(t, tc.exp, res)
226226
}
227227
}
228-
229-
const (
230-
apiTestConfig = "../../../../hack/test.env"
231-
)
232-
233-
func helpConfig(t testing.TB, configPath string) *conf.GlobalConfiguration {
234-
t.Helper()
235-
236-
config, err := conf.LoadGlobal(configPath)
237-
if err != nil {
238-
t.Fatalf("error loading config %q; got %v", configPath, err)
239-
}
240-
return config
241-
}
242-
243-
func helpConn(t testing.TB, config *conf.GlobalConfiguration) *storage.Connection {
244-
t.Helper()
245-
246-
conn, err := test.SetupDBConnection(config)
247-
if err != nil {
248-
t.Fatalf("error setting up db connection: %v", err)
249-
}
250-
return conn
251-
}

internal/hooks/v0hooks/manager.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ import (
1111

1212
"github.com/supabase/auth/internal/api/apierrors"
1313
"github.com/supabase/auth/internal/conf"
14-
"github.com/supabase/auth/internal/hooks/v0hooks/v0http"
15-
"github.com/supabase/auth/internal/hooks/v0hooks/v0pgfunc"
14+
"github.com/supabase/auth/internal/hooks/hookshttp"
15+
"github.com/supabase/auth/internal/hooks/hookspgfunc"
1616
"github.com/supabase/auth/internal/observability"
1717
"github.com/supabase/auth/internal/storage"
1818
)
1919

2020
type Manager struct {
2121
config *conf.GlobalConfiguration
22-
v0http *v0http.Dispatcher
23-
v0pgfunc *v0pgfunc.Dispatcher
22+
v0http *hookshttp.Dispatcher
23+
v0pgfunc *hookspgfunc.Dispatcher
2424
}
2525

2626
func NewManager(
2727
config *conf.GlobalConfiguration,
28-
httpDr *v0http.Dispatcher,
29-
pgfuncDr *v0pgfunc.Dispatcher,
28+
httpDr *hookshttp.Dispatcher,
29+
pgfuncDr *hookspgfunc.Dispatcher,
3030
) *Manager {
3131
return &Manager{
3232
config: config,

internal/hooks/v0hooks/manager_test.go

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ import (
1010
"github.com/golang-jwt/jwt/v5"
1111
"github.com/stretchr/testify/require"
1212
"github.com/supabase/auth/internal/conf"
13-
"github.com/supabase/auth/internal/hooks/v0hooks/v0http"
14-
"github.com/supabase/auth/internal/hooks/v0hooks/v0pgfunc"
15-
"github.com/supabase/auth/internal/storage"
16-
"github.com/supabase/auth/internal/storage/test"
13+
"github.com/supabase/auth/internal/e2e"
14+
"github.com/supabase/auth/internal/hooks/hookshttp"
15+
"github.com/supabase/auth/internal/hooks/hookspgfunc"
1716
)
1817

1918
type M = map[string]any
@@ -25,10 +24,10 @@ func TestHooks(t *testing.T) {
2524
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
2625
defer cancel()
2726

28-
globalCfg := helpConfig(t, apiTestConfig)
29-
db := helpConn(t, globalCfg)
30-
httpDr := v0http.New(v0http.WithTimeout(time.Second / 10))
31-
pgfuncDr := v0pgfunc.New(db, v0pgfunc.WithTimeout(time.Second/10))
27+
globalCfg := e2e.Must(e2e.Config())
28+
db := e2e.Must(e2e.Conn(globalCfg))
29+
httpDr := hookshttp.New(hookshttp.WithTimeout(time.Second / 10))
30+
pgfuncDr := hookspgfunc.New(db, hookspgfunc.WithTimeout(time.Second/10))
3231
mr := NewManager(globalCfg, httpDr, pgfuncDr)
3332
now := time.Date(2024, time.January, 1, 0, 0, 0, 0, time.UTC)
3433

@@ -485,27 +484,3 @@ func TestHooks(t *testing.T) {
485484
}
486485
}
487486
}
488-
489-
const (
490-
apiTestConfig = "../../../hack/test.env"
491-
)
492-
493-
func helpConfig(t testing.TB, configPath string) *conf.GlobalConfiguration {
494-
t.Helper()
495-
496-
config, err := conf.LoadGlobal(configPath)
497-
if err != nil {
498-
t.Fatalf("error loading config %q; got %v", configPath, err)
499-
}
500-
return config
501-
}
502-
503-
func helpConn(t testing.TB, config *conf.GlobalConfiguration) *storage.Connection {
504-
t.Helper()
505-
506-
conn, err := test.SetupDBConnection(config)
507-
if err != nil {
508-
t.Fatalf("error setting up db connection: %v", err)
509-
}
510-
return conn
511-
}

0 commit comments

Comments
 (0)