Repository navigation
fix(connect): parse bare array from tag content endpoint in VIP sweep - #748
Merged
Merged
Conversation
GET /v1/tags/{id}/content returns a bare JSON array, but list_vip_content called .get("results", []) on it, raising AttributeError that was wrapped as ProductUnreachableError. The end-of-run sweep therefore never deleted any tagged content and only logged that it could not reach the tag API; the bug was hidden until 001d02b stopped returning [] on failure. Return the array directly and correct the selftest fixture that mocked the wrong shape.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The targeted fix matches the endpoint contract and is adequately covered by selftests.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes Connect cleanup by correctly parsing the tag-content endpoint’s bare JSON array.
Changes:
- Returns tag content directly instead of reading a nonexistent
resultsfield. - Corrects the cleanup mock and adds focused regression coverage.
| File | Description |
|---|---|
src/vip/clients/connect.py |
Parses the tag-content response correctly. |
selftests/test_connect_cleanup.py |
Updates fixtures and adds regression coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
This was referenced Oct 2, 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.
GET /v1/tags/{id}/content returns a bare JSON array (
listTagContentistype: arrayin the Connect OpenAPI spec), butlist_vip_contentcalled.get("results", [])on it. That raisedAttributeError, wrapped asProductUnreachableError, so the end-of-run sweep never deleted any tagged content and only logged "end-of-run Connect content sweep could not reach the tag API" at teardown. The bug was hidden until 001d02b stopped returning[]on failure.This returns the array directly and corrects the selftest fixture that mocked the wrong
{"results": [...]}shape, which is why the bug went unnoticed. It adds a directlist_vip_contenttest with independent literals. Both tests failed with the nightly's exact error before the fix.I did not check whether older Connect versions return a different shape; the local OpenAPI spec shows only the array.