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

Closes #466 deprecation 20 #467

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Closes #466 deprecation 20 #467

wants to merge 10 commits into from

Conversation

bms63
Copy link
Collaborator

@bms63 bms63 commented Oct 8, 2024

Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the main branch until you have checked off each task.

  • Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
  • Code is formatted according to the tidyverse style guide. Run styler::style_file() to style R and Rmd files
  • Updated relevant unit tests or have written new unit tests, which should consider realistic data scenarios and edge cases, e.g. empty datasets, errors, boundary cases etc. - See Unit Test Guide
  • If you removed/replaced any function and/or function parameters, did you fully follow the deprecation guidance?
  • Update to all relevant roxygen headers and examples, including keywords and families. Refer to the categorization of functions to tag appropriate keyword/family.
  • Run devtools::document() so all .Rd files in the man folder and the NAMESPACE file in the project root are updated appropriately
  • Address any updates needed for vignettes and/or templates
  • Update NEWS.md under the header # admiral (development version) if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers)
  • Build admiral site pkgdown::build_site() and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.
  • Address or fix all lintr warnings and errors - lintr::lint_package()
  • Run R CMD check locally and address all errors and warnings - devtools::check()
  • Link the issue in the Development Section on the right hand side.
  • Address all merge conflicts and resolve appropriately
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@bms63 bms63 linked an issue Oct 8, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Oct 8, 2024

Code Coverage

Package Line Rate Health
admiraldev 97%
Summary 97% (1044 / 1078)

* In the first release (0-3 months), there will be a warning issued if you use the function/argument, but it will still be available to use.
* In the following release (3-6 months), an error will be produced if you use the function/argument.
* Finally, from the 3rd release (6 months) onwards, the function/argument will be removed from `{admiral}` and its documentation completely.
* In the first release (1 year), there will be a message issued if you use the function/argument, but it will still be available to use.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you suggest to have one year release cycles?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah no not really - I will reword this

vignettes/programming_strategy.Rmd Outdated Show resolved Hide resolved
Comment on lines +585 to +587
**NB:** Major/Minor release make the most sense for deprecation updates. However, if
a release cycle becomes multiple years, then patch releases should be considered to
help keep `{admiral}` neat and tidy!
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if we should make deprecation updates in patch releases (see https://r-pkgs.org/lifecycle.html#sec-lifecycle-release-type). Do we gain anything by making a patch release instead of a minor release?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we should discuss at the time of the patch - but I was really thinking far in the future here. if a lot of time has passed between releases (moved away from 1 year releases) and we have a few deprecations to progress and a quick fix for a single function then we probably should just release everything

Copy link
Collaborator

Choose a reason for hiding this comment

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

A patch release is fine for bumping a function/argument through the deprecation process. You're not making a new breaking change, rather a change in messaging to users about a change that was previously made. The breaking change/deprecation was made when the first deprecation messaging was added.

vignettes/programming_strategy.Rmd Outdated Show resolved Hide resolved
@@ -588,7 +598,7 @@ function/argument should be used instead.
The documentation will be updated at:

+ the description level for a function,
+ the `@keywords` and`@family` roxygen tags will be replaced with `deprecated`
+ the `@keywords` and `@family` roxygen tags will be replaced with `deprecated`

```{r, eval=FALSE}
#' Title of the function
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the dots in line 610 and 614 should be removed.

vignettes/programming_strategy.Rmd Outdated Show resolved Hide resolved
arguments should be passed on to the new function.

```r
fun_xxx <- function(dataset, some_param, other_param) {
deprecate_inform("x.y.z", "fun_xxx()", "new_fun_xxx()")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to specify the details argument if we want to include the date when the message will turn into a warning.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would suggest not including this much information in the deprecation messages. We've deprecated it, we're messaging the users; including information on when messaging will slightly change something we've already told them to move away from is a bit much. It also locks us into timelines unnecessarily.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

umm... yeah that makes sense to not lock ourselves in and keep things simple!!

vignettes/programming_strategy.Rmd Outdated Show resolved Hide resolved
vignettes/programming_strategy.Rmd Outdated Show resolved Hide resolved
## Unit Testing

Unit tests for deprecated functions and arguments must be added to the test file [^1] of the function to ensure that a warning or error is issued.
Unit tests for deprecated functions and arguments must be added to the test
file [^1] of the function to ensure that a warning or error is issued.

[^1]: For example, if `derive_var_example()` is going to be deprecated and
it is defined in `examples.R`, the unit tests are in
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we update line 735 to add the class issued by deprecate_inform()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes! ACtually I was wondering if we should create deprecate_inform() in this PR and start working on derive_var_dthcaus() or agree and finish the strategy first and then work on the function in a separate PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would implement deprecate_inform() in this PR. Otherwise, we are referring to a function which doesn't exist.

@@ -91,11 +91,12 @@ reference:

- title: Deprecated
desc: |
As `{admiral}` is still evolving, functions/arguments may need to be removed or replaced over time. In such cases, the function/argument will enter the following 6-month deprecation cycle:
As `{admiral}` is still evolving, functions/arguments may need to be removed or replaced over time. In such cases, the function/argument will enter a 3 year deprecation cycle:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would remove this part of the sentence, "As {admiral} is still evolving". All packages are evolving, and admiral isn't different in this way. Previously, it was evolving VERY quickly, so it made sense to include it.

* In the first release (0-3 months), there will be a warning issued if you use the function/argument, but it will still be available to use.
* In the following release (3-6 months), an error will be produced if you use the function/argument.
* Finally, from the 3rd release (6 months) onwards, the function/argument will be removed from `{admiral}` and its documentation completely.
* In the first release (1 year), there will be a message issued if you use the function/argument, but it will still be available to use.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you want to include a stage where only direct calls are messaged to users, and indirect calls are messaged to developers? Maybe split this into 6 months messaging to direct calls and devs, and 6 months to any call. This will give devs time to update their package if lower-level functions are updated.

or replaced with more efficient options from one release to another. In such
cases, the relevant function or argument must be marked as deprecated. This
deprecation is done in three phases over our release cycles.
`{admiral}` has reached a level of maturity with the release of `1.0.0` in December 2023.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would remove this first sentence. It's top of our mind now, but in 1 year, 2 years, no one will care to read about the 1.0.0 release?

@@ -91,11 +91,12 @@ reference:

- title: Deprecated
desc: |
As `{admiral}` is still evolving, functions/arguments may need to be removed or replaced over time. In such cases, the function/argument will enter the following 6-month deprecation cycle:
As `{admiral}` is still evolving, functions/arguments may need to be removed or replaced over time. In such cases, the function/argument will enter a 3 year deprecation cycle:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we could say a minimum of 3 years. We are then not making statements to the users about specific timelines.

Comment on lines +585 to +587
**NB:** Major/Minor release make the most sense for deprecation updates. However, if
a release cycle becomes multiple years, then patch releases should be considered to
help keep `{admiral}` neat and tidy!
Copy link
Collaborator

Choose a reason for hiding this comment

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

A patch release is fine for bumping a function/argument through the deprecation process. You're not making a new breaking change, rather a change in messaging to users about a change that was previously made. The breaking change/deprecation was made when the first deprecation messaging was added.

Copy link
Collaborator

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

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

Looks great! Just a few comments/suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecation 2.0
3 participants