Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR] Simplify registries: no prefixes, direct sub-registries access #315

Closed
3 of 5 tasks
kopf-archiver bot opened this issue Aug 18, 2020 · 0 comments
Closed
3 of 5 tasks

[PR] Simplify registries: no prefixes, direct sub-registries access #315

kopf-archiver bot opened this issue Aug 18, 2020 · 0 comments
Labels
archive refactoring Code cleanup without new features added

Comments

@kopf-archiver
Copy link

kopf-archiver bot commented Aug 18, 2020

A pull request by nolar at 2020-02-20 12:54:51+00:00
Original URL: zalando-incubator/kopf#315
Merged by nolar at 2020-02-20 16:05:16+00:00

What do these changes do?

Refactor the registries massively, to prepare for even more registry and handler types.

Description

Originally, there were sub-registries and one operator registry consisting of sib-registries. And the operator registry was exposing multiple registed_blah_blah_handler(), [has|get|iter]_blah_blah_handlers() methods, so on.

As the number of handler type increases, having these proxying methods becomes a problem: they do nothing, just proxy to the actual sub-registries (simple lists), but bring a lot of method signatures that has to be maintained and tested.

With this PR, we remove all of these proxying methods completely (technically, deprecate them and warn if they are used, but keep them for a while until the next major release).

The sub-registries should now be used directly, and its handlers should be accesses via the similar methods (same-named, but different typing signatures: e.g. [get|iter]_handlers(...)).

Purpose: In the following PRs, even more registry and handler types will be added: e.g. daemons & timers. Not having even more proxying methods seems convenient.


Also, registries prefixes are removed. They were used for the sub-handlers only. Now, the prefixes are implemented directly for sub-handler decorators.

Since registries were never created directly by the users (unlike the accessing methods above), we have no need to keep backward compatible changes for deprecated prefixes — we just drop them.


The end users should not be affected (in theory).

Issues/PRs

Issues: #19

Related: #298

Type of changes

  • Refactoring (non-breaking change which does not alter the behaviour)

Checklist

  • The code addresses only the mentioned problem, and this problem only
  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
@kopf-archiver kopf-archiver bot closed this as completed Aug 18, 2020
@kopf-archiver kopf-archiver bot changed the title [archival placeholder] [PR] Simplify registries: no prefixes, direct sub-registries access Aug 19, 2020
@kopf-archiver kopf-archiver bot added the refactoring Code cleanup without new features added label Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archive refactoring Code cleanup without new features added
Projects
None yet
Development

No branches or pull requests

0 participants