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

Add task to check for deprecations #1044

Closed
wants to merge 24 commits into from
Closed

Conversation

bonjourmauko
Copy link
Member

@bonjourmauko bonjourmauko commented Sep 24, 2021

Follows discussion on #1033
Depended upon by #1045

New features

  • Introduce make check-deprecated
    • Allows for listing the features marked as deprecated.

Example:

$ make check-deprecated

[⚙] Check for features marked as deprecated...
[!] commons.dummy.__init__:17 => Deprecated since: 34.7.0. Expiration status: 36.0.0 (current: 36.0.0).
[/] 18%  |█████████·········································|

@bonjourmauko bonjourmauko requested review from a team and MattiSG September 24, 2021 17:23
@bonjourmauko bonjourmauko added the kind:refactor Refactoring and code cleanup label Sep 24, 2021
@bonjourmauko bonjourmauko force-pushed the deprecation-check branch 3 times, most recently from d350959 to 1636f03 Compare September 25, 2021 18:58
@bonjourmauko bonjourmauko added the kind:theme A group of issues, directly tied to an OKR label Sep 29, 2021
@bonjourmauko bonjourmauko modified the milestone: Improve testing & releases Sep 29, 2021
@bonjourmauko bonjourmauko added kind:roadmap A group of issues, constituting a delivery roadmap and removed kind:theme A group of issues, directly tied to an OKR labels Sep 29, 2021
@bonjourmauko
Copy link
Member Author

As discussed over the phone @MattiSG , I'd need a resolution on this one, as a lot of what is to come for #1061 , #1062 , and #1063 , depends on this.

By the way what I'm proposing here is just a way to soft-deprecate things, not to deprecate them —thus to defer the deprecating thing after the aforementioned issues are complete.

Copy link
Member

@MattiSG MattiSG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While technically exciting, this proposal has a major impact on process: since deprecation checks will be enforced, it means that it will be the responsibility of some future contributor to handle removing deprecated features, without necessarily having the associated knowledge.

To be more concrete: if on October 2021, contributor A ships an improvement along with a deprecation due for version 38; and then in July 2022, contributor B gets a PR accepted for a major change leading to version 38 being released, then they will get an automated check blocking shipping. Contributor A is maybe not available, and no one clearly understands what the deprecation does anymore.
Can we just rely on prior knowledge for deprecation? How can we be sure that contributor B cleanly removes all references to the deprecated feature? How do we let the community know?

I believe this warrants a wider discussion and a community agreement on the deprecation process. The current system is not satisfactory, as depreciations are never followed upon and the codebase is crippled with remnants. However, the proposed system dilutes responsibility and I foresee production problems. To me, it is worth questioning the added value of deprecation under semver: why not just ship a breaking change? Reusers are free to upgrade (or not) whenever they want, and I doubt anyone actually upgrades their code before it breaks. Are the gains in advance notice really worth the added administrative costs, process complexity, and testing code?

@@ -1,5 +1,24 @@
# Changelog

# 36.0.0 [#1044](https://github.com/openfisca/openfisca-core/pull/1044)

Follows discussion on #1033
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary in the CHANGELOG.

@bonjourmauko
Copy link
Member Author

bonjourmauko commented Oct 7, 2021

@MattiSG True, but the concrete use-case for me is the one discussed in #1015 : this provides a way to have feature A and B at the same time, so to adapt country template, extension template, and so on.

So while I see the scenario you mention, for me we were not to say "let's deprecate this in 3 majors", but exactly to group deprecations together while working on an epic/theme, and having the time to update dependent libraries.

I agree however in the misuse it can lead to, I see the benefits.

For example, numpy does this kind of soft-deprecation, and we've already received input from users telling us of warnings they're getting from numpy —yes, people who do not filter warnings exist.

So the main concern you address could be expressed as "if I set a deprecation, I should also expire it".

Would making that contract explicit make this better than the actual system for you?

Beyond that, indeed this would greatly benefit from a broader community discussion.

@MattiSG
Copy link
Member

MattiSG commented Oct 11, 2021 via email

@bonjourmauko
Copy link
Member Author

A good example of this is #1015 :

  • I expired a deprecation
  • Tests failed => country template
  • PR open in country template to adapt to the new API

The whole in 5m, no need for the intricacies of the past (installing from a branch, etc.).

Clean, easy, repeatable, feedback-driven.

@bonjourmauko
Copy link
Member Author

Did not create consensus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:refactor Refactoring and code cleanup kind:roadmap A group of issues, constituting a delivery roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants