fix(metadata): tolerate absent/null jira, bugs, packages in JSONParser#214
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #214 +/- ##
=======================================
Coverage 86.43% 86.43%
=======================================
Files 159 159
Lines 8832 8832
=======================================
Hits 7634 7634
Misses 1198 1198 ☔ View full report in Codecov by Harness. |
b39fe96 to
b022034
Compare
JSONParser.parse iterated data.get("jira"), data.get("bugs") and
data.get("packages").items() with no default, so a metadata blob missing any of
those keys (or carrying an explicit null) raised TypeError and aborted the parse.
Fall back to empty (or [] / {}), matching the existing data.get("repositories",
[]) handling.
b022034 to
cbf19a6
Compare
mimi1vx
approved these changes
Jun 23, 2026
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.
JSONParser.parseiterated three metadata keys with no default:If any key is absent (or explicitly
null),.get()returnsNoneand theloop /
.items()raisesTypeError, aborting the whole parse. The currentmetadata.json contract always carries these keys, so it doesn't fire today — but
a partial or malformed blob shouldn't crash the parser, and the sibling line
already does the right thing (
data.get("repositories", [])).Fix
data.get("jira") or [],data.get("bugs") or [], and(data.get("packages") or {}).items()(handles both missing and null).Test
test_json_parser_parse_tolerates_missing_optional_keysparses a minimal blob(keys absent,
packagesnull) and asserts empty results. Verified it fails onthe old code (
TypeError) and passes on the fix.Gates: ruff format/check clean, ty clean, pytest green.
🤖 Generated with Claude Code