HYBIM-841 Galileo to splunk regex migration tool - #230
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
Generated by Claude Code Findings were verified by cross-checking ~40 rename targets against the actual SDK, cross-checking every rule against the spec in Issues Found
Questions
|
There was a problem hiding this comment.
@ridhima-splunk I didn't have time for a full review but I ran it through Claude Code and I posted its findings. Can you please triage the comments to see which ones are relevant?
Some comments like "the tool is not idempotent" may be just limitations that we need to document.
|
I have read the CLA Document and I hereby sign the CLA |
| reporter = Reporter() | ||
|
|
||
| for path in paths: | ||
| file_result = migrate_file(path, dry_run=args.dry_run, protect_in_scope=protect_in_scope) |
There was a problem hiding this comment.
The tool prints that the galileo dependency will not be removed, but protect_in_scope is passed to migrate_file() but it is never used.
| # Per-file migration | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| def migrate_file(path: Path, dry_run: bool, protect_in_scope: bool = False) -> FileResult: |
There was a problem hiding this comment.
protect_in_scope is never used.
| - `GalileoObserver` → `SplunkAOObserver` | ||
| - `galileo_*` prefixed identifiers (e.g. `galileo_session_id`) → `splunk_ao_*` | ||
| - `_galileo_` mid-identifier and attribute patterns (e.g. `func._galileo_is_retriever`, `self._handler._galileo_logger`) → `_splunk_ao_*`; the rule fires after `.`, spaces, and quotes, not just within word characters | ||
| - `GALILEO_OBSERVE_KEY` constant name → `SPLUNK_AO_OBSERVE_KEY` (the string wire value `"galileo_observe"` is intentionally left unchanged for A2A metadata compatibility) |
There was a problem hiding this comment.
This says the string wire value "galileo_observe" is intentionally left unchanged but at src/splunk_ao_migrate/rules.py:223-224, two new rules rewrite "galileo_observe" → "splunk_ao_observe".
| - **`GALILEO_OBSERVE_KEY`** — OTel interop constant name in `splunk-ao-a2a`; the tool | ||
| renames the Python constant to `SPLUNK_AO_OBSERVE_KEY` but flags it so you can verify | ||
| the wire-level string value `"galileo_observe"` is intentionally preserved for | ||
| cross-agent A2A metadata compatibility |
There was a problem hiding this comment.
This says the wire-level string value "galileo_observe" is intentionally preserved but at src/splunk_ao_migrate/rules.py:223-224, two new rules rewrite "galileo_observe" → "splunk_ao_observe".
| - **Dynamic env-var construction** (`f"GALILEO_{key}"`) — cannot be auto-rewritten; | ||
| update manually | ||
| - **`GALILEO_OBSERVE_KEY`** — OTel interop constant name in `splunk-ao-a2a`; the tool | ||
| renames the Python constant to `SPLUNK_AO_OBSERVE_KEY` but flags it so you can verify |
There was a problem hiding this comment.
It seems that this warning ("flags it") no longer exists, it was removed from WARNING_RULES (rules.py:492-531).
| splunk-ao-migrate --no-report src/ | ||
|
|
||
| # Run directly without installing | ||
| python splunk_ao_migrate/migrate.py --dry-run src/ |
There was a problem hiding this comment.
Run instructions point at a path that no longer exists. Actual location after the src-layout move: splunk_ao_migrate/src/splunk_ao_migrate/migrate.py.
| python -m splunk_ao_migrate.migrate --dry-run src/ | ||
|
|
||
| # Run with uv | ||
| uv run python splunk_ao_migrate/migrate.py --dry-run src/ |
There was a problem hiding this comment.
Run instructions point at a path that no longer exists. Actual location after the src-layout move: splunk_ao_migrate/src/splunk_ao_migrate/migrate.py.
| reporter.py ← formats and prints the migration summary report | ||
| pyproject.toml ← package metadata and entry point declaration | ||
| README.md ← this file | ||
| ``` |
There was a problem hiding this comment.
README.md:56-66 — shows migrate.py, rules.py, transformer.py, reporter.py, pyproject.toml, README.md all directly under splunk_ao_migrate/. The four modules are now under src/splunk_ao_migrate/, and tests/ is missing entirely.
| - **Not renamed**: `get_metrics()` and `set_metrics()` on `AgentStream` — these remain as live method names; only the module-level `get_evaluators()` function is the new API | ||
| - Keyword argument and parameter renames: `log_stream=` → `agent_stream=`, `log_stream_name=` → `agent_stream_name=`, `logstream=` → `agentstream=`; also catches typed parameter declarations like `log_stream: str | None = None` → `agent_stream: str | None = None` | ||
| - Config file renames: `galileo-python-config.json` → `splunk-ao-config.json`, `galileo-config.json` → `splunk-ao-config.json` | ||
| - `GALILEO_*` env-var string literals → `SPLUNK_AO_*` (including `GALILEO_API_ENDPOINT`, `GALILEO_API_KEY`, `GALILEO_CONSOLE_URL`, `GALILEO_HOME_DIR`, etc.) |
There was a problem hiding this comment.
There doesn't seem to be a rule for renaming GALILEO_API_ENDPOINT.
| Rule( | ||
| pattern=r"\blog_stream\s*=", | ||
| replacement="agent_stream=", | ||
| description="log_stream= kwarg → agent_stream=", | ||
| ), |
There was a problem hiding this comment.
This rule is dead. It is sShadowed by src/splunk_ao_migrate/rules.py:204 (Rule(r"\blog_stream\b", "agent_stream", …) in SYMBOL_RULES), which runs first because PYTHON_RULES orders SYMBOL_RULES before KWARG_RULES at rules.py:540-547.
The rules in the migration tool are based on splunk-ao-migration-tool/README.md
Tool details: MIGRATION-TOOL-README
Also refer, different migration tools: https://github.com/splunk/splunk-ao-python/blob/create-migration-tool/splunk-ao-migration-tool/MIGRATION_TOOLS_GUIDE.md
Testing:
Migrated old galileo framework examples https://github.com/rungalileo/sdk-examples/tree/main/python/agent to match with the ones in the new splunk AO: https://github.com/splunk/splunk-ao-python/tree/main/examples/agent
Also tested galileo-adk and galileo_a2a with splunk-ao-a2a and splunk-ao-adk