Skip to content

fix(workflows): refetch non-UTF-8 catalog caches - #3901

Merged
mnriem merged 1 commit into
github:mainfrom
marcelsafin:fix/catalog-cache-payload-utf8
Jul 31, 2026
Merged

fix(workflows): refetch non-UTF-8 catalog caches#3901
mnriem merged 1 commit into
github:mainfrom
marcelsafin:fix/catalog-cache-payload-utf8

Conversation

@marcelsafin

Copy link
Copy Markdown
Contributor

Summary

  • treat non-UTF-8 workflow and step cache payloads as invalid cache entries
  • refetch both catalog types instead of leaking UnicodeDecodeError
  • verify successful refetch replaces the invalid cache with valid JSON

Testing

  • uvx ruff@0.15.0 check src tests
  • .venv/bin/pytest tests/test_workflows.py -q (874 passed)
  • .venv/bin/pytest -q (6107 passed, 176 skipped)

AI disclosure

GitHub Copilot helped identify the missing cache decode boundary and review the implementation. I reproduced the failures and validated the final change with targeted and full test suites.

Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 31, 2026 08:27
@marcelsafin
marcelsafin requested a review from mnriem as a code owner July 31, 2026 08:27
Copilot AI previously approved these changes Jul 31, 2026

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.

🟢 Ready to approve

The focused exception handling and parameterized regression test correctly cover the reported failure.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Handles non-UTF-8 workflow and step catalog caches as invalid entries rather than leaking decoding errors.

Changes:

  • Catch UnicodeDecodeError during fresh-cache reads.
  • Verify both catalog types refetch and replace invalid caches.
File summaries
File Description
src/specify_cli/workflows/catalog.py Falls back to fetching when cached JSON is non-UTF-8.
tests/test_workflows.py Tests refetching and cache replacement for both catalog types.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@mnriem
mnriem requested a review from Copilot July 31, 2026 12:41
Copilot AI dismissed their stale review, a newer Copilot review was requested July 31, 2026 12:42

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.

🟢 Ready to approve

The focused fix correctly covers both catalog implementations with matching regression tests.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@mnriem
mnriem merged commit 14e8235 into github:main Jul 31, 2026
14 checks passed
@mnriem

mnriem commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

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.

3 participants