Skip to content

Update strawberry to latest#4598

Open
patrick91 wants to merge 2 commits intomainfrom
upgrade-strawberry
Open

Update strawberry to latest#4598
patrick91 wants to merge 2 commits intomainfrom
upgrade-strawberry

Conversation

@patrick91
Copy link
Copy Markdown
Member

:)

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pycon Error Error Mar 31, 2026 7:12pm

@patrick91 patrick91 marked this pull request as ready for review March 31, 2026 18:02
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.46%. Comparing base (ecaeda3) to head (c15641e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4598   +/-   ##
=======================================
  Coverage   92.46%   92.46%           
=======================================
  Files         359      359           
  Lines       10760    10765    +5     
  Branches      816      816           
=======================================
+ Hits         9949     9954    +5     
  Misses        699      699           
  Partials      112      112           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 31, 2026

This PR upgrades strawberry-graphql from 0.257.0 to 0.312.2 and replaces the custom Info dataclass with a TypeAlias pointing to StrawberryInfo[Context, Any].

Inconsistent Info imports not fully resolved

Several files still import the raw, unparameterized strawberry.types.Info instead of api.context.Info: api/submissions/types.py, api/grants/mutations.py, api/pretix/mutations.py, api/schedule/mutations/change_schedule_item_slot.py, api/schedule/mutations/create_schedule_item.py, api/users/types.py. The point of introducing the typed alias is proper inference of info.context.request.user etc. — leaving these on the unparameterized import defeats that. Similarly, api/extensions.py (lines 17, 23, 40) still uses strawberry.Info without the Context type parameter.

Dead parameter

api/schedule/types/slot.py end_hour takes info: Info but never uses it — it could be a plain @strawberry.field with no info argument.

Test fidelity

test_extensions.py replaces Mock() with SimpleNamespace, which is more explicit but still not type-checked against the actual Info type contract. create_autospec or MagicMock(spec=StrawberryInfo) would catch signature mismatches. Given 55 minor versions skipped, an integration-level test exercising at least one real GraphQL request end-to-end would provide more confidence than unit tests alone.

@patrick91
Copy link
Copy Markdown
Member Author

@claude fix both the dead param and test fidelty

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 31, 2026

Claude finished @patrick91's task in 1m 51s —— View job


Fixing dead parameter and test fidelity

  • Read backend/api/schedule/types/slot.py to understand the dead info parameter
  • Remove unused info: Info parameter from end_hour field
  • Read backend/api/tests/test_extensions.py to understand current test setup
  • Update tests to use MagicMock(spec=StrawberryInfo) for better type checking
  • Commit and push changes

Summary

Fixed both issues:

  1. Dead parameter removed: Removed the unused info: Info parameter from the end_hour method in backend/api/schedule/types/slot.py:37

  2. Test fidelity improved: Replaced SimpleNamespace mocks with MagicMock(spec=StrawberryInfo) in backend/api/tests/test_extensions.py - this ensures the mock will raise AttributeError if code accesses attributes not defined on StrawberryInfo, catching signature mismatches
    |

- Remove unused `info: Info` parameter from `end_hour` method in slot.py
- Replace SimpleNamespace with MagicMock(spec=StrawberryInfo) in test_extensions.py
  for better type checking against the actual Info interface

Co-authored-by: Patrick Arminio <patrick91@users.noreply.github.com>
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