Skip to content

Commit fb2db9e

Browse files
TS0713crivetimihai
andauthored
Edit a2a agent functionality, minor view screen and filterEntities via tag fixes (#1270)
* edit functionality for a2a agents, minor changes in add a2a agents/view a2a agents, fixed filter entities via tags for prompts/resources/a2a agents Signed-off-by: Satya <[email protected]> Please enter the commit message for your changes. Lines starting with '#' will be ignored, and an empty message aborts the commit. interactive rebase in progress; onto 878f350 Last command done (1 command done): pick 6a2f4cf edit functionality for a2a agents, minor changes in add a2a agents/view a2a agents, fixed filter entities via tags for prompts/resources/a2a agents Next commands to do (2 remaining commands): pick 596c1c4 fixing doctest failures pick 1ecd66b lint web fixes You are currently rebasing branch 'edit_a2a_agent_functionality' on '878f350f'. Changes to be committed: modified: mcpgateway/admin.py modified: mcpgateway/db.py modified: mcpgateway/schemas.py modified: mcpgateway/services/a2a_service.py modified: mcpgateway/static/admin.js modified: mcpgateway/templates/admin.html * fixing doctest failures modified: mcpgateway/admin.py modified: mcpgateway/db.py modified: mcpgateway/schemas.py modified: mcpgateway/services/a2a_service.py modified: mcpgateway/static/admin.js modified: mcpgateway/templates/admin.html * lint web fixes Signed-off-by: Satya <[email protected]> * edit functionality for a2a, minor changes in create/view - a2a, few other minor changes, replicated populate auth, encode & decode for auth types Signed-off-by: Satya <[email protected]> * fixed tests Signed-off-by: Satya <[email protected]> * fixing doctests * made fixes - doctests, pytest Signed-off-by: Satya <[email protected]> * added doctests for a2a_services for doctest coverage Signed-off-by: Satya <[email protected]> * minor fix in edit a2a update Signed-off-by: Satya <[email protected]> * added place holder text for filter tags for server Signed-off-by: Satya <[email protected]> * added passthrough headers - a2a agent (add/edit) Signed-off-by: Satya <[email protected]> * chore: lint fixes - add newline EOF, UTF-8 encoding, remove trailing whitespace Signed-off-by: Mihai Criveti <[email protected]> * fix: resolve pylint issues - import order and MessageToDict parameter - Fix import order in bootstrap_db.py: move sqlalchemy before alembic - Replace invalid 'always_print_fields_with_no_presence' parameter with 'including_default_value_fields' in translate_grpc.py - Parameter was removed/renamed in protobuf >=6.33.0 Pylint now passes with 10.00/10 rating. All tests continue to pass (3624 passed, 87 skipped). Signed-off-by: Mihai Criveti <[email protected]> --------- Signed-off-by: Satya <[email protected]> Signed-off-by: Mihai Criveti <[email protected]> Co-authored-by: Mihai Criveti <[email protected]>
1 parent 912bdcb commit fb2db9e

File tree

16 files changed

+3350
-770
lines changed

16 files changed

+3350
-770
lines changed

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ int-import-graph=
387387
known-standard-library=
388388

389389
# Force import order to recognize a module as part of a third party library.
390-
known-third-party=enchant
390+
known-third-party=enchant,alembic
391391

392392
# Couples of modules and preferred modules, separated by a comma.
393393
preferred-modules=

alembic/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Generic single-database configuration.

alembic/env.py

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# -*- coding: utf-8 -*-
2+
from logging.config import fileConfig
3+
4+
from sqlalchemy import engine_from_config
5+
from sqlalchemy import pool
6+
7+
from alembic import context
8+
9+
# this is the Alembic Config object, which provides
10+
# access to the values within the .ini file in use.
11+
config = context.config
12+
13+
# Interpret the config file for Python logging.
14+
# This line sets up loggers basically.
15+
if config.config_file_name is not None:
16+
fileConfig(config.config_file_name)
17+
18+
# add your model's MetaData object here
19+
# for 'autogenerate' support
20+
# from myapp import mymodel
21+
# target_metadata = mymodel.Base.metadata
22+
target_metadata = None
23+
24+
# other values from the config, defined by the needs of env.py,
25+
# can be acquired:
26+
# my_important_option = config.get_main_option("my_important_option")
27+
# ... etc.
28+
29+
30+
def run_migrations_offline() -> None:
31+
"""Run migrations in 'offline' mode.
32+
33+
This configures the context with just a URL
34+
and not an Engine, though an Engine is acceptable
35+
here as well. By skipping the Engine creation
36+
we don't even need a DBAPI to be available.
37+
38+
Calls to context.execute() here emit the given string to the
39+
script output.
40+
41+
"""
42+
url = config.get_main_option("sqlalchemy.url")
43+
context.configure(
44+
url=url,
45+
target_metadata=target_metadata,
46+
literal_binds=True,
47+
dialect_opts={"paramstyle": "named"},
48+
)
49+
50+
with context.begin_transaction():
51+
context.run_migrations()
52+
53+
54+
def run_migrations_online() -> None:
55+
"""Run migrations in 'online' mode.
56+
57+
In this scenario we need to create an Engine
58+
and associate a connection with the context.
59+
60+
"""
61+
connectable = engine_from_config(
62+
config.get_section(config.config_ini_section, {}),
63+
prefix="sqlalchemy.",
64+
poolclass=pool.NullPool,
65+
)
66+
67+
with connectable.connect() as connection:
68+
context.configure(
69+
connection=connection, target_metadata=target_metadata
70+
)
71+
72+
with context.begin_transaction():
73+
context.run_migrations()
74+
75+
76+
if context.is_offline_mode():
77+
run_migrations_offline()
78+
else:
79+
run_migrations_online()

alembic/script.py.mako

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""${message}
2+
3+
Revision ID: ${up_revision}
4+
Revises: ${down_revision | comma,n}
5+
Create Date: ${create_date}
6+
7+
"""
8+
from typing import Sequence, Union
9+
10+
from alembic import op
11+
import sqlalchemy as sa
12+
${imports if imports else ""}
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = ${repr(up_revision)}
16+
down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}
17+
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
18+
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
19+
20+
21+
def upgrade() -> None:
22+
"""Upgrade schema."""
23+
${upgrades if upgrades else "pass"}
24+
25+
26+
def downgrade() -> None:
27+
"""Downgrade schema."""
28+
${downgrades if downgrades else "pass"}

0 commit comments

Comments
 (0)