Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 5bc97d9

Browse files
authored
migration: fix stitch test cases (#64409)
These all fail and are only run outside of bazel (which is why we didn't notice it). I believe the root cause is google getting more strict with the URLs you pass it. Should we consider removing these tests given no one has reported it not working? Or should we get it working in Bazel? Test Plan go test ./internal/database/migration/stitch/
1 parent 1e3b643 commit 5bc97d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/database/migration/stitch/archives.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type LazyMigrationsReader struct {
3535

3636
func NewLazyMigrationsReader() *LazyMigrationsReader {
3737
return &LazyMigrationsReader{
38-
baseUrl: "https://storage.googleapis.com/schemas-migrations/migrations/",
38+
baseUrl: "https://storage.googleapis.com/schemas-migrations/migrations",
3939
}
4040
}
4141

@@ -55,6 +55,9 @@ func (l *LazyMigrationsReader) Get(version string) (map[string]string, error) {
5555
)
5656
}
5757
defer resp.Body.Close()
58+
if resp.StatusCode != 200 {
59+
return nil, errors.Errorf("unexpected status code (%d) for version %q from %q", resp.StatusCode, version, url)
60+
}
5861
contents, err := readFromTarball(resp.Body)
5962
if err != nil {
6063
return nil, errors.Wrapf(err, "faild to read migrations archive for version %q from tarball", version)

0 commit comments

Comments
 (0)