InvForge: multi-vendor inverter/BESS Modbus TCP emulator - #2
Merged
Conversation
Vendor-agnostic core engine (register/scenario/state/generator/ connectivity), a Sigenergy SigenStor profile built from real device captures, Docker/docker-compose support, and a unit+integration test suite runnable locally or in CI.
CodeQL (security-and-quality query suite) runs on push/PR against main plus a weekly schedule. Unit test coverage is measured via pytest-cov and uploaded as a Cobertura report so the repo's code_coverage ruleset rule (75% minimum, 10-point max drop) has real data to enforce. Note: unit-only coverage is currently ~50% -- control_api.py, connectivity.py, and __main__.py are exercised by the integration suite instead, which runs the app in a separate Docker container that pytest-cov can't instrument. Closing that gap is tracked as follow-up work, not hidden.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
- __main__.py: parser.error() isn't statically guaranteed to exit, so add explicit returns rather than relying on argparse's default sys.exit(2) behavior (py/uninitialized-local-variable, 2 findings). - generator.py/profile.py/scenario.py: suppress py/unsafe-cyclic-import with an explanation -- not a real runtime cycle, profile.py's reciprocal import is TYPE_CHECKING-guarded and never executes; mypy already resolves it fine (4 findings, all false positives). - ci.yml: fail-on-error: false on the coverage upload step -- it 404s until "Code Quality" is turned on in repo Settings (no API for that toggle), which shouldn't hard-fail the whole unit job in the meantime.
The prior TYPE_CHECKING-guarded import wasn't a real runtime cycle, but CodeQL's py/unsafe-cyclic-import flagged it anyway, and inline codeql[] suppression comments didn't take for this query (still 4 findings after adding them). Simpler to actually remove the cycle: RampParams moves to its own core/ramp_params.py with no dependency on either generator.py or profile.py, so profile.py can import it directly instead of only under TYPE_CHECKING.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Test plan