Skip to content

Migrate off deprecated Synapse APIs and fail tests that use them - #47

Merged
gormaniac merged 3 commits into
mainfrom
claude/ecstatic-carson-rndfji
Nov 1, 2026
Merged

gormaniac merged 3 commits into
mainfrom
claude/ecstatic-carson-rndfji

Conversation

@gormaniac

Copy link
Copy Markdown
Owner

Audits StormLib++ against everything Synapse 2.256.0 (the last 2.x release) marks deprecated, migrates off it, and makes the tests fail when deprecated Synapse APIs are used.

Deprecated usage fixed

Deprecated Where Fix
$lib.dict() / $lib.list() dnsstorm, ipinfo, stix ({}) / ([]) literals
synapse_minversion package key every package (and the test protos) synapse_version: ">=2.162.0,<3.0.0"
Command forms key lookup-storm, report-ingest, stix cmdinputs, or dropped where there were no inputs
synapse.tools.genpkg stormlibpp.stormpkg, scripts/pkgs/*.sh, docs synapse.tools.storm.pkg.gen
synapse.tools.feed stormlibpp.hfeed synapse.tools.cortex.feed
aiohttp read_timeout HttpCortex timeout=aiohttp.ClientTimeout(total=None, sock_connect=30), which behaves the same as before

Fixes

  • hfeed, hstorm, and import were broken on current Synapse. synapse.tools.feed.makeargparser() is gone, and synapse.tools.storm no longer exports StormCli/StormCompleter/welcome (they live in synapse.tools.storm._cli).
  • ipinfo never sent its API token. The Authorization header was a plain double-quoted string, so it sent the literal text Bearer {$token}. It's a backtick format string now.

Deprecation checks in pytest

Synapse reports deprecations through log messages, not Python's warnings module, so filterwarnings can't catch them. The new tests/conftest.py:

  • collects deprecation messages from the synapse loggers and from Storm warn messages for each test, and fails the test if it finds any;
  • ignores two Cortex startup messages that aren't about the code under test;
  • lists deprecations logged outside a test (ex. at import time) in the terminal summary instead of failing;
  • lets a test opt out with @pytest.mark.allow_synapse_deprecations.

pyproject.toml also makes Python DeprecationWarnings raised from stormlibpp errors. The dnsstorm test's stormHasNoWarnErr check, commented out over the $lib.dict() warnings, is back on.

Other changes

  • Requires synapse>=2.225.0,<3 (was >=2.139.0), since that's where the new tool module paths appeared. The Pipfile's synapse = "*" gets the same range.
  • Patch bumps every Storm package, and adds an Unreleased CHANGELOG entry.

Testing

  • pytest tests against Synapse 2.256.0: 30 passed, with no Synapse deprecations inside or outside tests. Before this change the same suite had 5 errors from deprecations, plus the genpkg import deprecation.
  • python -m synapse.tools.storm.lint src/pkgs reports no $lib.dict()/$lib.list().

Not in this PR

  • The stix package has Storm syntax errors that predate this change (slib.stix.ingest.storm:16, slib.stix.lib.storm:17), so it can't load into a Cortex. Several files also call $lib.debug(...), but $lib.debug is a boolean, not a function.
  • Synapse 3.x readiness: --v3-ready lint findings (ex. $lib.true, $lib.globals.get(), $lib.user, inet:ipv4) aren't deprecated in 2.x, so they're left alone.
  • Once this is released, the services in stormsvcs need a stormlibpp bump to drop the synapse.tools.genpkg deprecation they log at import.

Generated by Claude Code

- Replace $lib.dict()/$lib.list() with ({})/([]) literals (dnsstorm, ipinfo, stix).
- Use synapse_version instead of synapse_minversion in every package, and
  cmdinputs instead of the deprecated command forms key.
- Import synapse.tools.storm.pkg.gen instead of the deprecated
  synapse.tools.genpkg, here and in the package build scripts.
- Fix hfeed and stormcli for current Synapse: synapse.tools.feed no longer has
  makeargparser() and synapse.tools.storm no longer exports StormCli.
- Use aiohttp's timeout argument instead of the deprecated read_timeout.
- Fix the ipinfo Authorization header, it was a plain string, not a format string.
- Require synapse>=2.225.0, where the tools moved.
- Add tests/conftest.py, which fails any test that logs a Synapse deprecation,
  and turn Python DeprecationWarnings from stormlibpp into errors.
- Patch bump every Storm package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KBLBzjs3FWt5tMeTsVjC79
@gormaniac

Copy link
Copy Markdown
Owner Author

Claude code review to remove multiple deprecated features in Storm and Python code

@gormaniac
gormaniac merged commit db5963e into main Nov 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants