diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d701bd..f06efac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,7 +254,7 @@ jobs: - name: Install tarpaulin run: | if ! command -v cargo-tarpaulin &> /dev/null; then - cargo install cargo-tarpaulin + cargo install cargo-tarpaulin --version 0.33.0 fi - name: Generate coverage diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e283fde..1d9d928 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -265,6 +265,20 @@ jobs: # Update CHANGELOG.md only sed -i "s/## \[Unreleased\]/## [Unreleased]\n\n## [$VERSION] - $DATE/" CHANGELOG.md + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Update Cargo.toml and Cargo.lock + run: | + VERSION="${{ needs.validate-version.outputs.version_without_v }}" + + # Update Cargo.toml + sed -i "s/^version = .*/version = \"$VERSION\"/" Cargo.toml + + # Update Cargo.lock by running cargo check + # This ensures the lock file is in sync with the new version + cargo check - name: Configure Git run: | @@ -273,13 +287,13 @@ jobs: - name: Commit and push changes run: | - git add CHANGELOG.md + git add CHANGELOG.md Cargo.toml Cargo.lock if git diff --staged --quiet; then echo "No changes to commit" else - git commit -m "chore: update CHANGELOG.md for ${{ needs.validate-version.outputs.version }} release + git commit -m "chore: update version to ${{ needs.validate-version.outputs.version }} - Updates CHANGELOG.md with release date for version ${{ needs.validate-version.outputs.version }}. + Updates CHANGELOG.md and bumps version in Cargo.toml/lock for release ${{ needs.validate-version.outputs.version }}. [skip ci]" git push fi diff --git a/.gitignore b/.gitignore index e9168e9..1ae086d 100644 --- a/.gitignore +++ b/.gitignore @@ -150,6 +150,9 @@ atlassian-ide-plugin.xml # Cursive Clojure plugin .idea/replstate.xml +# Copilot agent +.idea/copilot.* + # SonarLint plugin .idea/sonarlint/ .idea/sonarlint.xml # see https://community.sonarsource.com/t/is-the-file-idea-idea-idea-sonarlint-xml-intended-to-be-under-source-control/121119 @@ -185,9 +188,12 @@ http-client.private.env.json # Agentic LLM Coders .claude .crush +.gemini tasks/ CLAUDE.md CRUSH.md +GEMINI.md +AGENTS.md # Project Specific config.yaml diff --git a/Cargo.lock b/Cargo.lock index 1e89a65..2e68c92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1407,7 +1407,7 @@ dependencies = [ [[package]] name = "meilibridge" -version = "0.1.5" +version = "0.1.6" dependencies = [ "async-trait", "axum", diff --git a/Cargo.toml b/Cargo.toml index a475da9..b48aca9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meilibridge" -version = "0.1.5" +version = "0.1.6" edition = "2021" rust-version = "1.82" authors = ["Omkar Todkar"] diff --git a/Makefile b/Makefile index f7ee2c3..8ca9de0 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ validate: # Show current sync status status: @echo "Checking MeiliBridge status..." - @curl -s http://localhost:7701/api/status || echo "API server not running" + @curl -s http://localhost:7701/status || echo "API server not running" # Cross-platform builds build-linux-arm64: diff --git a/docker/Dockerfile b/docker/Dockerfile index 9d5bc06..6d9201b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -101,4 +101,4 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ # Use the entrypoint script ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] -CMD ["--config", "/etc/meilibridge/config.yaml"] +CMD [] diff --git a/src/config/loader.rs b/src/config/loader.rs index 581f563..fabea69 100644 --- a/src/config/loader.rs +++ b/src/config/loader.rs @@ -101,9 +101,7 @@ impl ConfigLoader { } // Validate sync tasks - if config.sync_tasks.is_empty() { - errors.push("At least one sync task must be configured".to_string()); - } + // We allow starting with no sync tasks (can be added via API) for (i, task) in config.sync_tasks.iter().enumerate() { if task.table.is_empty() { diff --git a/src/config/mod.rs b/src/config/mod.rs index 704d61c..914964e 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -46,6 +46,7 @@ pub struct Config { pub meilisearch: MeilisearchConfig, /// Sync task definitions + #[serde(default)] pub sync_tasks: Vec, /// Redis configuration for state management diff --git a/src/source/postgres/replication/test_decoder.rs b/src/source/postgres/replication/test_decoder.rs index 38eb1fd..38c8054 100644 --- a/src/source/postgres/replication/test_decoder.rs +++ b/src/source/postgres/replication/test_decoder.rs @@ -211,7 +211,7 @@ fn tokenize_parts(input: &str) -> Vec { } ']' => { if bracket_depth > 0 { - bracket_depth -= 1; + bracket_depth = bracket_depth.saturating_sub(1); } current.push(ch); } diff --git a/tarpaulin.toml b/tarpaulin.toml index 9872c5f..c35656b 100644 --- a/tarpaulin.toml +++ b/tarpaulin.toml @@ -37,4 +37,8 @@ jobs = 4 skip-clean = false # Verbose output -verbose = true \ No newline at end of file +verbose = true + +[coverage] +# Fail if coverage is below 20% +fail-under = 20.0 \ No newline at end of file diff --git a/tests/unit/pipeline/filter_test.rs b/tests/unit/pipeline/filter_test.rs index 62ffb1e..6e10e0e 100644 --- a/tests/unit/pipeline/filter_test.rs +++ b/tests/unit/pipeline/filter_test.rs @@ -113,7 +113,7 @@ mod filter_tests { #[test] fn test_multiple_filter_criteria() { // Create events with different combinations - let events = vec![ + let events = [ create_test_event("users", EventType::Create), create_test_event("users", EventType::Update), create_test_event("posts", EventType::Create),