forked from Cleboost/codegraph-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Implement new MCP http server to support as GA service and new storages #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7634904
Implement MCP server for GA
hungpham10 b6c6b7e
Setup unit-tests to new storages
hungpham10 c0f6aed
style: apply rustfmt
hungpham10 1794b0f
Potential fix for pull request finding 'CodeQL / Workflow does not co…
hungpham10 86333f7
Add tests
hungpham10 2584dd5
Fix tests
hungpham10 420efae
Fix tests
hungpham10 8817f72
Fix tests
hungpham10 c947c12
Fix lint
hungpham10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| name: Integration (Postgres / MySQL / Redis) | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| # Chạy test tích hợp trên backend thật (Postgres/MySQL/Redis) qua service | ||
| # container của GitHub Actions. Schema được apply thủ công (`sql/<engine>/*`) | ||
| # trước khi chạy test — khớp thiết kế "migration thủ công" của repo. | ||
| # | ||
| # Test trong `tests/rdbms.rs` / `tests/redis.rs` bị `#[ignore]` và chỉ chạy khi | ||
| # có DSN tương ứng → không ảnh hưởng `cargo test` thường (CI chính ở ci.yml). | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| clippy-gated: | ||
| name: clippy (rdbms + redis test targets) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: clippy | ||
| - uses: Swatinem/rust-cache@v2 | ||
| # Đảm bảo các file test gated (tests/rdbms.rs, tests/redis.rs) vẫn | ||
| # clippy-sạch dù CI chính chỉ build với default features. | ||
| - run: cargo clippy -p codegraph-graph --features postgres,mysql,redis --tests -- -D warnings | ||
|
|
||
| postgres: | ||
| name: postgres | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| postgres: | ||
| image: postgres:16 | ||
| env: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_DB: codegraph | ||
| ports: | ||
| - 5432:5432 | ||
| options: >- | ||
| --health-cmd "pg_isready -U postgres" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| env: | ||
| TEST_RDBMS_DSN: "postgres://postgres:postgres@127.0.0.1:5432/codegraph" | ||
| TEST_RDBMS_REPO_ID: "1" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - name: Install postgresql-client | ||
| run: sudo apt-get update && sudo apt-get install -y postgresql-client | ||
| - name: Apply schema (manual migration) | ||
| run: | | ||
| psql "$TEST_RDBMS_DSN" -f sql/postgres/001-initial-schema.sql | ||
| psql "$TEST_RDBMS_DSN" -f sql/postgres/002-add-repos-registry.sql | ||
| - name: Run integration tests | ||
| run: cargo test -p codegraph-graph --features postgres --test rdbms -- --ignored --nocapture | ||
|
|
||
| mysql: | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| name: mysql | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| mysql: | ||
| image: mysql:8 | ||
| env: | ||
| MYSQL_ROOT_PASSWORD: postgres | ||
| MYSQL_DATABASE: codegraph | ||
| ports: | ||
| - 3306:3306 | ||
| options: >- | ||
| --health-cmd "mysqladmin ping -h 127.0.0.1 -u root -ppostgres" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| env: | ||
| TEST_RDBMS_DSN: "mysql://root:postgres@127.0.0.1:3306/codegraph" | ||
| TEST_RDBMS_REPO_ID: "1" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - name: Install mysql-client | ||
| run: sudo apt-get update && sudo apt-get install -y mysql-client | ||
| - name: Apply schema (manual migration) | ||
| run: | | ||
| mysql -h 127.0.0.1 -P 3306 -u root -ppostgres codegraph < sql/mysql/001-initial-schema.sql | ||
| mysql -h 127.0.0.1 -P 3306 -u root -ppostgres codegraph < sql/mysql/002-add-repos-registry.sql | ||
| - name: Run integration tests | ||
| run: cargo test -p codegraph-graph --features mysql --test rdbms -- --ignored --nocapture | ||
|
|
||
| redis: | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| name: redis | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| redis: | ||
| image: redis:7 | ||
| ports: | ||
| - 6379:6379 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| env: | ||
| TEST_REDIS_DSN: "redis://127.0.0.1:6379" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| # Unit test nội bộ (storage/redis.rs) chạy trên DB 15. | ||
| - name: Run storage unit tests | ||
| run: cargo test -p codegraph-graph --features redis | ||
| # Integration test (GraphIndex roundtrip) chạy trên DB 0 (DSN mặc định). | ||
| - name: Run integration tests | ||
| run: cargo test -p codegraph-graph --features redis --test redis -- --ignored --nocapture | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.