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

Purge all deprecated methods and classes for v1.x #511

Merged
merged 19 commits into from Dec 28, 2020
Merged

Conversation

nolar
Copy link
Owner

@nolar nolar commented Aug 20, 2020

Drop all features that were declared deprecated a long time ago. The exact list is below — with the supposed replacements.

  • cooldown= option of decorators → backoff=.
  • event kwarg in @kopf.on.eventreason.
  • cause kwarg in handlers → use all kwargs directly.
  • kopf.login() sync function → async activity internally.
  • kopf.config module → settings kwarg of @on.startup() handlers.
  • get_pykube_cfg() for patching → @on.login() handlers.
  • HandlerFatalErrorPermanentError
  • HandlerRetryErrorTemporaryError
  • kopf.create_tasks() (sync) → kopf.spawn_tasks() (async).
  • kopf.events.[event|info|warn|exception]() → the same directly in kopf module.
  • None for labels=/annotations= filters → kopf.PRESENT (None now raises exceptions).
  • Positional field in @on.field('group', 'v1', 'plural', 'field') → kwarg field='field' instead.
  • Unversioned keys in storages → generate v1/v2 keys explicitly.
  • Storages with unprefixed annotations → prefix is now mandatory; defaults to kopf.zalando.org/….
  • @kopf.on.this() for sub-handlers → @kopf.subhandler() (for readability)

Most of these legacies are extremely old and it is highly unlikely that they were used in any existing operators. In any case, the DeprecationWarnings were issued for all these features, so there should be enough time to switch.

THIS IS A BREAKING CHANGE. => Major version increase is required.

Unlike #625 (dropping the legacy registries), these features are not difficult to maintain in backwards-compatible mode. However, since #625 is now required for the reactor's refactoring, and therefore the major version has to be increased — it seems like a good idea to also drop all other legacies from the code to make it cleaner.


PREVIOUS DESCRIPTION:

This PR is a preview of what will be dropped from the next major release (1.0) when it happens.

There are no specific dates or estimations or even criteria of readiness for 1.0. But the preparations can be performed now.

All deprecated classes and methods and functions do issue warnings now (DeprecationWarning), so the operator developers should pay attention to them and switch to the recommended constructs.

This branch is regularly synced with the recent master — to keep the release-1.0-look-ahead code always up to date and tested.

Replaces #316 zalando-incubator/kopf#316

@nolar nolar added the refactoring Code cleanup without new features added label Aug 20, 2020
@lgtm-com
Copy link

lgtm-com bot commented Aug 20, 2020

This pull request fixes 1 alert when merging 421e187 into caaf399 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Sep 12, 2020

This pull request introduces 5 alerts and fixes 1 when merging a3c1f66 into d712db2 - view on LGTM.com

new alerts:

  • 5 for Unused import

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Sep 13, 2020

This pull request introduces 5 alerts when merging 0adabf4 into 7567d71 - view on LGTM.com

new alerts:

  • 5 for Unused import

@nolar nolar force-pushed the release-1.0-purge branch 2 times, most recently from ccbe85d to c9233e8 Compare September 13, 2020 10:00
@nolar nolar added the breaking Changes that break backwards compatibility of the public interface label Dec 28, 2020
@nolar nolar changed the title [Preview] Purge all deprecated methods and classes for 1.0 Purge all deprecated methods and classes for 1.x Dec 28, 2020
@nolar nolar changed the title Purge all deprecated methods and classes for 1.x Purge all deprecated methods and classes for v1.x Dec 28, 2020
@nolar nolar marked this pull request as ready for review December 28, 2020 23:20
@lgtm-com
Copy link

lgtm-com bot commented Dec 28, 2020

This pull request introduces 1 alert when merging 72a3276 into 878a5af - view on LGTM.com

new alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Dec 28, 2020

This pull request fixes 2 alerts when merging 3c5aef2 into 878a5af - view on LGTM.com

fixed alerts:

  • 2 for Unused import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Changes that break backwards compatibility of the public interface refactoring Code cleanup without new features added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant