Skip to content

config: deprecate LabelType and CheckLabels#1521

Merged
BareosBot merged 3 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/s5430-deprecate-ansi-labels
Aug 24, 2023
Merged

config: deprecate LabelType and CheckLabels#1521
BareosBot merged 3 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/s5430-deprecate-ansi-labels

Conversation

@alaaeddineelamri
Copy link
Contributor

@alaaeddineelamri alaaeddineelamri commented Aug 10, 2023

Description

This PR adds deprecates LabelType and CheckLabels.
We initially only wanted to deprecate ANSI/IBM labels, but since deprecating/removing them would make the Bareos label the default anyway, just removing the whole config option makes sense.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
  • Required backport PRs have been created
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

@bruno-at-bareos bruno-at-bareos requested a review from pstorz August 10, 2023 09:51
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/s5430-deprecate-ansi-labels branch from e6ec0fd to f8de6ea Compare August 10, 2023 10:04
@alaaeddineelamri alaaeddineelamri changed the title config: add deprecation message for ANSI labels config: add deprecation message for ANSI/IBM labels Aug 14, 2023
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

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

Wouldn't it be simpler to set the configuration directive itself to deprecated:

diff --git a/core/src/stored/stored_conf.cc b/core/src/stored/stored_conf.cc
index 173aeef20..ce04c58a3 100644
--- a/core/src/stored/stored_conf.cc
+++ b/core/src/stored/stored_conf.cc
@@ -198,7 +198,7 @@ static ResourceItem dev_items[] = {
   {"MountPoint", CFG_TYPE_STRNAME, ITEM(res_dev, mount_point), 0, 0, NULL, NULL, NULL},
   {"MountCommand", CFG_TYPE_STRNAME, ITEM(res_dev, mount_command), 0, 0, NULL, NULL, NULL},
   {"UnmountCommand", CFG_TYPE_STRNAME, ITEM(res_dev, unmount_command), 0, 0, NULL, NULL, NULL},
-  {"LabelType", CFG_TYPE_LABEL, ITEM(res_dev, label_type), 0, 0, NULL, NULL, NULL},
+   {"LabelType", CFG_TYPE_LABEL, ITEM(res_dev, label_type), 0, CFG_ITEM_DEPRECATED, NULL, "-23.0.0", NULL},

This creates a deprecation warning like this:

here are configuration warnings:
 * using deprecated keyword LabelType on line 14 of file .../etc/bareos/bareos-sd.d/device/FileStorage.conf

Also, we probably need to update the documentation about the tape labels, see: https://docs.bareos.org/Appendix/Troubleshooting.html#tape-labels-ansi-or-ibm

Additionally, we probably want to deprecate also the directive CheckLabels. as it seems only to be used for IBM/ANSI Labels

@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/s5430-deprecate-ansi-labels branch from f8de6ea to 272a7f4 Compare August 15, 2023 09:42
@alaaeddineelamri alaaeddineelamri changed the title config: add deprecation message for ANSI/IBM labels config: deprecate LabelType and CheckLabels Aug 15, 2023
alaaeddineelamri and others added 3 commits August 24, 2023 11:28
This is mostly to deprecate ANSI/IBM labels, and since
deprecating them would make the Bareos label the 
only option, then just deprecating the whole config
option is the way to go.
@BareosBot BareosBot force-pushed the dev/alaaeddineelamri/master/s5430-deprecate-ansi-labels branch from e897859 to 9b31f2c Compare August 24, 2023 11:28
@BareosBot BareosBot merged commit 0fa0d94 into bareos:master Aug 24, 2023
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.

4 participants

Comments