Skip to content

Commit 7fc496f

Browse files
committed
Merge remote-tracking branch 'origin/compatible' into lyh/compat-into-dev-nov17-2025
2 parents dceadf6 + 3b078bf commit 7fc496f

File tree

91 files changed

+3501
-48209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+3501
-48209
lines changed

buildkite/scripts/check-compatibility.sh

Lines changed: 0 additions & 220 deletions
This file was deleted.

buildkite/scripts/entrypoints/run-hardfork-package-gen.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,43 +76,43 @@ function to_dhall_list() {
7676
echo "$dhall_list"
7777
}
7878

79-
if [[ -z "$CODENAMES" ]]; then
79+
if [[ -z "${CODENAMES:-}" ]]; then
8080
usage "CODENAMES environment variable is required"
8181
fi
8282

83-
if [[ -z "$NETWORK" ]]; then
83+
if [[ -z "${NETWORK:-}" ]]; then
8484
usage "NETWORK environment variable is required"
8585
fi
8686

87-
if [[ -z "$CONFIG_JSON_GZ_URL" ]]; then
87+
if [[ -z "${CONFIG_JSON_GZ_URL:-}" ]]; then
8888
usage "CONFIG_JSON_GZ_URL environment variable is required"
8989
fi
9090

9191
# Format GENESIS_TIMESTAMP as Optional Text for Dhall
92-
if [[ -z "$GENESIS_TIMESTAMP" ]]; then
92+
if [[ -z "${GENESIS_TIMESTAMP:-}" ]]; then
9393
GENESIS_TIMESTAMP="None Text"
9494
else
9595
# shellcheck disable=SC2089
9696
GENESIS_TIMESTAMP="(Some \"${GENESIS_TIMESTAMP}\")"
9797
fi
9898

9999
# Format VERSION as Optional Text for Dhall
100-
if [[ -z "$VERSION" ]]; then
100+
if [[ -z "${VERSION:-}" ]]; then
101101
VERSION="(None Text)"
102102
else
103103
# shellcheck disable=SC2089
104104
VERSION="(Some \"${VERSION}\")"
105105
fi
106106

107107
# Format PRECOMPUTED_FORK_BLOCK_PREFIX as Optional Text for Dhall
108-
if [[ -z "$PRECOMPUTED_FORK_BLOCK_PREFIX" ]]; then
108+
if [[ -z "${PRECOMPUTED_FORK_BLOCK_PREFIX:-}" ]]; then
109109
PRECOMPUTED_FORK_BLOCK_PREFIX="(None Text)"
110110
else
111111
# shellcheck disable=SC2089
112112
PRECOMPUTED_FORK_BLOCK_PREFIX="(Some \"${PRECOMPUTED_FORK_BLOCK_PREFIX}\")"
113113
fi
114114

115-
DHALL_CODENAMES=$(to_dhall_list "$CODENAMES" "$DEBIAN_VERSION_DHALL_DEF.DebVersion")
115+
DHALL_CODENAMES=$(to_dhall_list "${CODENAMES:-}" "$DEBIAN_VERSION_DHALL_DEF.DebVersion")
116116

117117
# shellcheck disable=SC2089
118118
printf '%s.generate_hardfork_package %s %s.Type.%s %s "%s" "%s" %s %s\n' \

buildkite/src/Command/ArchiveNodeTest.dhall

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ in { step =
1919
[ "ARCHIVE_TEST_APP=mina-archive-node-test"
2020
, "MINA_TEST_NETWORK_DATA=/etc/mina/test/archive/sample_db"
2121
]
22-
( RunWithPostgres.ScriptOrArchive.Script
23-
"src/test/archive/sample_db/archive_db.sql"
22+
( Some
23+
( RunWithPostgres.ScriptOrArchive.Script
24+
"src/test/archive/sample_db/archive_db.sql"
25+
)
2426
)
2527
( Artifacts.fullDockerTag
2628
Artifacts.Tag::{

buildkite/src/Command/PatchArchiveTest.dhall

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ in { step =
1919
[ "PATCH_ARCHIVE_TEST_APP=mina-patch-archive-test"
2020
, "NETWORK_DATA_FOLDER=/etc/mina/test/archive/sample_db"
2121
]
22-
( RunWithPostgres.ScriptOrArchive.Script
23-
"./src/test/archive/sample_db/archive_db.sql"
22+
( Some
23+
( RunWithPostgres.ScriptOrArchive.Script
24+
"./src/test/archive/sample_db/archive_db.sql"
25+
)
2426
)
2527
( Artifacts.fullDockerTag
2628
Artifacts.Tag::{

buildkite/src/Command/ReplayerTest.dhall

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ in { step =
1717
, commands =
1818
[ RunWithPostgres.runInDockerWithPostgresConn
1919
([] : List Text)
20-
( RunWithPostgres.ScriptOrArchive.Script
21-
"./src/test/archive/sample_db/archive_db.sql"
20+
( Some
21+
( RunWithPostgres.ScriptOrArchive.Script
22+
"./src/test/archive/sample_db/archive_db.sql"
23+
)
2224
)
2325
( Artifacts.fullDockerTag
2426
Artifacts.Tag::{

buildkite/src/Command/RunWithPostgres.dhall

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ for database-dependent operations.
1212
1313
**Parameters:**
1414
- `environment : List Text` - Additional environment variables to pass to the container
15-
- `initScript : Text` - Path to SQL initialization script to run against the database
15+
- `initScript : Optional ScriptOrArchive` - Optional database initialization. Either a script path or an archive + script selector.
1616
- `docker : Text` - Docker image name to run the main command in
1717
- `innerScript : Text` - Script or command to execute inside the Docker container
1818
@@ -46,7 +46,6 @@ for database-dependent operations.
4646
- `PG_CONN` - Full database connection string
4747
-}
4848

49-
5049
let Prelude = ../External/Prelude.dhall
5150

5251
let P = Prelude
@@ -62,9 +61,9 @@ let ScriptOrArchive
6261
= < Script : Text | Archive : { Script : Text, Archive : Text } >
6362

6463
let runInDockerWithPostgresConn
65-
: List Text -> ScriptOrArchive -> Text -> Text -> Cmd.Type
64+
: List Text -> Optional ScriptOrArchive -> Text -> Text -> Cmd.Type
6665
= \(environment : List Text)
67-
-> \(initScript : ScriptOrArchive)
66+
-> \(initScript : Optional ScriptOrArchive)
6867
-> \(docker : Text)
6968
-> \(innerScript : Text)
7069
-> let port = "5432"
@@ -103,15 +102,23 @@ let runInDockerWithPostgresConn
103102

104103
let runInitScript =
105104
merge
106-
{ Script =
107-
\(script : Text)
108-
-> [ "docker exec ${postgresDockerName} psql ${pg_conn} -f /workdir/${script}"
109-
]
110-
, Archive =
111-
\(archive : { Script : Text, Archive : Text })
112-
-> [ "tar -xzf ${archive.Archive}"
113-
, "docker exec ${postgresDockerName} find /workdir -name \"${archive.Script}\" -exec psql ${pg_conn} -f {} \\;"
114-
]
105+
{ Some =
106+
\(script : ScriptOrArchive)
107+
-> merge
108+
{ Script =
109+
\(s : Text)
110+
-> [ "docker exec ${postgresDockerName} psql ${pg_conn} -f /workdir/${s}"
111+
]
112+
, Archive =
113+
\ ( archive
114+
: { Script : Text, Archive : Text }
115+
)
116+
-> [ "tar -xzf ${archive.Archive}"
117+
, "docker exec ${postgresDockerName} find /workdir -name \"${archive.Script}\" -exec psql ${pg_conn} -f {} \\;"
118+
]
119+
}
120+
script
121+
, None = [] : List Text
115122
}
116123
initScript
117124

0 commit comments

Comments
 (0)