Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Refactoring [1/3]: renames for better terminology #209

Merged
merged 5 commits into from
Oct 23, 2019

Conversation

nolar
Copy link
Contributor

@nolar nolar commented Oct 22, 2019

Code refactoring (part 1 of 3): terminology fixes and look-ahead alignments.

Issue : preparation for #59 #187 #142
Followed by #210 (part 2/3), #211 (part 3/3).

Description

This PR is purely for renaming the classes and methods (massive, but simple) — a part of the code refactoring needed to extend Kopf with the startup/cleanup/(re-)authentication background activities.

Adding "activities" requires some terminology corrections, specifically naming the "resource"-related causes/handlers/registries as such.

Now: they exist as the only possible form of causes/handlers/registries. Adding the activity-specialised classes/methods in addition to generic-looking but resource-specialised classes/methods will create a confusion.

Briefly:

  • custom_object_handler -> resource_handler (to be paired with activity_handler).
  • SimpleRegistry -> ResourceRegistry (to be paired with ActivityRegistry)
  • GlobalRegistry -> OperatorRegistry (for the legacy method extraction & deprecation later).
  • ..._event_watching_... -> ..._resource_watching_... (causes, handlers, registries).
  • ..._state_changing_... -> ..._resource_changing_... (causes, handlers, registries).
  • get_state -> get_essence (a leftover from Annotate all the code with the types #200: the "state" word is reserved for the reactor's state persistance, and should not be used for the resources' minified bodies (now: "essence")).

There are NO behavioral changes. The public interfaces are kept unmodified. These are the internal changes only.

Some of these renames were introduced in #202, and never were released yet (despite merged to master), so it is safe to rename it again without breaking the public interfaces of any Kopf version.

Types of Changes

  • Refactor/improvements

@nolar nolar requested a review from samurang87 as a code owner October 22, 2019 23:14
@zincr
Copy link

zincr bot commented Oct 22, 2019

🤖 zincr found 0 problems , 1 warning

ℹ️ Large Commits
✅ Approvals
✅ Specification
✅ Dependency Licensing

Details on how to resolve are provided below


Large Commits

Checks all commits for large additions to a single file. Large commits should be reviewed more carefully for potential copyright and licensing issues

This file contains a substantial change, please review to determine if the change comes from an external source and if there are any copyright or licensing issues to be aware of

  • ℹ️ kopf/reactor/registries.py had +100 lines of code changed in a single commit
    Please review this file to determine the source of this change
     

@nolar nolar added the refactoring Code cleanup without new features added label Oct 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
refactoring Code cleanup without new features added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants