Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package docker-compose for openSUSE:Factory checked in at 2023-03-25 18:55:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/docker-compose (Old) and /work/SRC/openSUSE:Factory/.docker-compose.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "docker-compose" Sat Mar 25 18:55:47 2023 rev:18 rq:1074248 version:2.17.1 Changes: -------- --- /work/SRC/openSUSE:Factory/docker-compose/docker-compose.changes 2023-03-22 22:32:33.678772670 +0100 +++ /work/SRC/openSUSE:Factory/.docker-compose.new.31432/docker-compose.changes 2023-03-25 18:56:03.166882349 +0100 @@ -1,0 +2,15 @@ +Fri Mar 24 18:27:40 UTC 2023 - ka...@b1-systems.de + +- Update to version 2.17.1: + * test: fix e2e commands on Windows + * test: generate valid Compose project names from Cucumber specs + * test: update error message + * test: fix race in e2e build test + * ci: upgrade to Go 1.20.2 & bump deps + * build(deps): bump github.com/moby/buildkit from 0.11.4 to + 0.11.5 + * watch involves up --build after change has been detected + * watch: add note about goroutine-safety & test + * watch: data race / segfault fixes + +------------------------------------------------------------------- Old: ---- compose-2.17.0.obscpio New: ---- compose-2.17.1.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ docker-compose.spec ++++++ --- /var/tmp/diff_new_pack.hjxuxT/_old 2023-03-25 18:56:05.218893076 +0100 +++ /var/tmp/diff_new_pack.hjxuxT/_new 2023-03-25 18:56:05.222893096 +0100 @@ -19,7 +19,7 @@ %define __arch_install_post export NO_BRP_STRIP_DEBUG=true Name: docker-compose -Version: 2.17.0 +Version: 2.17.1 Release: 0 Summary: Define and run multi-container applications with Docker License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.hjxuxT/_old 2023-03-25 18:56:05.258893285 +0100 +++ /var/tmp/diff_new_pack.hjxuxT/_new 2023-03-25 18:56:05.258893285 +0100 @@ -3,7 +3,7 @@ <param name="url">https://github.com/docker/compose</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v2.17.0</param> + <param name="revision">v2.17.1</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> @@ -17,7 +17,7 @@ <param name="compression">gz</param> </service> <service name="go_modules" mode="disabled"> - <param name="archive">compose-2.17.0.obscpio</param> + <param name="archive">compose-2.17.1.obscpio</param> </service> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.hjxuxT/_old 2023-03-25 18:56:05.278893389 +0100 +++ /var/tmp/diff_new_pack.hjxuxT/_new 2023-03-25 18:56:05.282893410 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/docker/compose</param> - <param name="changesrevision">6bedc196cc74730522123e159d3e49f411b5c3cd</param></service></servicedata> + <param name="changesrevision">cc70851bc87747e57a66eca5c71b8f861f2e6d9d</param></service></servicedata> (No newline at EOF) ++++++ compose-2.17.0.obscpio -> compose-2.17.1.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/.github/workflows/ci.yml new/compose-2.17.1/.github/workflows/ci.yml --- old/compose-2.17.0/.github/workflows/ci.yml 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/.github/workflows/ci.yml 2023-03-24 17:13:42.000000000 +0100 @@ -179,7 +179,11 @@ name: Test plugin mode if: ${{ matrix.mode == 'plugin' }} run: | - make e2e-compose + rm -rf ./covdatafiles + mkdir ./covdatafiles + make e2e-compose GOCOVERDIR=covdatafiles + go tool covdata textfmt -i=covdatafiles -o=coverage.out + - name: Test standalone mode if: ${{ matrix.mode == 'standalone' }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/Dockerfile new/compose-2.17.1/Dockerfile --- old/compose-2.17.0/Dockerfile 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/Dockerfile 2023-03-24 17:13:42.000000000 +0100 @@ -15,9 +15,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION=1.20.1 +ARG GO_VERSION=1.20.2 ARG XX_VERSION=1.1.2 -ARG GOLANGCI_LINT_VERSION=v1.51.1 +ARG GOLANGCI_LINT_VERSION=v1.52.0 ARG ADDLICENSE_VERSION=v1.0.0 ARG BUILD_TAGS="e2e" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/Makefile new/compose-2.17.1/Makefile --- old/compose-2.17.0/Makefile 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/Makefile 2023-03-24 17:13:42.000000000 +0100 @@ -23,6 +23,7 @@ else DETECTED_OS = $(shell uname -s) endif + ifeq ($(DETECTED_OS),Linux) MOBY_DOCKER=/usr/bin/docker endif @@ -71,10 +72,7 @@ .PHONY: e2e-compose e2e-compose: ## Run end to end local tests in plugin mode. Set E2E_TEST=TestName to run a single test - rm -rf covdatafiles - mkdir covdatafiles - GOCOVERDIR=covdatafiles go test $(TEST_FLAGS) -count=1 ./pkg/e2e - go tool covdata textfmt -i=covdatafiles -o=coverage.out + go test $(TEST_FLAGS) -count=1 ./pkg/e2e .PHONY: e2e-compose-standalone e2e-compose-standalone: ## Run End to end local tests in standalone mode. Set E2E_TEST=TestName to run a single test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/docker-bake.hcl new/compose-2.17.1/docker-bake.hcl --- old/compose-2.17.0/docker-bake.hcl 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/docker-bake.hcl 2023-03-24 17:13:42.000000000 +0100 @@ -13,7 +13,8 @@ // limitations under the License. variable "GO_VERSION" { - default = "1.20.1" + # default ARG value set in Dockerfile + default = null } variable "BUILD_TAGS" { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/e2e/cucumber_test.go new/compose-2.17.1/e2e/cucumber_test.go --- old/compose-2.17.0/e2e/cucumber_test.go 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/e2e/cucumber_test.go 2023-03-24 17:13:42.000000000 +0100 @@ -25,6 +25,7 @@ "strings" "testing" + "github.com/compose-spec/compose-go/loader" "github.com/cucumber/godog" "github.com/cucumber/godog/colors" "github.com/mattn/go-shellwords" @@ -58,7 +59,7 @@ func setup(s *godog.ScenarioContext) { t := s.TestingT() - projectName := strings.Split(t.Name(), "/")[1] + projectName := loader.NormalizeProjectName(strings.Split(t.Name(), "/")[1]) cli := e2e.NewCLI(t, e2e.WithEnv( fmt.Sprintf("COMPOSE_PROJECT_NAME=%s", projectName), )) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/go.mod new/compose-2.17.1/go.mod --- old/compose-2.17.0/go.mod 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/go.mod 2023-03-24 17:13:42.000000000 +0100 @@ -5,11 +5,11 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.6 github.com/buger/goterm v1.0.4 - github.com/compose-spec/compose-go v1.13.0 + github.com/compose-spec/compose-go v1.13.1 github.com/containerd/console v1.0.3 github.com/containerd/containerd v1.6.19 github.com/cucumber/godog v0.0.0-00010101000000-000000000000 - github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa + github.com/distribution/distribution/v3 v3.0.0-20230223072852-e5d5810851d1 github.com/docker/buildx v0.10.4 github.com/docker/cli v23.0.1+incompatible github.com/docker/cli-docs-tool v0.5.1 @@ -21,7 +21,7 @@ github.com/hashicorp/go-version v1.6.0 github.com/mattn/go-shellwords v1.0.12 github.com/mitchellh/mapstructure v1.5.0 - github.com/moby/buildkit v0.11.4 + github.com/moby/buildkit v0.11.5 github.com/moby/term v0.0.0-20221205130635-1aeaba878587 github.com/morikuni/aec v1.0.0 github.com/opencontainers/go-digest v1.0.0 @@ -79,7 +79,7 @@ github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-memdb v1.3.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/imdario/mergo v0.3.14 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jinzhu/gorm v1.9.11 // indirect github.com/jonboulle/clockwork v0.3.1-0.20230117163003-a89700cec744 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/go.sum new/compose-2.17.1/go.sum --- old/compose-2.17.0/go.sum 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/go.sum 2023-03-24 17:13:42.000000000 +0100 @@ -165,8 +165,8 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/compose-spec/compose-go v1.13.0 h1:HHMc1XvnHJr9LUS7fPiiQeTSmGtEp+myn7jGnXgIoXE= -github.com/compose-spec/compose-go v1.13.0/go.mod h1:uo+YhhqDpkW9MjZNzJgOLX3MlbK6zHaBo9n8LhGDwsg= +github.com/compose-spec/compose-go v1.13.1 h1:/drmzaAVRtpzIIjCTbNO8DymNf7wwWvJUUkeLRPT5bI= +github.com/compose-spec/compose-go v1.13.1/go.mod h1:SQfvBkB9u8bLhrj4RQP4I777SqzNLSl9/fNnfvOOjek= github.com/containerd/cgroups v1.0.4 h1:jN/mbWBEaz+T1pi5OFtnkQ+8qnmEbAr1Oo1FRm5B0dA= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= @@ -201,8 +201,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa h1:L9Ay/slwQ4ERSPaurC+TVkZrM0K98GNrEEo1En3e8as= -github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= +github.com/distribution/distribution/v3 v3.0.0-20230223072852-e5d5810851d1 h1:OtfRoaZ54jKZ7jl9WuxqekousLR9T63iJf0y2EdC2S4= +github.com/distribution/distribution/v3 v3.0.0-20230223072852-e5d5810851d1/go.mod h1:r5XLH1cp+Wau2jxdptkYsFvvvzPPQTIe8eUuQ0vq30Q= github.com/docker/buildx v0.10.4 h1:qsHwlUZaLu7UQkDhJDSRQ+jrvWf6mqwwtY+gWO3rzuA= github.com/docker/buildx v0.10.4/go.mod h1:2mHDjD0QevclBGYIXDOWY/ZU71JAzx7w4CfgroYbHQw= github.com/docker/cli v23.0.1+incompatible h1:LRyWITpGzl2C9e9uGxzisptnxAn1zfZKXy13Ul2Q5oM= @@ -447,8 +447,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.14 h1:fOqeC1+nCuuk6PKQdg9YmosXX7Y7mHX6R/0ZldI9iHo= +github.com/imdario/mergo v0.3.14/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/in-toto/in-toto-golang v0.5.0 h1:hb8bgwr0M2hGdDsLjkJ3ZqJ8JFLL/tgYdAxF/XEFBbY= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= @@ -541,8 +541,8 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/buildkit v0.11.4 h1:mleVHr+n7HUD65QNUkgkT3d8muTzhYUoHE9FM3Ej05s= -github.com/moby/buildkit v0.11.4/go.mod h1:P5Qi041LvCfhkfYBHry+Rwoo3Wi6H971J2ggE+PcIoo= +github.com/moby/buildkit v0.11.5 h1:S6YrFJ0bfBT2w9e8kOxqsDV8Bw+HtfqdB6eHL17BXRI= +github.com/moby/buildkit v0.11.5/go.mod h1:P5Qi041LvCfhkfYBHry+Rwoo3Wi6H971J2ggE+PcIoo= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/patternmatcher v0.5.0 h1:YCZgJOeULcxLw1Q+sVR636pmS7sPEn1Qo2iAN6M7DBo= @@ -1327,7 +1327,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/pkg/compose/convergence.go new/compose-2.17.1/pkg/compose/convergence.go --- old/compose-2.17.0/pkg/compose/convergence.go 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/pkg/compose/convergence.go 2023-03-24 17:13:42.000000000 +0100 @@ -455,6 +455,9 @@ // setDependentLifecycle define the Lifecycle strategy for all services to depend on specified service func setDependentLifecycle(project *types.Project, service string, strategy string) { + mu.Lock() + defer mu.Unlock() + for i, s := range project.Services { if utils.StringContains(s.GetDependencies(), service) { if s.Extensions == nil { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/pkg/compose/watch.go new/compose-2.17.1/pkg/compose/watch.go --- old/compose-2.17.0/pkg/compose/watch.go 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/pkg/compose/watch.go 2023-03-24 17:13:42.000000000 +0100 @@ -133,7 +133,7 @@ } ignore := watch.NewCompositeMatcher( dockerIgnores, - watch.EphemeralPathMatcher, + watch.EphemeralPathMatcher(), dotGitIgnore, ) @@ -255,6 +255,10 @@ } func (s *composeService) makeRebuildFn(ctx context.Context, project *types.Project) func(services rebuildServices) { + for i, service := range project.Services { + service.PullPolicy = types.PullPolicyBuild + project.Services[i] = service + } return func(services rebuildServices) { serviceNames := make([]string, 0, len(services)) allPaths := make(utils.Set[string]) @@ -271,20 +275,7 @@ strings.Join(serviceNames, ", "), strings.Join(append([]string{""}, allPaths.Elements()...), "\n - "), ) - imageIds, err := s.build(ctx, project, api.BuildOptions{ - Services: serviceNames, - }) - if err != nil { - fmt.Fprintf(s.stderr(), "Build failed\n") - } - for i, service := range project.Services { - if id, ok := imageIds[service.Name]; ok { - service.Image = id - } - project.Services[i] = service - } - - err = s.Up(ctx, project, api.UpOptions{ + err := s.Up(ctx, project, api.UpOptions{ Create: api.CreateOptions{ Services: serviceNames, Inherit: true, @@ -336,17 +327,17 @@ func debounce(ctx context.Context, clock clockwork.Clock, delay time.Duration, input <-chan fileMapping, fn func(services rebuildServices)) { services := make(rebuildServices) - t := clock.AfterFunc(delay, func() { - if len(services) > 0 { - fn(services) - // TODO(milas): this is a data race! - services = make(rebuildServices) - } - }) + t := clock.NewTimer(delay) + defer t.Stop() for { select { case <-ctx.Done(): return + case <-t.Chan(): + if len(services) > 0 { + go fn(services) + services = make(rebuildServices) + } case e := <-input: t.Reset(delay) svc, ok := services[e.Service] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/pkg/e2e/build_test.go new/compose-2.17.1/pkg/e2e/build_test.go --- old/compose-2.17.0/pkg/e2e/build_test.go 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/pkg/e2e/build_test.go 2023-03-24 17:13:42.000000000 +0100 @@ -257,7 +257,7 @@ } t.Run("ClassicBuilder", func(t *testing.T) { - cli := NewParallelCLI(t, WithEnv( + cli := NewCLI(t, WithEnv( "DOCKER_BUILDKIT=0", "COMPOSE_FILE=./fixtures/build-dependencies/compose.yaml", )) @@ -265,7 +265,7 @@ }) t.Run("BuildKit", func(t *testing.T) { - cli := NewParallelCLI(t, WithEnv( + cli := NewCLI(t, WithEnv( "DOCKER_BUILDKIT=1", "COMPOSE_FILE=./fixtures/build-dependencies/compose.yaml", )) @@ -390,8 +390,8 @@ res := c.RunDockerComposeCmdNoCheck(t, "--project-directory", "fixtures/build-test/platforms", "-f", "fixtures/build-test/platforms/compose-service-platform-not-in-build-platforms.yaml", "build") res.Assert(t, icmd.Expected{ - ExitCode: 1, - Err: `service "platforms" build configuration does not support platform: linux/riscv64`, + ExitCode: 15, + Err: `service.build.platforms MUST include service.platform "linux/riscv64"`, }) }) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/pkg/watch/ephemeral.go new/compose-2.17.1/pkg/watch/ephemeral.go --- old/compose-2.17.0/pkg/watch/ephemeral.go 2023-03-22 10:53:54.000000000 +0100 +++ new/compose-2.17.1/pkg/watch/ephemeral.go 2023-03-24 17:13:42.000000000 +0100 @@ -24,10 +24,9 @@ // stop-gap so they don't have a terrible experience if those files aren't // there or aren't in the right places. // -// https://app.clubhouse.io/windmill/story/691/filter-out-ephemeral-file-changes -var EphemeralPathMatcher = initEphemeralPathMatcher() - -func initEphemeralPathMatcher() PathMatcher { +// NOTE: The underlying `patternmatcher` is NOT always Goroutine-safe, so +// this is not a singleton; we create an instance for each watcher currently. +func EphemeralPathMatcher() PathMatcher { golandPatterns := []string{"**/*___jb_old___", "**/*___jb_tmp___", "**/.idea/**"} emacsPatterns := []string{"**/.#*", "**/#*#"} // if .swp is taken (presumably because multiple vims are running in that dir), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/compose-2.17.0/pkg/watch/ephemeral_test.go new/compose-2.17.1/pkg/watch/ephemeral_test.go --- old/compose-2.17.0/pkg/watch/ephemeral_test.go 1970-01-01 01:00:00.000000000 +0100 +++ new/compose-2.17.1/pkg/watch/ephemeral_test.go 2023-03-24 17:13:42.000000000 +0100 @@ -0,0 +1,49 @@ +/* +Copyright 2023 Docker Compose CLI authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package watch_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/docker/compose/v2/pkg/watch" +) + +func TestEphemeralPathMatcher(t *testing.T) { + ignored := []string{ + ".file.txt.swp", + "/path/file.txt~", + "/home/moby/proj/.idea/modules.xml", + ".#file.txt", + "#file.txt#", + "/dir/.file.txt.kate-swp", + "/go/app/1234-go-tmp-umask", + } + matcher := watch.EphemeralPathMatcher() + for _, p := range ignored { + ok, err := matcher.Matches(p) + if assert.NoErrorf(t, err, "Matching %s", p) { + assert.Truef(t, ok, "Path %s should have matched", p) + } + } + + const includedPath = "normal.txt" + ok, err := matcher.Matches(includedPath) + if assert.NoErrorf(t, err, "Matching %s", includedPath) { + assert.Falsef(t, ok, "Path %s should NOT have matched", includedPath) + } +} ++++++ compose.obsinfo ++++++ --- /var/tmp/diff_new_pack.hjxuxT/_old 2023-03-25 18:56:05.510894603 +0100 +++ /var/tmp/diff_new_pack.hjxuxT/_new 2023-03-25 18:56:05.510894603 +0100 @@ -1,5 +1,5 @@ name: compose -version: 2.17.0 -mtime: 1679478834 -commit: 6bedc196cc74730522123e159d3e49f411b5c3cd +version: 2.17.1 +mtime: 1679674422 +commit: cc70851bc87747e57a66eca5c71b8f861f2e6d9d ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/docker-compose/vendor.tar.gz /work/SRC/openSUSE:Factory/.docker-compose.new.31432/vendor.tar.gz differ: char 5, line 1