Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
run:
timeout: 5m

linters:
enable:
- errcheck
- govet
- ineffassign
- staticcheck
- unused
disable:
- depguard

linters-settings:
errcheck:
check-type-assertions: false

issues:
exclude-use-default: true
max-issues-per-linter: 50
max-same-issues: 10
9 changes: 7 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ dbdeployer is open source, and as such contributions are welcome.

The following guidelines want to help and simplify the process of contributing to dbdeployer development.

## Development Setup

- **Go 1.22+** is required to build and test dbdeployer.
- **[golangci-lint](https://golangci-lint.run/)** is required for linting. Install it following the [official instructions](https://golangci-lint.run/welcome/install/) and run `golangci-lint run` before submitting a PR.

## Principles

1. Contributions should follow the classic GitHub workflow, i.e. forking, cloning, then submitting a Pull Request (PR)
1. Contributions should follow the classic GitHub workflow, i.e. forking, cloning, then submitting a Pull Request (PR)
with the code that you propose.
2. Every new feature or bug fix should have an [issue](https://github.com/datacharmer/dbdeployer/issues), where the
2. Every new feature or bug fix should have an [issue](https://github.com/ProxySQL/dbdeployer/issues), where the
improvement gets discussed before any code is written.
3. If the contribution is a quick fix, such as a grammar or spelling mistake, go right ahead and submit a PR.
4. A new feature should either have tests associated to it or state a very good reason for why not.
Expand Down
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
[The end of dbdeployer](https://datacharmer.github.io/end-of-dbdeployer/)

# dbdeployer
[DBdeployer](https://github.com/datacharmer/dbdeployer) is a tool that deploys MySQL database servers easily.

[DBdeployer](https://github.com/ProxySQL/dbdeployer) is a tool that deploys MySQL database servers easily.
This is a port of [MySQL-Sandbox](https://github.com/datacharmer/mysql-sandbox), originally written in Perl, and re-designed from the ground up in [Go](https://golang.org). See the [features comparison](https://github.com/datacharmer/dbdeployer/blob/master/docs/features.md) for more detail.
Comment on lines +3 to 4
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README now points to the ProxySQL-maintained repo, but the “features comparison” link still points to datacharmer/dbdeployer. Consider switching it to a relative link (e.g., docs/features.md) or updating to the new repo so it doesn’t send users to the legacy project.

Copilot uses AI. Check for mistakes.

## New Maintainer

This project was originally created and maintained by [Giuseppe Maxia](https://github.com/datacharmer) (datacharmer). It is now actively maintained by the [ProxySQL](https://github.com/ProxySQL) team, continuing Giuseppe's excellent work while expanding the project's capabilities.

**Roadmap highlights:**

- ProxySQL and Orchestrator integration
- Provider-based architecture for extensible database support
- Eventual PostgreSQL support

See the [Phase 1 milestone](https://github.com/ProxySQL/dbdeployer/milestone/1) for current progress.

Documentation updated for version 1.66.0 (26-Jul-2022 10:30 UTC)

![Build Status](https://github.com/datacharmer/dbdeployer/workflows/.github/workflows/all_tests.yml/badge.svg)
![Build Status](https://github.com/ProxySQL/dbdeployer/workflows/.github/workflows/all_tests.yml/badge.svg)

- [Installation](https://github.com/datacharmer/dbdeployer/wiki/installation)
- [Manual installation](https://github.com/datacharmer/dbdeployer/wiki/installation#manual-installation)
Expand Down
2 changes: 1 addition & 1 deletion downloads/guess_latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type GuessInfo struct {
Url string
}

var allowedGuessVersions = []string{"5.7", "8.0"}
var allowedGuessVersions = []string{"5.7", "8.0", "8.4", "9.0", "9.1", "9.2"}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that guessing is enabled for 8.4/9.x, the guessing code path still hard-codes the Linux extension override only for shortVersion=="8.0" (else it defaults to .tar.gz). Add coverage and/or logic to ensure guessed filenames/URLs use the correct extension and naming conventions for 8.4 and 9.x, otherwise guess-latest may generate URLs that don’t exist.

Suggested change
var allowedGuessVersions = []string{"5.7", "8.0", "8.4", "9.0", "9.1", "9.2"}
// Only include versions for which the guessing logic (including extensions and naming)
// is known to produce valid URLs.
var allowedGuessVersions = []string{"5.7", "8.0"}

Copilot uses AI. Check for mistakes.

func isAllowedForGuessing(s string) bool {
for _, v := range allowedGuessVersions {
Expand Down
8 changes: 8 additions & 0 deletions downloads/remote_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ func TestFindOrGuessTarballByVersionFlavorOS(t *testing.T) {
DefaultTarballRegistry.Tarballs = saveTarballCollection
}

func TestNewMySQLVersionsRecognized(t *testing.T) {
versions := []string{"8.4", "9.0", "9.1", "9.2"}
for _, v := range versions {
result := isAllowedForGuessing(v)
compare.OkEqualBool(fmt.Sprintf("version %s allowed for guessing", v), result, true, t)
}
}

func TestTarballRegistry(t *testing.T) {

for _, tarball := range DefaultTarballRegistry.Tarballs {
Expand Down
6 changes: 3 additions & 3 deletions downloads/remote_tarballs.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,21 @@ var downloadsSettings = map[TarballType]TarballDef{
NameInFile: "mysql-cluster",
NameInUrl: "cluster",
DownloadDir: "MySQL-Cluster-VERSION",
Versions: []string{"7.6", "8.0"},
Versions: []string{"7.6", "8.0", "8.4", "9.0"},
},
TtMysql: {
Flavor: "mysql",
NameInFile: "mysql",
NameInUrl: "mysql",
DownloadDir: "MySQL-VERSION",
Versions: []string{"5.7", "8.0"},
Versions: []string{"5.7", "8.0", "8.4", "9.0", "9.1", "9.2"},
},
TtShell: {
Flavor: "shell",
NameInFile: "mysql-shell",
NameInUrl: "shell",
DownloadDir: "MySQL-Shell-VERSION",
Versions: []string{"8.0"},
Versions: []string{"8.0", "8.4", "9.0"},
},
Comment on lines +64 to 79
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new MySQL Innovation versions are only partially added: cluster and shell settings include 9.0 but omit 9.1/9.2, which conflicts with the PR description/issue acceptance criteria (support 9.0–9.2 across mysql/cluster/shell). Add the missing versions here or clarify why those tarballs are intentionally unsupported.

Copilot uses AI. Check for mistakes.
Comment on lines +64 to 79
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Cluster/Shell 9.x support is incomplete vs PR objective.

Line 64 and Line 78 only allow 9.0, while Line 71 allows 9.0, 9.1, 9.2 for mysql. This causes validateTarballRequest to reject cluster/shell requests for 9.1 and 9.2.

Proposed fix
 	TtCluster: {
 		Flavor:      "ndb",
 		NameInFile:  "mysql-cluster",
 		NameInUrl:   "cluster",
 		DownloadDir: "MySQL-Cluster-VERSION",
-		Versions:    []string{"7.6", "8.0", "8.4", "9.0"},
+		Versions:    []string{"7.6", "8.0", "8.4", "9.0", "9.1", "9.2"},
 	},
@@
 	TtShell: {
 		Flavor:      "shell",
 		NameInFile:  "mysql-shell",
 		NameInUrl:   "shell",
 		DownloadDir: "MySQL-Shell-VERSION",
-		Versions:    []string{"8.0", "8.4", "9.0"},
+		Versions:    []string{"8.0", "8.4", "9.0", "9.1", "9.2"},
 	},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@downloads/remote_tarballs.go` around lines 64 - 79, The Versions lists for
cluster/shell types are missing 9.1 and 9.2 which causes validateTarballRequest
to reject those requests; update the Versions slice for the cluster type
(TtCluster) and the shell type (TtShell) to include "9.1" and "9.2" (matching
the existing TtMysql entries) so cluster and shell requests for 9.1/9.2 are
accepted.

}

Expand Down
2 changes: 1 addition & 1 deletion downloads/tarball_list.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"DbdeployerVersion": "1.70.0",
"DbdeployerVersion": "1.74.0",
"Tarballs": [
{
"name": "tidb-master-darwin-amd64.tar.gz",
Expand Down
3 changes: 0 additions & 3 deletions downloads/tarball_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.16
// +build go1.16

package downloads

import (
Expand Down
42 changes: 20 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
module github.com/datacharmer/dbdeployer

go 1.18
go 1.22
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping the module to go 1.22 will break CI/build environments still using Go 1.18 (the current GitHub Actions workflow sets go-version: ^1.18). Please update the CI workflow/tooling to use Go >= 1.22 (or revert this bump if it’s not intended in this PR).

Suggested change
go 1.22
go 1.18

Copilot uses AI. Check for mistakes.

require (
github.com/alexeyco/simpletable v0.0.0-20180729223640-1fa9009f1080
github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195
github.com/dustin/go-humanize v1.0.0
github.com/go-sql-driver/mysql v1.4.1
github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443
github.com/alexeyco/simpletable v1.0.0
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/dustin/go-humanize v1.0.1
github.com/go-sql-driver/mysql v1.7.1
github.com/nightlyone/lockfile v1.0.0
github.com/pkg/errors v0.9.1
github.com/rogpeppe/go-internal v1.9.0
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.0
github.com/rogpeppe/go-internal v1.12.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.6
github.com/stretchr/testify v1.9.0
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
golang.org/x/term v0.13.0
golang.org/x/text v0.13.0
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8
golang.org/x/term v0.25.0
golang.org/x/text v0.19.0
jaytaylor.com/html2text v0.0.0-20200412013138-3577fbdbcff7

)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mattn/go-runewidth v0.0.12 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.1.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/tools v0.22.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
88 changes: 41 additions & 47 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,81 +1,75 @@
github.com/alexeyco/simpletable v0.0.0-20180729223640-1fa9009f1080 h1:LxG2QAVrS0Ml5A5/YUG5BLOJOrx2OR9yT9vkKW3CmUQ=
github.com/alexeyco/simpletable v0.0.0-20180729223640-1fa9009f1080/go.mod h1:gx4+gp4N5VWqThMIidoUMBNUCT4Pan3J8ETR1ParWUU=
github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195 h1:c4mLfegoDw6OhSJXTd2jUEQgZUQuJWtocudb97Qn9EM=
github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195/go.mod h1:SLqhdZcd+dF3TEVL2RMoob5bBP5R1P1qkox+HtCBgGI=
github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU=
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/alexeyco/simpletable v1.0.0 h1:ZQ+LvJ4bmoeHb+dclF64d0LX+7QAi7awsfCrptZrpHk=
github.com/alexeyco/simpletable v1.0.0/go.mod h1:VJWVTtGUnW7EKbMRH8cE13SigKGx/1fO2SeeOiGeBkk=
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhPwqqXc4/vE0f7GvRjuAsbW+HOIe8KnA=
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443 h1:+2OJrU8cmOstEoh0uQvYemRGVH1O6xtO2oANUWHFnP0=
github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443/go.mod h1:JbxfV1Iifij2yhRjXai0oFrbpxszXHRx1E5RuM26o4Y=
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.12 h1:Y41i/hVW3Pgwr8gV+J23B9YEY0zxjptBuCWEaxmAOow=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/nightlyone/lockfile v1.0.0 h1:RHep2cFKK4PonZJDdEl4GmkabuhbsRMgk/k3uAmxBiA=
github.com/nightlyone/lockfile v1.0.0/go.mod h1:rywoIealpdNse2r832aiD9jRk8ErCatROs6LzC841CI=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo=
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY=
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI=
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/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=
Expand Down
4 changes: 2 additions & 2 deletions ops/downloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ func findRemoteTarballByVersion(version, flavor, OS, arch string, minimal, newes

tarball, err = downloads.FindOrGuessTarballByVersionFlavorOS(version, flavor, OS, arch, minimal, newest, guessLatest)
if err != nil {
return downloads.TarballDescription{}, fmt.Errorf(fmt.Sprintf("Error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %s",
version, flavor, OS, minimal, newest, guessLatest, err))
return downloads.TarballDescription{}, fmt.Errorf("Error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %s",
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This returned error string is capitalized ("Error getting version...") while most other errors in this package are lowercase. Prefer starting errors with lowercase (e.g., "error getting version...") so callers can wrap/compose errors consistently.

Suggested change
return downloads.TarballDescription{}, fmt.Errorf("Error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %s",
return downloads.TarballDescription{}, fmt.Errorf("error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %s",

Copilot uses AI. Check for mistakes.
version, flavor, OS, minimal, newest, guessLatest, err)
}
return tarball, nil
}
Expand Down
2 changes: 1 addition & 1 deletion ts/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func findErrorsInLogFile(ts *testscript.TestScript, neg bool, args []string) {
ts.Check(err)
hasError := strings.Contains(string(contents), "ERROR")
if neg && hasError {
reLines := regexp.MustCompile(`(?sg)(^.*ERROR.*)`)
reLines := regexp.MustCompile(`(?s)(^.*ERROR.*)`)
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex used to extract ERROR lines is still not doing what the code implies: (?s)(^.*ERROR.*) makes ^ match only the start of the whole file and . match newlines, so FindAll will typically return a single large match (not the individual lines with ERROR). Use multiline mode (e.g., (?m)^.*ERROR.*$) or split by lines and filter, so the failure output is actionable and bounded.

Suggested change
reLines := regexp.MustCompile(`(?s)(^.*ERROR.*)`)
reLines := regexp.MustCompile(`(?m)^.*ERROR.*$`)

Copilot uses AI. Check for mistakes.
errorLines := reLines.FindAll(contents, -1)
ts.Fatalf("ERRORs found in %s (%s)\n", logFile, errorLines)
}
Expand Down
Loading