Skip to content

feat: add optional --no-permission-change to skip rsync permission preservation#355

Merged
greenbonebot merged 2 commits into
greenbone:mainfrom
mde-gb:feat/optional-rsync-no-perms
Jun 17, 2026
Merged

feat: add optional --no-permission-change to skip rsync permission preservation#355
greenbonebot merged 2 commits into
greenbone:mainfrom
mde-gb:feat/optional-rsync-no-perms

Conversation

@mde-gb

@mde-gb mde-gb commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Why

Some storage backends (bind mounts, network filesystems, container volumes) allow writing files but reject changing their modes. The sync currently always passes --perms --chmod=Fugo+r,Fug+w,Dugo-s,Dugo+rx,Dug+w, which makes rsync fail with a permission error on such targets.

What

  • Adds an opt-in --no-permission-change CLI flag, no-permission-change config variable, and GREENBONE_FEED_SYNC_NO_PERMISSION_CHANGE environment variable.
  • When enabled, rsync runs with --no-perms instead of the default --perms --chmod=....
  • Default behavior is unchanged — permissions are still preserved by default.
  • Wired through Rsync(change_permissions=...) from main.py; documented in README.md.

Tests

  • New tests for the rsync args, the parser flag, and the main.py wiring.
  • Extended config tests (defaults, config-file, and environment override).
  • Existing main.py tests updated to assert the default change_permissions=True.
  • ruff check and ruff format clean.

Includes AI-generated code (GitHub Copilot).

Add an opt-in --no-perms flag (config `no-perms`, env GREENBONE_FEED_SYNC_NO_PERMS) that makes rsync pass `--no-perms` instead of the default `--perms --chmod=...`. The default behavior is unchanged and covered by tests.

Useful when syncing to storage that denies changing permissions.

Co-authored-by: AI (copilot/full)
@mde-gb mde-gb requested review from a team as code owners June 15, 2026 13:04
@greenbonebot greenbonebot enabled auto-merge (rebase) June 15, 2026 13:04
@github-actions

Copy link
Copy Markdown

Conventional Commits Report

😢 No conventional commits found.

👉 Learn more about the conventional commits usage at Greenbone.

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.36%. Comparing base (1be4adf) to head (da516ac).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #355   +/-   ##
=======================================
  Coverage   99.35%   99.36%           
=======================================
  Files           7        7           
  Lines         468      470    +2     
=======================================
+ Hits          465      467    +2     
  Misses          3        3           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bjoernricks bjoernricks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you make the CLI argument more descriptive? For example --no-permission-change, --keep-permissions or similar.

Comment thread greenbone/feed/sync/rsync.py Outdated
@mde-gb mde-gb changed the title feat: add optional --no-perms to skip rsync permission preservation feat: add optional -no-permission-change to skip rsync permission preservation Jun 17, 2026
Make the rsync permission CLI flag self-explanatory and align the Rsync
parameter with it:

- CLI flag --no-perms -> --no-permission-change
- env var GREENBONE_FEED_SYNC_NO_PERMS -> GREENBONE_FEED_SYNC_NO_PERMISSION_CHANGE
- config key no-perms -> no-permission-change
- Rsync(perms=...) -> Rsync(change_permissions=...)

Also align the README description with the parser help wording and
unify the storage examples. The underlying rsync --no-perms option
string is unchanged.

Co-authored-by: AI (copilot/partial)
auto-merge was automatically disabled June 17, 2026 09:15

Head branch was pushed to by a user without write access

@greenbonebot greenbonebot enabled auto-merge (rebase) June 17, 2026 09:15
@mde-gb mde-gb changed the title feat: add optional -no-permission-change to skip rsync permission preservation feat: add optional --no-permission-change to skip rsync permission preservation Jun 17, 2026
@mde-gb

mde-gb commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Could you make the CLI argument more descriptive? For example --no-permission-change, --keep-permissions or similar.

@bjoernricks Updated

@greenbonebot greenbonebot merged commit f0ccbfd into greenbone:main Jun 17, 2026
24 of 25 checks passed
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.

3 participants