Skip to content

Conversation

@mattf
Copy link
Collaborator

@mattf mattf commented Dec 4, 2025

What does this PR do?

Remove RESOURCES list with string method names and replace with explicit typed calls for each resource type. Extract common registration logic into _register_resource helper with generic type parameters.

  • Add ListResourcesResponse[ResourceT] generic base class to resource.py
  • Update all list response types to inherit from generic base
  • Replace getattr-based method lookup with direct impl method calls
  • Add proper type hints using PEP 695 generics (InputT: BaseModel, ResourceT: Resource)

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 4, 2025
@mattf mattf marked this pull request as ready for review December 5, 2025 12:19
pass


RESOURCES = [
Copy link
Contributor

Choose a reason for hiding this comment

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

thank you! it was quite terrible

@mergify
Copy link

mergify bot commented Dec 10, 2025

This pull request has merge conflicts that must be resolved before it can be merged. @mattf please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Dec 10, 2025
Copy link
Contributor

@ashwinb ashwinb left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@leseb leseb left a comment

Choose a reason for hiding this comment

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

please resolve the conflicts

…ct method calls

Remove RESOURCES list with string method names and replace with explicit
typed calls for each resource type. Extract common registration logic
into _register_resource helper with generic type parameters.

- Add ListResourcesResponse[ResourceT] generic base class to resource.py
- Update all list response types to inherit from generic base
- Replace getattr-based method lookup with direct impl method calls
- Add proper type hints using PEP 695 generics (InputT: BaseModel, ResourceT: Resource)
@ashwinb ashwinb force-pushed the squash-clever-resource-registration branch from 664c1ac to 94de40a Compare December 16, 2025 19:02
@mergify mergify bot removed the needs-rebase label Dec 16, 2025
@ashwinb ashwinb force-pushed the squash-clever-resource-registration branch 3 times, most recently from d919dc0 to 94de40a Compare December 16, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants