Repository navigation
fix(extensions): skip non-UTF-8 catalog responses - #5196
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change to handle malformed catalog responses while preserving healthy sources.
No open issues 🎉
What changed in this PR
Fixes #5195 by converting non-UTF-8 extension catalog responses into ExtensionError, allowing the existing merge logic to warn and continue with healthy sources.
Changes:
- Handles UTF-8 decoding failures alongside invalid JSON.
- Adds regression coverage for both malformed response types, verifying healthy catalogs remain available and all-source failures still raise the existing error.
The PR reports that the regression test failed before the fix and passed afterward; this comparison was not independently rerun.
| File | Description |
|---|---|
tests/test_extensions.py |
Tests malformed-source skipping, warnings, and all-source failure behavior. |
src/specify_cli/extensions/__init__.py |
Converts catalog decoding failures into the existing catalog error type. |
Review effort: Balanced (auto)
Collaborator
|
Thank you! |
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.
Description
Fixes #5195. Convert a catalog response’s UTF-8 decode error to ExtensionError so a corrupt source warns and the merge continues with healthy sources. When every source fails, the existing error remains.
Testing
.venv/bin/python -m pytest tests/test_extensions.py -q— 495 passed..venv/bin/specify --help— passed.git diff --checkpassed. The broader Ruff check reported 237 findings outside the changed lines.AI Disclosure
AI disclosure: Codex (GPT-6, default reasoning effort, autonomous) generated the code and test and ran validation. No human review or testing is claimed.