Skip to content

config: update directives and error out on bconsole config warnings#2217

Merged
BareosBot merged 23 commits intobareos:masterfrom
florian-at-bareos:dev/fburger/master/update-config-directives
Apr 16, 2025
Merged

config: update directives and error out on bconsole config warnings#2217
BareosBot merged 23 commits intobareos:masterfrom
florian-at-bareos:dev/fburger/master/update-config-directives

Conversation

@florian-at-bareos
Copy link
Contributor

@florian-at-bareos florian-at-bareos commented Mar 19, 2025

Fixes: #2210

This PR does multiple things:

  • for directives with unnecessary dir, fd, sd prefixes, remove the prefixes and add the prefixed name as an alias
  • for systemtests, error out if the bconsole has config warnings
  • replace all directive aliases in systemtests with the original directive
  • no longer warn about alias usage
  • update docs accordingly

Thank you for contributing to the Bareos Project!

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
  • Required backport PRs have been created
  • Correct milestone is set
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

@florian-at-bareos florian-at-bareos added this to the 25.0.0 milestone Mar 19, 2025
@florian-at-bareos florian-at-bareos self-assigned this Mar 19, 2025
@florian-at-bareos florian-at-bareos force-pushed the dev/fburger/master/update-config-directives branch from 25c70c9 to 1cddf90 Compare March 19, 2025 10:21
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

While i like the idea of unifying all ports/.../etc. directives, this will cause way to much friction during the update.

The only way i can imagine us doing something like this,

  1. is adding e.g. Port as an alias (that doesnt cause warnings) and then after ~3-5 years we deprecated DirPort, so that users have a lot of time to change, or
  2. or adding a script/program that upgrades the users configuration automatically.

2.) would be pretty nice, but i dont think we currently have the resources for this.

@florian-at-bareos
Copy link
Contributor Author

I agree with the concerns for the warnings, but I thought this was what we decided to opt for.

@arogge
Copy link
Member

arogge commented Mar 25, 2025

As just discussed in person:

  • Aliases should not emit a deprecation warning
  • Documentation should state that the original name is preferred
  • --xc should only emit the "real" name

@florian-at-bareos florian-at-bareos force-pushed the dev/fburger/master/update-config-directives branch from fa93f47 to 57f14af Compare April 9, 2025 07:53
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

Nice changes. Dont forget to reformat the shell script files with the options we discussed internally.

@florian-at-bareos florian-at-bareos force-pushed the dev/fburger/master/update-config-directives branch from a26b027 to 90bac4f Compare April 14, 2025 12:47
in the same way the director, file and storage daemons do.
replace DirPort with Port (Director -> Console).
rename the following directives:
(Director -> Director)
- DirPort to Port
- DirAddress to Address
- DirAddresses to Addresses
- DirSourceAddress to SourceAddress

(Client -> File Daemon)
- FdPort to Port
- FdAddress to Address
- FdAddresses to Addresses
- FdSourceAddress to SourceAddress

(Storage -> Storage)
- SdPort to Port
- SdAddress to Address
- SdAddresses to Addresses
- SdSourceAddress to SourceAddress

(Director -> Tray Monitor)
- DirPort to Port

(Client -> Tray Monitor)
- FdPort to Port

(Storage -> Tray Monitor)
- SdPort to Port
- SdAddress to Address
- SdPassword to Password
replace DirAddresses with Addresses.
replace dir, fd, sd, prefixed aliases with original directives
as discussed on 2025-03-25
also changed their indentation to 2 spaces.
only in the files previously changed by me
using the flags
"--indent 2 --binary-next-line --case-indent --func-next-line" as in
issue bareos#321
@florian-at-bareos florian-at-bareos force-pushed the dev/fburger/master/update-config-directives branch from d977fac to 86f8233 Compare April 15, 2025 08:45
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

Thanks for the great work! The scripts look much better now.

@BareosBot BareosBot merged commit b2dd28d into bareos:master Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove prefixes Fd/Sd/Dir from configuration items where they are meaningless

4 participants