Skip to content

Commit 86804bb

Browse files
authored
Merge pull request #151 from IBM/tool-federation
Fix tool federation, tool refresh and provide dropdown for tools
2 parents beb7aee + 87370e5 commit 86804bb

Some content is hidden

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

42 files changed

+1599
-464
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,6 @@ RELOAD=false
244244

245245
# Enable verbose logging/debug traces
246246
DEBUG=false
247+
248+
# Gateway tool name separator
249+
GATEWAY_TOOL_NAME_SEPARATOR=-

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
66

77
---
88

9+
10+
## [0.1.2] - 2025-06-27 (pending)
11+
12+
* Allow tool federation across gateways by **allowing tools of same names** from different MCP servers to be added.
13+
* **Fix tool list refresh** from Deactivate/Activate cycles and Edit Gateway screen.
14+
* **Improve tool selection experience for servers** by allowing selection based on name from a dropdown.
15+
16+
917
## [0.2.0] - 2025-06-24
1018

1119
### Added

Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COPY . /app
2323
# Create virtual environment, upgrade pip and install dependencies using uv for speed
2424
RUN python3 -m venv /app/.venv && \
2525
/app/.venv/bin/python3 -m pip install --upgrade pip setuptools pdm uv && \
26-
/app/.venv/bin/python3 -m uv pip install ".[redis,postgres]"
26+
/app/.venv/bin/python3 -m uv pip install ".[redis,postgres,alembic]"
2727

2828
# update the user permissions
2929
RUN chown -R 1001:0 /app && \

alembic/README

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Database Migrations (Alembic)
2+
3+
This directory contains database migration scripts managed by Alembic. These scripts track and apply changes to the application's database schema over time.
4+
5+
The migration history for this project lives in the `alembic/versions/` directory.
6+
7+
---
8+
9+
## Common Workflow
10+
11+
The standard workflow involves creating, reviewing, and applying migrations.
12+
13+
- **To create a new migration:** `alembic revision --autogenerate -m "Your description"`
14+
- **To apply migrations:** `alembic upgrade head`
15+
- **To see migration history:** `alembic history`
16+
- **To see the current version:** `alembic current`
17+
18+
---
19+
20+
### 1. Creating a New Migration
21+
22+
When you change a SQLAlchemy model (e.g., in `db.py`), follow these steps to generate a migration script:
23+
24+
**Step 1: Make your model changes.**
25+
Add, remove, or alter columns and tables in your SQLAlchemy model definitions.
26+
27+
**Step 2: Autogenerate the script.**
28+
Run the following command from the project's root directory. Use a short but descriptive message.
29+
30+
```bash
31+
alembic revision --autogenerate -m "Add slug and url to gateways table"
32+
```
33+
**Step 3: Review and Edit the Script (CRITICAL STEP).**
34+
A new file will be created in alembic/versions/. Always open and review this file.
35+
36+
Autogenerate is a starting point, not a final answer. It is good at detecting new columns and tables.
37+
38+
It often requires significant manual editing for complex changes like:
39+
40+
- Data migrations (populating new columns).
41+
42+
- Renaming columns or tables.
43+
44+
- Changes that require multi-stage operations (adding a column as nullable, populating it, then making it not-nullable).
45+
46+
- Ensure the upgrade() and downgrade() functions are correct and logical.
47+
48+
### 2. Applying Migrations
49+
50+
To upgrade your database to the latest version:
51+
This command applies all pending migrations. This is the command used by developers locally and by the CI/CD pipeline during deployment.
52+
```bash
53+
alembic upgrade head
54+
```
55+
56+
To test your downgrade path (local development only):
57+
It's good practice to ensure your migrations are reversible.
58+
#### Revert the very last migration
59+
```bash
60+
alembic downgrade -1
61+
```
62+
#### You can then re-apply it
63+
```bash
64+
alembic upgrade +1
65+
```
66+
67+
### 3. Deployment Notes
68+
69+
**CI/CD:** During deployment, the alembic upgrade head command is run automatically to synchronize the database schema with the new application code before the server starts.
70+
71+
**Configuration:** The sqlalchemy.url in alembic.ini is replaced by the value set for DATABASE_URL environment variable, which env.py is configured to read.

alembic/versions/1ebe90768201_initial_schema.py

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

0 commit comments

Comments
 (0)