Skip to content

feat: person search endpoint#9062

Merged
jennifer-richards merged 5 commits intoietf-tools:feat/rpc-apifrom
jennifer-richards:rpc-person-search
Jun 27, 2025
Merged

feat: person search endpoint#9062
jennifer-richards merged 5 commits intoietf-tools:feat/rpc-apifrom
jennifer-richards:rpc-person-search

Conversation

@jennifer-richards
Copy link
Copy Markdown
Member

This is the datatracker side of ietf-tools/purple#365. Adds a paginated search endpoint for Persons.

I'm conflicted on naming. The names here (RpcPerson*) follow the pattern we've been using with rpc prefixes, but have the decidedly awful result that the purple view works with something called an RpcPerson that is not purple's rpc.models.RpcPerson. Suggestions welcome.

Note that this is starting to use DRF for the datatracker's purple interface. We have so far only used that for things supporting red. The motivation here is not having to implement custom pagination. The schema changes to rpcapi.yaml were done by generating a schema via spectacular and manually pulling in the relevant bits. We will want to make that process better, but I think that's a separate project.

Comment thread ietf/api/views_rpc.py Outdated
Comment thread rpcapi.yaml Outdated
Comment thread ietf/person/models.py
Comment thread ietf/api/urls_rpc.py
url(r"^person/persons_by_email/$", views_rpc.persons_by_email),
url(r"^person/(?P<person_id>[0-9]+)/$", views_rpc.rpc_person),
url(r"^persons/$", views_rpc.rpc_persons),
url(r"^persons/search/", views_rpc.RpcPersonSearch.as_view()),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

General question: Isn't Rpc and rpc_ are redundent because these already in views_rpc?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think so, but I didn't want to violate the convention we've been using so far in this PR. My inclination is to do a follow-up PR that refactors a bunch of this, including getting rid of the hand-crufted rpcapi.yaml.

These names aren't exposed through the API schema so the impacts both of this being a bad name and of changing the names in a later PR shouldn't impact the purple API client. We should be able to match the existing schema with a generated one, at least pretty closely.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

(Having the prefix in the method/class names is nice if you want to do a from views_rpc import rpc_whatever but I don't think we're likely to do it that way.)

Copy link
Copy Markdown
Member

@kesara kesara Jun 26, 2025

Choose a reason for hiding this comment

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

(not relevant to this PR), should persons_by_email should be rpc_persons_by_email?
What I struggle with is difference between rpc prefixed person and non-rpc prefixed person in views_rpc.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I guess we weren't as consistent as I thought at a glance. On the datatracker side, there's no such thing as an RpcPerson except where the Rpc is a prefix.

Purple has an RpcPerson model that represents someone who has a role with the RPC - editor, manager, etc.

  * improved naming of operation/components in API schema
  * reused Person schema component
  * added serializers_rpc.py
@jennifer-richards jennifer-richards requested a review from kesara June 26, 2025 15:19
Better matches the hand-written schema.
Including ascii / ascii_short might be useful eventually, but since we only show plain_name in the response it can cause confusing results.

By the same reasoning we could remove email__address as well, but that's useful and I expect we'll include email addresses in our response soon anyway.
@jennifer-richards jennifer-richards merged commit 38fda63 into ietf-tools:feat/rpc-api Jun 27, 2025
2 checks passed
@jennifer-richards jennifer-richards deleted the rpc-person-search branch June 27, 2025 01:45
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants