Repository navigation
Merge upstream golang-migrate/migrate into ib (through v4.20.1) - #64
Merged
Merged
Conversation
…Polaris findings) (golang-migrate#1402) * fix(dktesting): ignore not-found error during image cleanup * fix(deps): migrate docker/docker to moby/moby/client and moby/moby/api (CVE-2024-41110, CVE-2026-34040, CVE-2026-33997) * fix: replace deprecated NewClientWithOpts with New * fix: replace deprecated WithVersion with WithAPIVersion * chore: cleanup unused comments --------- Co-authored-by: Faisal, Ahmad Mu'min (contracted) <AhmadMumin.Faisal@contracted.sampoerna.com>
golang-migrate#1373) Bumps the go_modules group with 1 update in the / directory: [google.golang.org/grpc](https://github.com/grpc/grpc-go). Updates `google.golang.org/grpc` from 1.74.2 to 1.79.3 - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.74.2...v1.79.3) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.79.3 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* spanner: Update spansql statement parser version * push to latest patch
* build: bump alpine docker image to 3.24 * apk upgrade
…tes (golang-migrate#1429) Bumps the go_modules group with 3 updates in the / directory: [github.com/jackc/pgx/v5](https://github.com/jackc/pgx), [go.mongodb.org/mongo-driver](https://github.com/mongodb/mongo-go-driver) and [github.com/apache/thrift](https://github.com/apache/thrift). Updates `github.com/jackc/pgx/v5` from 5.7.6 to 5.9.2 - [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md) - [Commits](jackc/pgx@v5.7.6...v5.9.2) Updates `go.mongodb.org/mongo-driver` from 1.7.5 to 1.17.7 - [Release notes](https://github.com/mongodb/mongo-go-driver/releases) - [Commits](mongodb/mongo-go-driver@v1.7.5...v1.17.7) Updates `github.com/apache/thrift` from 0.16.0 to 0.24.0 - [Release notes](https://github.com/apache/thrift/releases) - [Changelog](https://github.com/apache/thrift/blob/master/CHANGES.md) - [Commits](apache/thrift@v0.16.0...v0.24.0) --- updated-dependencies: - dependency-name: github.com/apache/thrift dependency-version: 0.23.0 dependency-type: indirect - dependency-name: github.com/jackc/pgx/v5 dependency-version: 5.9.2 dependency-type: direct:production - dependency-name: go.mongodb.org/mongo-driver dependency-version: 1.17.7 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…lang-migrate#1412) Signed-off-by: eylon <eylon@vybs.co>
golang-migrate#1424) Migrations.Append rebuilt and re-sorted the whole index on every call, making source driver initialization O(n^2 log n) in the number of migration files. All in-memory source drivers (file, iofs, aws_s3, github, ...) call Append in a loop at Open/Init time, so startup cost grew quadratically: 81ms at 1,000 migrations, 2.2s at 5,000 and 11.3s at 10,000 on an i9-9900K. Append now only marks the index dirty; the index is rebuilt at most once, on the first read access (First/Prev/Next). No exported API changes. BenchmarkAppend5000 drops from ~2.2s/op to ~2ms/op.
* test: add PostgreSQL 18 to test matrix * test: remove PostgreSQL 13 from test matrix (EOL on 2025-11-03)
* ci: fix GoReleaser build matrix * extend ignore list
Brings in the 13 upstream commits since 2bd822b (through v4.20.1 / 504568a). Conflict resolutions: * source/aws_s3: upstream 5bcd008 fixes migrations beyond the first 1000 objects being silently dropped, but is written against aws-sdk-go v1 (ListObjectsPages), which this fork no longer uses. Ported the fix to the v2 paginator (NewListObjectsV2Paginator) instead. The fork had the same bug, so this is a real fix here, not just a merge artifact. The test fake now pages via ContinuationToken and sorts keys, since the v2 paginator issues one call per page and raw map order would shuffle page boundaries between calls. * go.mod/go.sum: reconciled per module by taking the higher version, so upstream's bumps are adopted without regressing the CVE pins from 9272f75/a296630/8d1eb40. Verified unchanged: grpc (1.85.0-dev pin), x/net 0.59.0, x/crypto 0.57.0, grpc-gateway 2.27.2; docker/docker moves up to upstream's 28.5.2. Kept go 1.26.0 over upstream's 1.25.11. Upstream's jackc/* and aws-sdk-go v1 requirements are not adopted -- this fork's pgx drivers use lib/pq and its s3 source uses SDK v2, so nothing imports them. * ci.yaml: kept the single-version test matrix; upstream's added 1.25.x cannot build a module requiring go 1.26.0. * Dockerfile: kept the distroless/nonroot final stage and cli config, adopting upstream's alpine 3.24 pin for the builder. Pinned Dockerfile.github-actions to alpine:3.24 over floating latest.
The Dockerfile was the only place pinning a specific Go patch release; it sat at 1.26.4 while 1.26.8 is the current 1.26 patch. The CI workflows ask for "1.26.x", which setup-go already resolves to 1.26.8, so this only brings the image in line with what CI has been compiling with. Also adopts the alpine 3.24 pin on the builder tag, matching the base image pinned in Dockerfile.github-actions. go.mod's `go 1.26.0` is deliberately left alone: it declares the minimum language version, not the toolchain used to build, and raising it would restrict consumers for no gain. Verified by building the image locally (`go version` in the builder reports go1.26.8) since no CI job builds this Dockerfile.
Coverage Report for CI Build 35291475432Coverage increased (+0.5%) to 52.623%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
The final stage copies the binary to /migrate but declared
ENTRYPOINT ["migrate"]. gcr.io/distroless/static has no shell and does
not put / on PATH, so the exec-form entrypoint could not be resolved and
every `docker run` of the image failed with:
exec: "migrate": executable file not found in $PATH
Point the entrypoint at the absolute path. Dockerfile.github-actions is
unaffected -- it installs to /usr/local/bin, which is on PATH.
Latent since the final stage moved to distroless; nothing caught it
because no CI job builds or runs this image. Verified by building the
image and running it with both the default CMD and an explicit argument.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Catches
ibup with upstreamgolang-migrate/migrate.masterwas also stale and has been fast-forwarded separately to504568a(it was 15 behind / 0 ahead — a pure mirror, no PR needed); it is now at0 0divergence from upstream.Before this,
ibwas 13 upstream commits behind (merge base2bd822b, 2026-03-11) and 75 ahead. Eight files conflicted.Resolutions
source/aws_s3— upstream bugfix ported, not mergedUpstream
5bcd008fixes migrations past the first 1000 S3 objects being silently dropped and never applied. It's written against aws-sdk-go v1 (ListObjectsPages), which this fork no longer uses — it migrated this driver to SDK v2. So the fix could not be taken textually; it's reimplemented overs3.NewListObjectsV2Paginator.Worth being explicit: the fork had this bug too. Our
loadMigrationsmade a single unpaginatedListObjectsV2call, so any repo with >1000 objects under the prefix was silently missing migrations. This is a live fix, not merge bookkeeping.The test fake needed real work, not just a signature change. The v2 paginator issues one call per page, so the fake pages via
ContinuationToken/NextContinuationTokenand sorts keys — upstream's fake sliced a single result, but ranging over a Go map across multiple calls would shuffle page boundaries and drop or repeat keys between pages.go.mod/go.sum— reconciled by taking the higher version per moduleThis preserves the CVE pins from
9272f75/a296630/8d1eb40while still adopting upstream's bumps. Verified no regression:ibbeforegoogle.golang.org/grpcv1.85.0-dev.0.20260825072537golang.org/x/netv0.59.0golang.org/x/cryptov0.57.0grpc-gateway/v2v2.27.2docker/dockerv28.3.3+incompatiblev28.5.2+incompatible(upstream)Kept
go 1.26.0over upstream's1.25.11. Upstream'sjackc/*andaws-sdk-gov1 requirements are deliberately not adopted — this fork's pgx drivers uselib/pqand its s3 source uses SDK v2, so nothing imports them (go mod tidyconfirms both are dropped).ci.yaml— kept the single-version test matrix. Upstream added1.25.x, which cannot build a module requiringgo 1.26.0. TheTests passedgate from #63 survives the merge, so the required check name is unaffected. Remaining delta is the golangci-lint and goreleaser version bumps, both inert here (lintisif: false,goreleaseris guarded to thegolang-migraterepo).Dockerfile— kept the distroless/nonroot final stage andcli/config, adopting upstream's alpine 3.24 pin for the builder (golang:1.26.4-alpine3.24). PinnedDockerfile.github-actionstoalpine:3.24instead of floatinglatest.README.md— badge set to Go 1.26, matching what this fork actually tests.Verification
go build ./...,go vet ./...— clean.go test ./source/... ./internal/... .— pass.database/*tests were not run locally; CI covers those.Note
Sidesteps the trap that blocked #62: this had upstream's two-entry matrix landed, a version-named required check could not have stayed valid. Requiring
Tests passedmakes matrix shape irrelevant.🤖 Generated with Claude Code