Skip to content

Commit

Permalink
Decommission agent_based_api.v1: completely remove
Browse files Browse the repository at this point in the history
We still keep the implementation at cmk.agent_based.v0
(as it is reused in v2), but this removes its exposure
under cmk.base.

Change-Id: I150700c6b6a29d013d306cc6a7bdced573a213cf
  • Loading branch information
mo-ki committed Oct 22, 2024
1 parent 66593c5 commit cc1a04a
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 976 deletions.
429 changes: 0 additions & 429 deletions cmk/base/api/agent_based/register/export.py

This file was deleted.

17 changes: 0 additions & 17 deletions cmk/base/plugins/agent_based/__init__.py

This file was deleted.

13 changes: 0 additions & 13 deletions cmk/base/plugins/agent_based/agent_based_api/__init__.py

This file was deleted.

88 changes: 0 additions & 88 deletions cmk/base/plugins/agent_based/agent_based_api/v1/__init__.py

This file was deleted.

10 changes: 0 additions & 10 deletions cmk/base/plugins/agent_based/agent_based_api/v1/clusterize.py

This file was deleted.

25 changes: 0 additions & 25 deletions cmk/base/plugins/agent_based/agent_based_api/v1/register.py

This file was deleted.

32 changes: 0 additions & 32 deletions cmk/base/plugins/agent_based/agent_based_api/v1/render.py

This file was deleted.

45 changes: 0 additions & 45 deletions cmk/base/plugins/agent_based/agent_based_api/v1/type_defs.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def _names(space: ModuleType) -> set[str]:
def test_v1() -> None:
expected = {
# value_store: not explicitly exposed here,
# not at all exposed in the old location under cmk/base/plugins/agent_based/agent_based/api
"value_store",
# register: only partially in this package, b/c that is not how we're doing things anymore.
"register",
Expand Down
44 changes: 1 addition & 43 deletions tests/pylint/checker_cmk_module_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,23 +400,6 @@ def _allow_for_cmk_update_config(
)


def _is_allowed_for_agent_based_api_exposure_under_plugins(
*,
imported: ModuleName,
component: Component, # pylint: disable=unused-argument
) -> bool:
return any(
(
_in_component(imported=imported, component=Component("cmk.agent_based.v1")),
_in_component(imported=imported, component=Component("cmk.base.api.agent_based")),
_in_component(
imported=imported,
component=Component("cmk.base.plugins.agent_based.agent_based_api"),
),
)
)


def _is_allowed_for_plugins(
*,
imported: ModuleName,
Expand Down Expand Up @@ -478,33 +461,13 @@ def _is_allowed_for_robotmk_rulesets_cee_plugins(
)


def _is_allowed_for_agent_based_plugin(
*,
imported: ModuleName,
component: Component, # pylint: disable=unused-argument
) -> bool:
return any(
(
_in_component(
imported=imported,
component=Component("cmk.base.plugins.agent_based.agent_based_api"),
),
_in_component(
imported=imported,
component=Component("cmk.base.plugins.agent_based.utils"),
),
_in_component(imported=imported, component=Component("cmk.plugins")),
)
)


def _allow_default_plus_component_under_test(
*,
imported: ModuleName,
component: Component,
) -> bool:
if component.startswith("tests.unit.checks"):
component_under_test = Component("cmk.base.plugins.agent_based")
component_under_test = Component("cmk.plugins")
elif component.startswith("tests.unit.") or component.startswith("tests.integration"):
component_under_test = Component(".".join(component.split(".")[2:]))
else:
Expand Down Expand Up @@ -655,11 +618,6 @@ def _allow_for_cmk_piggyback_hub(
(Component("cmk.base.api.agent_based"), _allow_default_plus_fetchers_checkers_and_snmplib),
(Component("cmk.base.check_legacy_includes"), _is_allowed_for_legacy_checks),
(Component("cmk.base.legacy_checks"), _is_allowed_for_legacy_checks),
(
Component("cmk.base.plugins.agent_based.agent_based_api"),
_is_allowed_for_agent_based_api_exposure_under_plugins,
),
(Component("cmk.base.plugins.agent_based"), _is_allowed_for_agent_based_plugin),
# importing config in ip_lookup repeatedly lead to import cycles. It's cleanup now.
(Component("cmk.base.ip_lookup"), _is_default_allowed_import),
(Component("cmk.base"), _allowed_for_base_cee),
Expand Down
Loading

0 comments on commit cc1a04a

Please sign in to comment.