Repository navigation
GE Cloud: parse option validation text with bracketed labels without crashing (#5217) - #5218
Merged
Merged
Conversation
…crashing (#5217) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
springfall2008
commented
Sep 24, 2026
springfall2008
commented
Sep 24, 2026
springfall2008
commented
Sep 24, 2026
springfall2008
commented
Sep 24, 2026
springfall2008
commented
Sep 24, 2026
…n-paren-parse-5217
…warn once, non-string guard Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
springfall2008
marked this pull request as ready for review
September 26, 2026 12:18
philicibine
pushed a commit
to philicibine/batpred
that referenced
this pull request
Sep 28, 2026
…s); mark GH#5217 fixed by PR springfall2008#5218, correct entries overtaken by PR springfall2008#5245/springfall2008#5267/springfall2008#5147 Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
This is an automated draft PR generated from issue #5217 — a maintainer should review it before merging.
Fixes #5217
Summary
select_eventandpublish_registersingecloud.pyboth parsedValue must be one of: (a, b, c)validation strings withpre, post = validation.split("("). That raisedValueError: too many values to unpackwhenever an option label contained a(. The exception escapedpublish_registers, so the GE Cloud cycle for that site never completed.Both sites now call one module-level helper,
parse_validation_options(). It works like this:(and removes only the final). Labels such asExport (AC3)come through intact; the old.replace(")", "")would have stripped their inner brackets.Nonewhen the string has no(at all. The triage found thatsplit("(", 1)on its own would still crash on these, withnot enough values to unpack.When a string can't be parsed, the caller logs a
GECloud: Warn:line and falls back to the setting'sin:validation-rule options. It no longer raises. Results for strings that already parsed correctly are unchanged.Testing
./run_pre_commit(fromcoverage/): all hooks passed, and the quick suite passed with it.tools/triage_test.sh ge_cloudwithout the fix (gecloud.pystashed): 3 failed / 106 passed.select_event_bracketed_optionsandpublish_registers_bracketed_optionsfail with the reportedValueError: too many values to unpack.parse_validation_optionsfails with an ImportError because the helper does not exist yet.tools/triage_test.sh ge_cloudwith the fix: 109/109 passed.New tests in
apps/predbat/tests/test_ge_cloud.py:parse_validation_options: plain lists, bracketed labels, no bracket, a non-options validation string, empty string andNone.select_event_bracketed_options: a bracketed label is accepted and written, and an invalid option is still rejected. A validation string with no bracket falls back to thein:rule (accepts2, rejects3) and logs a warning.publish_registers_bracketed_options: the select entity is published with its bracketed labels intact, and an unparseable string falls back to thein:options. Registers after the bad one are still published.Notes
impact.publish_registersis MEDIUM (5 direct callers, all ingecloud.py);select_eventis LOW (no static callers; it is dispatched by event). Neither signature changed.detect_changesreports low risk. The other symbols it lists as touched show up only because their line numbers moved.publish_registerscall, so about once per settings refresh for each affected setting. I left this as it is rather than adding state to log only once.,would still be split into two options. The old code had the same limitation. The issue does not show any such label, so I left it alone.🤖 Generated with Claude Code