Skip to content

Commit 09f326a

Browse files
authored
introduce testscript-examples updater, and update the examples (#1438)
## Summary This PR adds `testscripts/testrunner/updater/main.go` that walks the `examples/` directory and updates projects that have a `run_test` script defined. In the future, perhaps we want this to run on other (non run_test) projects as well, but that is left as an exercise for future contributors. Also includes a fix for `devbox update` for insecure packages. ## How was it tested? ``` export DEVBOX_FEATURE_REMOVE_NIXPKGS=1 devbox run update-examples ``` Note: this adds info to devbox.lock for the Remove Nixpkgs feature that is not turned on. However, things should continue to work.
1 parent db9134f commit 09f326a

File tree

29 files changed

+1002
-127
lines changed

29 files changed

+1002
-127
lines changed

devbox.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"build-linux-amd64": "GOOS=linux GOARCH=amd64 go build -o dist/devbox-linux-amd64 cmd/devbox/main.go",
1717
"code": "code .",
1818
"lint": "golangci-lint run",
19-
"test": "go test -race -cover ./..."
19+
"test": "go test -race -cover ./...",
20+
"update-examples": "devbox run build && go run testscripts/testrunner/updater/main.go"
2021
}
2122
},
2223
"nixpkgs": {

examples/development/csharp/hello-world/devbox.lock

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,24 @@
22
"lockfile_version": "1",
33
"packages": {
44
"dotnet-sdk@latest": {
5-
"last_modified": "2023-05-01T16:53:22Z",
6-
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#dotnet-sdk",
7-
"version": "6.0.408"
5+
"last_modified": "2023-08-30T00:25:28Z",
6+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#dotnet-sdk",
7+
"source": "devbox-search",
8+
"version": "6.0.412",
9+
"systems": {
10+
"aarch64-darwin": {
11+
"store_path": "/nix/store/36llvbismbz4xkjv98m20pm2hlabhyq6-dotnet-sdk-6.0.412"
12+
},
13+
"aarch64-linux": {
14+
"store_path": "/nix/store/8ym2xmbqrqb9cy7axicnp510dc5wp5nf-dotnet-sdk-6.0.412"
15+
},
16+
"x86_64-darwin": {
17+
"store_path": "/nix/store/bbn41r9yb1df9hdx6in34yn4wjh0s8dy-dotnet-sdk-6.0.412"
18+
},
19+
"x86_64-linux": {
20+
"store_path": "/nix/store/cfwscwh904f689glcgsslghl1svapbn6-dotnet-sdk-6.0.412"
21+
}
22+
}
823
}
924
}
10-
}
25+
}

examples/development/elixir/elixir_hello/devbox.lock

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,24 @@
22
"lockfile_version": "1",
33
"packages": {
44
"elixir@latest": {
5-
"last_modified": "2023-05-01T16:53:22Z",
6-
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#elixir",
7-
"version": "1.14.4"
5+
"last_modified": "2023-08-30T00:25:28Z",
6+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#elixir",
7+
"source": "devbox-search",
8+
"version": "1.14.5",
9+
"systems": {
10+
"aarch64-darwin": {
11+
"store_path": "/nix/store/bf8ck0j68kqxzlgxqf1cpqbyc9j2yhp6-elixir-1.14.5"
12+
},
13+
"aarch64-linux": {
14+
"store_path": "/nix/store/v1lc7mljzi37b0fp1b787ybk2m45jsxd-elixir-1.14.5"
15+
},
16+
"x86_64-darwin": {
17+
"store_path": "/nix/store/07kcigpi96l15b09ydp4q9iwx4h0hkr0-elixir-1.14.5"
18+
},
19+
"x86_64-linux": {
20+
"store_path": "/nix/store/y8ys05axra38n4my5x4c3fgs35c0glb1-elixir-1.14.5"
21+
}
22+
}
823
}
924
}
10-
}
25+
}

examples/development/fsharp/hello-world/devbox.lock

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,24 @@
22
"lockfile_version": "1",
33
"packages": {
44
"dotnet-sdk@latest": {
5-
"last_modified": "2023-05-01T16:53:22Z",
6-
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#dotnet-sdk",
7-
"version": "6.0.408"
5+
"last_modified": "2023-08-30T00:25:28Z",
6+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#dotnet-sdk",
7+
"source": "devbox-search",
8+
"version": "6.0.412",
9+
"systems": {
10+
"aarch64-darwin": {
11+
"store_path": "/nix/store/36llvbismbz4xkjv98m20pm2hlabhyq6-dotnet-sdk-6.0.412"
12+
},
13+
"aarch64-linux": {
14+
"store_path": "/nix/store/8ym2xmbqrqb9cy7axicnp510dc5wp5nf-dotnet-sdk-6.0.412"
15+
},
16+
"x86_64-darwin": {
17+
"store_path": "/nix/store/bbn41r9yb1df9hdx6in34yn4wjh0s8dy-dotnet-sdk-6.0.412"
18+
},
19+
"x86_64-linux": {
20+
"store_path": "/nix/store/cfwscwh904f689glcgsslghl1svapbn6-dotnet-sdk-6.0.412"
21+
}
22+
}
823
}
924
}
10-
}
25+
}

examples/development/go/hello-world/devbox.lock

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,21 @@
44
55
"last_modified": "2023-05-01T16:53:22Z",
66
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#go_1_19",
7-
"version": "1.19.8"
7+
"version": "1.19.8",
8+
"systems": {
9+
"aarch64-darwin": {
10+
"store_path": "/nix/store/7m99ip3616l3z670y83p34r3plwd4iq1-go-1.19.8"
11+
},
12+
"aarch64-linux": {
13+
"store_path": "/nix/store/zpaj1y4iwmkk3ci43ab9k10rr9ilpa3a-go-1.19.8"
14+
},
15+
"x86_64-darwin": {
16+
"store_path": "/nix/store/m0fkw6wi5m73y78yqmwhd15y0fjfx5vq-go-1.19.8"
17+
},
18+
"x86_64-linux": {
19+
"store_path": "/nix/store/r0x0agq0vwn0p6z99vkkvn8l8a8idzsb-go-1.19.8"
20+
}
21+
}
822
}
923
}
10-
}
24+
}
Lines changed: 119 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,126 @@
11
{
22
"lockfile_version": "1",
33
"packages": {
4+
"cabal-install@latest": {
5+
"last_modified": "2023-08-30T00:25:28Z",
6+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#cabal-install",
7+
"source": "devbox-search",
8+
"version": "3.10.1.0",
9+
"systems": {
10+
"aarch64-darwin": {
11+
"store_path": "/nix/store/zx8c6zy7k4fvkzxbnz1gj4d9ib0slxcb-cabal-install-3.10.1.0"
12+
},
13+
"aarch64-linux": {
14+
"store_path": "/nix/store/i2cfjzfivkd6qvgjhhb1wzj7wgrhzac6-cabal-install-3.10.1.0"
15+
},
16+
"x86_64-darwin": {
17+
"store_path": "/nix/store/j1i22rivhlqra7ajkzwnlw4rdv63p5sp-cabal-install-3.10.1.0"
18+
},
19+
"x86_64-linux": {
20+
"store_path": "/nix/store/nb96882yc1jlx8li5m4xwyhr94n7nb21-cabal-install-3.10.1.0"
21+
}
22+
}
23+
},
424
"ghc@latest": {
5-
"last_modified": "2023-05-01T16:53:22Z",
6-
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#ghc",
7-
"version": "9.2.7"
25+
"last_modified": "2023-08-30T00:25:28Z",
26+
"plugin_version": "0.0.1",
27+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#ghc",
28+
"source": "devbox-search",
29+
"version": "9.4.6",
30+
"systems": {
31+
"aarch64-darwin": {
32+
"store_path": "/nix/store/1k85b7faqm8pc0k3y553zr8bfhb2dv2z-ghc-9.4.6"
33+
},
34+
"aarch64-linux": {
35+
"store_path": "/nix/store/kw8dna2428nizqcij9rxcg8wdiyviiql-ghc-9.4.6"
36+
},
37+
"x86_64-darwin": {
38+
"store_path": "/nix/store/fdlmpnichh72gbvqxqib5dglsgqldyfp-ghc-9.4.6"
39+
},
40+
"x86_64-linux": {
41+
"store_path": "/nix/store/kzn0hhns3y7khx6zjsnm9vdgnasc475j-ghc-9.4.6"
42+
}
43+
}
44+
},
45+
"gmp@latest": {
46+
"last_modified": "2023-08-30T00:25:28Z",
47+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#gmp",
48+
"source": "devbox-search",
49+
"version": "6.3.0",
50+
"systems": {
51+
"aarch64-darwin": {
52+
"store_path": "/nix/store/9v3j47bhq570p5mxb3qliakwxkimh6i9-gmp-with-cxx-6.3.0"
53+
},
54+
"aarch64-linux": {
55+
"store_path": "/nix/store/kyxfqavfj53kmlmza9wlshc21v7vfvx3-gmp-with-cxx-6.3.0"
56+
},
57+
"x86_64-darwin": {
58+
"store_path": "/nix/store/75psalhvv51afhchymk9vn32f16qxb6b-gmp-with-cxx-6.3.0"
59+
},
60+
"x86_64-linux": {
61+
"store_path": "/nix/store/44bqlp05nq9ymdjvngjx8fdjrfmgj63h-gmp-with-cxx-6.3.0"
62+
}
63+
}
64+
},
65+
"hpack@latest": {
66+
"last_modified": "2023-08-30T00:25:28Z",
67+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#hpack",
68+
"source": "devbox-search",
69+
"version": "0.35.2",
70+
"systems": {
71+
"aarch64-darwin": {
72+
"store_path": "/nix/store/b7snhj7r0fh1sl71cw93pbhissln6k9x-hpack-0.35.2"
73+
},
74+
"aarch64-linux": {
75+
"store_path": "/nix/store/chm820695sg2cgaydmdz2a4mfpf3xhin-hpack-0.35.2"
76+
},
77+
"x86_64-darwin": {
78+
"store_path": "/nix/store/9376qjb2q0ivhgbgjagbdwgw1y3ap1j1-hpack-0.35.2"
79+
},
80+
"x86_64-linux": {
81+
"store_path": "/nix/store/hm6h9vfhbg28vxphldz2czmr2iygz2bw-hpack-0.35.2"
82+
}
83+
}
84+
},
85+
"stack@latest": {
86+
"last_modified": "2023-08-30T00:25:28Z",
87+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#stack",
88+
"source": "devbox-search",
89+
"version": "2.11.1",
90+
"systems": {
91+
"aarch64-darwin": {
92+
"store_path": "/nix/store/vnrlr792q350sh9vdd9za6dd41d4iizg-stack-2.11.1"
93+
},
94+
"aarch64-linux": {
95+
"store_path": "/nix/store/8xqxnhjq9x1cnbq5gmlx9c0sqzvnnf8y-stack-2.11.1"
96+
},
97+
"x86_64-darwin": {
98+
"store_path": "/nix/store/2nb8nvaydd6sv7cnb1yvyf31l8zwipmi-stack-2.11.1"
99+
},
100+
"x86_64-linux": {
101+
"store_path": "/nix/store/57zyr8q733kksfd82f9fqlnl28s3c48m-stack-2.11.1"
102+
}
103+
}
104+
},
105+
"zlib@latest": {
106+
"last_modified": "2023-08-30T00:25:28Z",
107+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#zlib",
108+
"source": "devbox-search",
109+
"version": "1.2.13",
110+
"systems": {
111+
"aarch64-darwin": {
112+
"store_path": "/nix/store/j7a8wqyszcg3vlw0m9ra2jwiyl4hskwj-zlib-1.2.13"
113+
},
114+
"aarch64-linux": {
115+
"store_path": "/nix/store/6ry5810krihf58jqm21zcn578km564kv-zlib-1.2.13"
116+
},
117+
"x86_64-darwin": {
118+
"store_path": "/nix/store/zlk4993fq3zbd23js5xziykz63a0iiyr-zlib-1.2.13"
119+
},
120+
"x86_64-linux": {
121+
"store_path": "/nix/store/i039srr9s4li309rclbm3421ifavgl0g-zlib-1.2.13"
122+
}
123+
}
8124
}
9125
}
10126
}

examples/development/java/gradle/hello-world/devbox.lock

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,55 @@
44
"binutils@latest": {
55
"last_modified": "2023-05-01T16:53:22Z",
66
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#binutils",
7-
"version": "2.40"
7+
"version": "2.40",
8+
"systems": {
9+
"aarch64-darwin": {
10+
"store_path": "/nix/store/9s260h7wxnb6lc5sdpm3mnkvnln9pymd-binutils-wrapper-2.40"
11+
},
12+
"aarch64-linux": {
13+
"store_path": "/nix/store/1j5h9v08436jjm9lxpqyrcqbp40d13xi-binutils-wrapper-2.40"
14+
},
15+
"x86_64-darwin": {
16+
"store_path": "/nix/store/7bac4s1gyclv2sxczqqvj6bmdg0h4xz2-binutils-wrapper-2.40"
17+
},
18+
"x86_64-linux": {
19+
"store_path": "/nix/store/cyb4bb44krf4ghw8qasa03sxi2k4g6a4-binutils-wrapper-2.40"
20+
}
21+
}
822
},
923
"gradle@latest": {
10-
"last_modified": "2023-05-01T16:53:22Z",
11-
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#gradle",
12-
"version": "8.0.1"
24+
"last_modified": "2023-08-30T00:25:28Z",
25+
"plugin_version": "0.0.1",
26+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#gradle",
27+
"source": "devbox-search",
28+
"version": "8.3",
29+
"systems": {
30+
"aarch64-darwin": {
31+
"store_path": "/nix/store/4xjjls354jr8w7083qxsrpfs1fgl80fj-gradle-8.3"
32+
},
33+
"aarch64-linux": {
34+
"store_path": "/nix/store/f0l5fscvcl9yand9jfpk5icr2ac8qx2v-gradle-8.3"
35+
},
36+
"x86_64-darwin": {
37+
"store_path": "/nix/store/rxm9mpxswrd77fd6lafqcxaxizjlk1l4-gradle-8.3"
38+
},
39+
"x86_64-linux": {
40+
"store_path": "/nix/store/qvp5jiik6q27qwlgiq80fx96wyh0r0nb-gradle-8.3"
41+
}
42+
}
1343
},
1444
"jdk@19": {
1545
"last_modified": "2023-05-01T16:53:22Z",
1646
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#jdk",
17-
"version": "19.0.2+7"
47+
"version": "19.0.2+7",
48+
"systems": {
49+
"aarch64-linux": {
50+
"store_path": "/nix/store/bdqk85ckifa9xjnz6p2hznc6y54156nn-openjdk-19.0.2+7"
51+
},
52+
"x86_64-linux": {
53+
"store_path": "/nix/store/i2j4s6qcjzlya4ssi2dpf7qnxw2vsaxm-openjdk-19.0.2+7"
54+
}
55+
}
1856
}
1957
}
20-
}
58+
}

examples/development/java/maven/hello-world/devbox.lock

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,54 @@
44
"binutils@latest": {
55
"last_modified": "2023-05-01T16:53:22Z",
66
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#binutils",
7-
"version": "2.40"
7+
"version": "2.40",
8+
"systems": {
9+
"aarch64-darwin": {
10+
"store_path": "/nix/store/9s260h7wxnb6lc5sdpm3mnkvnln9pymd-binutils-wrapper-2.40"
11+
},
12+
"aarch64-linux": {
13+
"store_path": "/nix/store/1j5h9v08436jjm9lxpqyrcqbp40d13xi-binutils-wrapper-2.40"
14+
},
15+
"x86_64-darwin": {
16+
"store_path": "/nix/store/7bac4s1gyclv2sxczqqvj6bmdg0h4xz2-binutils-wrapper-2.40"
17+
},
18+
"x86_64-linux": {
19+
"store_path": "/nix/store/cyb4bb44krf4ghw8qasa03sxi2k4g6a4-binutils-wrapper-2.40"
20+
}
21+
}
822
},
923
"jdk@19": {
1024
"last_modified": "2023-05-01T16:53:22Z",
1125
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#jdk",
12-
"version": "19.0.2+7"
26+
"version": "19.0.2+7",
27+
"systems": {
28+
"aarch64-linux": {
29+
"store_path": "/nix/store/bdqk85ckifa9xjnz6p2hznc6y54156nn-openjdk-19.0.2+7"
30+
},
31+
"x86_64-linux": {
32+
"store_path": "/nix/store/i2j4s6qcjzlya4ssi2dpf7qnxw2vsaxm-openjdk-19.0.2+7"
33+
}
34+
}
1335
},
1436
"maven@latest": {
15-
"last_modified": "2023-05-01T16:53:22Z",
16-
"resolved": "github:NixOS/nixpkgs/8670e496ffd093b60e74e7fa53526aa5920d09eb#maven",
17-
"version": "3.8.6"
37+
"last_modified": "2023-08-30T00:25:28Z",
38+
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#maven",
39+
"source": "devbox-search",
40+
"version": "3.9.4",
41+
"systems": {
42+
"aarch64-darwin": {
43+
"store_path": "/nix/store/a9mn00rx76fhipjd6mvh1wpww94lwrnj-apache-maven-3.9.4"
44+
},
45+
"aarch64-linux": {
46+
"store_path": "/nix/store/k3b451zvvcrwkj60ghnsn12vrdx6za2r-apache-maven-3.9.4"
47+
},
48+
"x86_64-darwin": {
49+
"store_path": "/nix/store/idjx4zav3bn5ykdb63k3n1z1jcraprzm-apache-maven-3.9.4"
50+
},
51+
"x86_64-linux": {
52+
"store_path": "/nix/store/8a5s443s3hyzikd2jkgpfa7289xgd01z-apache-maven-3.9.4"
53+
}
54+
}
1855
}
1956
}
20-
}
57+
}

0 commit comments

Comments
 (0)