Rework hooks interface for v2.0.0

Registered by Dmitry Tantsur

I'd like to use backward-incompatible version 2.0.0 as a chance to rethink our plugin interface. I see the following problems:
1. cached_node (aka NodeInfo) is not passed into plugins, thus they can't change e.g. options
2. return value with patches is extremely vague
3. it's impossible to add new arguments without breaking existing plugins
4. hook namespace assumes there will be only one type of hooks
5. confusion between 2 use cases of "node info"

I.
node_cache.NodeInfo class will be modified to carry node and ports attributes.
Optional arguments node and ports are added to __init__.
Accessors node and ports are added to the class. They will either use node and ports provided into __init__, or load them from Ironic and cache.

II.
before_update interface is modified:

 def before_update(self, introspection_data, node_info, node_patches, ports_patches, **kwargs) -> None

III.
before_processing is modified:

 def before_processing(self, introspection_data, **kwargs) -> None

addition of **kwargs will make future updates possible.

IV.
change hook namespace to ironic_inspector.hooks.processing to account for more hook types

Blueprint information

Status:
Complete
Approver:
Dmitry Tantsur
Priority:
Essential
Drafter:
Dmitry Tantsur
Direction:
Approved
Assignee:
Dmitry Tantsur
Definition:
Approved
Series goal:
Accepted for liberty
Implementation:
Implemented
Milestone target:
milestone icon 2.0.0
Started by
Dmitry Tantsur
Completed by
Dmitry Tantsur

Related branches

Sprints

Whiteboard

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.