Skip to content

fix(connect): parse bare array from tag content endpoint in VIP sweep - #748

Merged
ian-flores merged 2 commits into
mainfrom
fix-connect-tag-content-list
Oct 1, 2026
Merged

ian-flores merged 2 commits into
mainfrom
fix-connect-tag-content-list

Conversation

@ian-flores

Copy link
Copy Markdown
Collaborator

GET /v1/tags/{id}/content returns a bare JSON array (listTagContent is type: array in the Connect OpenAPI spec), but list_vip_content called .get("results", []) on it. That raised AttributeError, wrapped as ProductUnreachableError, 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 direct list_vip_content test 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.

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.
Copilot AI balanced review requested due to automatic review settings September 30, 2026 17:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 results field.
  • 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.

@ian-flores
ian-flores marked this pull request as ready for review October 1, 2026 23:29
@ian-flores
ian-flores merged commit 21de7be into main Oct 1, 2026
49 checks passed
@ian-flores
ian-flores deleted the fix-connect-tag-content-list branch October 1, 2026 23:29
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-01 23:30 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants