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

Properly mark things that are deprecated as deprecated #1562

Conversation

JeanChristopheMorinPerso
Copy link
Member

@JeanChristopheMorinPerso JeanChristopheMorinPerso commented Oct 29, 2023

Relates to #1552

Properly mark things that are deprecated as deprecated and add a new environment variable called REZ_LOG_DEPRECATION_WARNINGS to help users know when they are using deprecated things.

The new REZ_LOG_DEPRECATION_WARNINGS environment variable will hopefully allow our users to move away from deprecated things before they are removed from 3.0.0.

With this work, we can now deprecate pretty much anything, including config settings. Deprecation warnings for config settings will print the config file that generated the warning. It also works with config setting environment variables too.

(.venv) [jcmorin@arch01 rez]$ REZ_LOG_DEPRECATION_WARNINGS=1 REZ_WARN_OLD_COMMANDS=1 rez-search python
RezDeprecationWarning: config setting named 'warn_old_commands' (configured through the REZ_WARN_OLD_COMMANDS environment variable) is deprecated and will be removed in 3.0.0.
python-2.7.16
python-3.7.4

I tried to find a balance between being conservative and progressive:

  • rez-1 config settings that are currently unused in the code base are deprecated and will be removed in 3.0.0.
  • rez-1 Config settings that are still used in the code based are deprecated but are marked as "will be removed in the future".
  • Two rez-1 config settings's default will be changed in 3.0.0. That is, disable_rez_1_compatibility will be enabled and rez_1_environment_variables will be disabled. Users can always override the defaults if they still need the old behavior.
  • Things that were previously marked as deprecated now officially have a removal date (3.0.0). They aren't controversial things, so hopefully it's alright with everyone.

I added every deprecation to the change log in preparation of the release (and facilitate reviewing this PR) and I also wrote a transitioning guide for 3.0.0.

Hopefully, everything is clear and our users should find it straightforward and clear.

…setting called log_all_deprecation_warnings to help users know when they are using deprecated things.

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
@JeanChristopheMorinPerso JeanChristopheMorinPerso added this to the 2.114.0 milestone Oct 29, 2023
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
… a per setting basis

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
@JeanChristopheMorinPerso JeanChristopheMorinPerso marked this pull request as ready for review November 6, 2023 00:19
#
# .. deprecated:: 2.114.0
# Will be removed in a future release. Additionally, the default will change
# from disabled to enabled in rez 3.0.0.
disable_rez_1_compatibility = False
Copy link
Member Author

Choose a reason for hiding this comment

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

I initially wanted to deprecate it and remove it in 3.0.0, but I found out that this would be a little bit too disruptive for our oldest users. Same for rez_1_environment_variables. rez_1_environment_variables is even more painful because it's a lot harder to know if packages are actively using these old environment variables or not.

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
… configs

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
@JeanChristopheMorinPerso JeanChristopheMorinPerso merged commit eca3861 into AcademySoftwareFoundation:main Nov 24, 2023
28 checks passed
@JeanChristopheMorinPerso JeanChristopheMorinPerso deleted the deprecations branch November 24, 2023 00:38
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.

1 participant