Skip to content

fix: reject non-object workflow caches - #3860

Open
marcelsafin wants to merge 2 commits into
github:mainfrom
marcelsafin:fix/workflow-cache-shapes
Open

fix: reject non-object workflow caches#3860
marcelsafin wants to merge 2 commits into
github:mainfrom
marcelsafin:fix/workflow-cache-shapes

Conversation

@marcelsafin

Copy link
Copy Markdown
Contributor

Summary

  • treat non-object workflow and step cache metadata as invalid
  • refetch when a cached workflow catalog is not a JSON object
  • reject non-object stale cache fallbacks instead of returning unusable data

Testing

  • uvx ruff@0.15.0 check src tests
  • .venv/bin/python -m pytest -q tests/test_workflows.py (821 passed)
  • .venv/bin/python -m pytest -q (6011 passed, 173 skipped)

AI disclosure

GitHub Copilot helped identify edge cases and review the implementation. I reproduced the failures and validated the final change with targeted and full test suites.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 29, 2026 18:05
@marcelsafin
marcelsafin requested a review from mnriem as a code owner July 29, 2026 18:05

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.

Pull request overview

Hardens workflow catalog caching against non-object JSON values.

Changes:

  • Rejects non-object workflow and step cache metadata.
  • Refetches invalid workflow caches and rejects invalid stale fallbacks.
  • Adds regression tests for metadata and fresh-cache behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/specify_cli/workflows/catalog.py Validates cached metadata and catalog payload types.
tests/test_workflows.py Tests invalid metadata and workflow-cache refetching.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/specify_cli/workflows/catalog.py
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 29, 2026 19:53
@marcelsafin

Copy link
Copy Markdown
Contributor Author

@copilot review

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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