Skip to content

Commit da4a15b

Browse files
Merge remote-tracking branch 'origin/main' into fix/set-evaluation-snapshot
2 parents 64254a1 + cbea20f commit da4a15b

80 files changed

Lines changed: 5182 additions & 881 deletions

Some content is hidden

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

.github/workflows/clippy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Clippy
22
on:
33
pull_request:
4+
merge_group:
45
push:
56
branches: [main]
67

.github/workflows/fmt.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Format
22
on:
33
pull_request:
4+
merge_group:
45
push:
56
branches: [main]
67

.github/workflows/integration.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Integration Tests
2+
on:
3+
pull_request:
4+
merge_group:
5+
push:
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
run-integration:
13+
runs-on: ubuntu-latest
14+
services:
15+
postgres:
16+
image: postgres:16
17+
env:
18+
POSTGRES_PASSWORD: devpass
19+
options: >-
20+
--health-cmd "pg_isready -U postgres"
21+
--health-interval 5s
22+
--health-timeout 5s
23+
--health-retries 5
24+
ports:
25+
- 5432:5432
26+
27+
steps:
28+
- uses: actions/checkout@v6
29+
30+
- uses: dtolnay/rust-toolchain@stable
31+
32+
- uses: Swatinem/rust-cache@v2
33+
with:
34+
cache-on-failure: true
35+
36+
- name: Build release
37+
run: cargo build --release
38+
39+
- name: Initialize ExtendDB
40+
id: init
41+
run: |
42+
output=$(./target/release/extenddb init --config extenddb.toml \
43+
--pg-host 127.0.0.1 --pg-port 5432 --pg-user postgres --pg-pass devpass 2>&1)
44+
echo "$output"
45+
password=$(echo "$output" | grep -oP 'Password: \K\S+')
46+
echo "admin_password=$password" >> "$GITHUB_OUTPUT"
47+
48+
- name: Start ExtendDB
49+
run: |
50+
./target/release/extenddb serve --config extenddb.toml --foreground &
51+
for i in $(seq 1 30); do
52+
if curl -sk https://127.0.0.1:8000/health | grep -q healthy; then
53+
echo "Server ready"
54+
exit 0
55+
fi
56+
sleep 1
57+
done
58+
echo "Server failed to start"
59+
exit 1
60+
61+
- uses: actions/setup-python@v5
62+
with:
63+
python-version: "3.12"
64+
65+
- name: Install Python dependencies
66+
run: pip install -r requirements.txt
67+
68+
- name: Run integration tests
69+
env:
70+
EXTENDDB_TEST_ENDPOINT: https://127.0.0.1:8000
71+
EXTENDDB_ADMIN_USER: admin
72+
EXTENDDB_ADMIN_PASSWORD: ${{ steps.init.outputs.admin_password }}
73+
EXTENDDB_TEST_PG_ADMIN_CONNECTION_STRING: postgresql://postgres:devpass@127.0.0.1:5432
74+
run: devtools/run-tests --extenddb --pytest --comprehensive --parallel --filter "not import_export"
75+
76+
integration:
77+
runs-on: ubuntu-latest
78+
needs: run-integration
79+
if: always()
80+
steps:
81+
- run: |
82+
if [ "${{ needs.run-integration.result }}" != "success" ]; then
83+
exit 1
84+
fi

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Test
22
on:
33
pull_request:
4+
merge_group:
45
push:
56
branches: [main]
67

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ axum = { version = "0.8", features = ["macros"] }
4848
tower = { version = "0.5", features = ["util"] }
4949
tower-http = { version = "0.6", features = ["compression-gzip", "cors", "set-header"] }
5050
hyper = { version = "1" }
51+
urlencoding = { version = "2.1" }
5152

5253
# Database plugin registry
5354
inventory = "0.3"

crates/bin/src/cmd_init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub struct InitArgs {
2828
#[arg(long)]
2929
catalog_db: Option<String>,
3030

31-
/// PostgreSQL host
31+
/// PostgreSQL host (hostname, IP address, or absolute Unix socket directory path)
3232
#[arg(long)]
3333
pg_host: Option<String>,
3434

crates/bin/src/cmd_serve.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,9 @@ pub fn run(args: &ServeArgs) -> anyhow::Result<()> {
7979
);
8080
}
8181

82-
// Check backend is supported by this build
82+
// Validate backend is supported and get catalog version (fail fast before binding port)
8383
let backend = &app_config.storage._backend;
84-
#[cfg(not(feature = "postgres"))]
85-
if backend == "postgres" {
86-
anyhow::bail!("PostgreSQL backend not enabled. Rebuild with --features postgres");
87-
}
88-
#[cfg(feature = "postgres")]
89-
if backend != "postgres" {
90-
anyhow::bail!(
91-
"Unknown backend '{}'. This build only supports 'postgres'.",
92-
backend
93-
);
94-
}
84+
let catalog_version = extenddb_storage::operations::catalog_version(backend)?;
9585

9686
let port = args.port.unwrap_or(app_config.server.port);
9787
let bind_addr = format!("{}:{}", app_config.server.bind_addr, port);
@@ -112,9 +102,6 @@ pub fn run(args: &ServeArgs) -> anyhow::Result<()> {
112102
// it to stderr so a process supervisor receives banner and tracing logs
113103
// on the same stream — mixing stdout and stderr makes container log
114104
// capture noisier than necessary.
115-
let backend = &app_config.storage._backend;
116-
let catalog_version = extenddb_storage::operations::catalog_version(backend)
117-
.unwrap_or_else(|_| "unknown".to_string());
118105
let banner_line1 = format!(
119106
"extenddb {} (catalog {}) starting on {}",
120107
env!("CARGO_PKG_VERSION"),

crates/bin/src/config.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
use extenddb_core::limits::LimitsConfig;
77
use serde::Deserialize;
88

9-
#[derive(Debug, Clone, Default, Deserialize)]
9+
#[derive(Debug, Clone, Deserialize)]
1010
#[serde(deny_unknown_fields)]
1111
pub struct AppConfig {
1212
#[serde(default)]
1313
pub server: ServerConfig,
14-
#[serde(default)]
1514
pub storage: StorageConfig,
1615
/// Auth provider configuration. `provider = "builtin"` for `SigV4` with
1716
/// local credential store. The server refuses to start with `provider = "none"`.
@@ -180,6 +179,7 @@ impl<'de> serde::Deserialize<'de> for StorageConfig {
180179
}
181180
}
182181

182+
#[cfg(feature = "postgres")]
183183
impl Default for StorageConfig {
184184
fn default() -> Self {
185185
Self {
@@ -315,6 +315,7 @@ pub fn expand_tilde(path: &str) -> String {
315315
}
316316
path.to_owned()
317317
}
318+
#[cfg(feature = "postgres")]
318319
fn default_backend() -> String {
319320
"postgres".to_owned()
320321
}

crates/bin/src/serve_helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub fn pid_file_path(run_dir: &str, port: u16) -> PathBuf {
9292
/// PID file path using the default run directory. Used by `status` when
9393
/// no config file is loaded.
9494
pub fn pid_file_path_default(port: u16) -> PathBuf {
95-
let run_dir = config::AppConfig::default().server.run_dir;
95+
let run_dir = config::ServerConfig::default().run_dir;
9696
pid_file_path(&run_dir, port)
9797
}
9898

0 commit comments

Comments
 (0)