Skip to content

grpc: fix extra / for directories#2373

Merged
BareosBot merged 12 commits intobareos:masterfrom
sebsura:dev/ssura/master/fix-grpc-accurate-dirs
Sep 29, 2025
Merged

grpc: fix extra / for directories#2373
BareosBot merged 12 commits intobareos:masterfrom
sebsura:dev/ssura/master/fix-grpc-accurate-dirs

Conversation

@sebsura
Copy link
Contributor

@sebsura sebsura commented Sep 18, 2025

Thank you for contributing to the Bareos Project!

The grpc plugin accidentally added an extra / at the end of directories which causes accurate to always pick up all directories.

This PR also includes

  • a test for accurate + (python) plugins,
  • split up of the pruning test for better testing performance.

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
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

Its not well specified wether _both_ link _and_ fname should end in /,
or if just link should end in /.  The core mostly does it in a way
where fname does _not_ end in /, but link does.

I assumed that this was the rule, but it turns out that the plugins
simply set fname _and_ link to the same path ending in /.

This mismatch of assumption and reality meant that the grpc plugin now
created paths with double / at the end, which tripped up the accurate
information as well as the file listings.

This commit fixes this by always stripping any trailing / from fname
and always adding one trailing / to link (after stripping all the rest
of them).
@sebsura sebsura force-pushed the dev/ssura/master/fix-grpc-accurate-dirs branch 12 times, most recently from de9bb45 to 2c72dd8 Compare September 24, 2025 13:15
@sebsura sebsura force-pushed the dev/ssura/master/fix-grpc-accurate-dirs branch 2 times, most recently from 3e72fb3 to d54f24e Compare September 25, 2025 11:19
@sebsura sebsura added this to the 25.0.0 milestone Sep 25, 2025
@sebsura sebsura self-assigned this Sep 25, 2025
@sebsura sebsura requested a review from pstorz September 25, 2025 11:22
@sebsura sebsura mentioned this pull request Sep 25, 2025
7 tasks
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.

Please see comments

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.

Please see comments. Also I would suggest to quote the "where" in the commit description: of cb448dc

(grpc: fix where being optional)

@sebsura sebsura force-pushed the dev/ssura/master/fix-grpc-accurate-dirs branch from d54f24e to 64f0050 Compare September 29, 2025 06:12
@sebsura sebsura requested a review from pstorz September 29, 2025 06:12
@sebsura sebsura force-pushed the dev/ssura/master/fix-grpc-accurate-dirs branch from 64f0050 to 7d6ca9c Compare September 29, 2025 07:42
@BareosBot BareosBot merged commit 63d555a into bareos:master Sep 29, 2025
1 check was pending
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.

3 participants