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

Document deprecation for API functions #865

Closed
5 tasks
inknos opened this issue Sep 4, 2023 · 3 comments · Fixed by #2020
Closed
5 tasks

Document deprecation for API functions #865

inknos opened this issue Sep 4, 2023 · 3 comments · Fixed by #2020
Assignees
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Milestone

Comments

@inknos
Copy link
Collaborator

inknos commented Sep 4, 2023

Currently, DNF5 does not have a clear policy on how to deprecate public API functions. We should document the process and be clear on how to intervene in such instances.
Take this commit, which generated the discussion, as an example.

  • Firstly, considering that DNF5's API is stable, we should remind in the documentation the deprecation steps that we would follow. As an example, we could follow Fedora release steps, the deprecation process should be documented e.g.,
    1. Announcing deprecation during one fedora release
    2. Removing the function on the next fedora, or something like that.
  • document how deprecation is handled as warnings in the codebase. There are three steps that should be targeted:
    • build time warning: how should warnings be handled and how noisy should the deprecation warnings be at build time
    • runtime warning: how should warnings be printed when using the C++ API or the Python API at runtime
    • documentation warning: currently, warnings are just a word in the docs, they are not visible enough. See here. This should be automated and generally improved to avoid confusion.
@github-project-automation github-project-automation bot moved this to Backlog in DNF team Sep 4, 2023
@j-mracek j-mracek moved this from Backlog to Todo in DNF team Sep 20, 2023
@j-mracek j-mracek added this to the Fedora 40 milestone Sep 20, 2023
@j-mracek j-mracek added Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels Sep 20, 2023
@jan-kolarik jan-kolarik moved this from Todo to Backlog in DNF team Apr 15, 2024
@jan-kolarik jan-kolarik modified the milestones: Fedora 40, Fedora 41 Apr 15, 2024
@jan-kolarik jan-kolarik changed the title Document deprecation for dnf5 api functions Document deprecation for API functions Apr 15, 2024
@jan-kolarik
Copy link
Member

The current approach to handling deprecated methods has been reported as insufficient by our API clients. Before implementing any changes, we should review existing standards to increase the likelihood of detecting issues using the existing CI checkers deployed by our dependents.

@jan-kolarik
Copy link
Member

I think it’s time to decide on an approach here. Following @inknos’s proposal, here are my suggestions:

🕙 Deprecation timeline documentation

Align with Fedora release cycles: mark objects or methods as deprecated at the start of a release and remove them in the subsequent release. Document this approach in our documentation.

📢 Deprecation signaling implementation

Documentation visibility

Mark deprecated elements in docstrings with @deprecated and apply a custom style to make this tag more visible in upstream docs.

Optionally, create a dedicated deprecation list section.

Build-time warnings for C++ users

Use [[deprecated]], which has been standard since C++14.

Runtime user notifications

Define e.g. a LIBDNF_DEPRECATED macro wrapper to log a warning to stderr whenever a deprecated method is called.
Question: Should this also apply to C++ API users, even though they already receive a build-time warning?

@jan-kolarik
Copy link
Member

WRT

Align with Fedora release cycles: mark objects or methods as deprecated at the start of a release and remove them in the subsequent release. Document this approach in our documentation.

After team discussions, we’ve decided to extend the deprecation period to allow users a smoother transition to the new API. Deprecations will be announced on the public mailing list and GitHub, with periodic reminders to remaining users of the deprecated API. Once all respondents have migrated, we will schedule the final removal.

@jan-kolarik jan-kolarik moved this from Backlog to Todo in DNF team Nov 26, 2024
@jan-kolarik jan-kolarik modified the milestones: Fedora 41, Fedora 42 Nov 26, 2024
@kontura kontura self-assigned this Feb 11, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in DNF team Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants