Skip to content

remove the repository feature flags mechanism - #10374

Merged
ThomasWaldmann merged 2 commits into
borgbackup:masterfrom
ThomasWaldmann:drop-feature-flags
Sep 15, 2026
Merged

ThomasWaldmann merged 2 commits into
borgbackup:masterfrom
ThomasWaldmann:drop-feature-flags

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Follow-up to #10371, #10372 and #10373: the last content the manifest could carry.

What feature flags were. The manifest's config could hold per-operation (read / check / write / delete) sets of "mandatory" feature names; a borg not supporting one of them refused the operation with MandatoryFeatureUnsupported. The cache config mirrored them as ignored_features / mandatory_features to force a cache rebuild when a version with a different feature set came along.

Why it goes. No feature was ever defined (SUPPORTED_REPO_FEATURES was empty) and nothing ever wrote feature flags, so all of it was dead code: the checks in Manifest.load(), the cache compatibility check / wipe / update, the ManifestItem validation of config["feature_flags"], the compatibility= argument every command decorator had to carry, and a page of docs.

Two commits:

  1. Remove the mechanism: manifest checks, cache bookkeeping, item validation, docs (the whole "Feature flags" section of data-structures.rst, the cache config example) and the tests that set an unknown feature. Manifest.Operation and the decorator argument stay as inert placeholders so the commit is green on its own.
  2. Remove the placeholders: Manifest.Operation, NO_OPERATION_CHECK, the operations parameter of Manifest.load(), compat_check(), the compatibility= argument of with_repository / with_other_repository, and all call sites (39 files, mechanical).

Kept:

  • MandatoryFeatureUnsupported stays defined, never raised, so rc 25 stays reserved.
  • The manifest's config dict stays as a general-purpose, preserved-by-all-versions slot; borg currently stores nothing in it. The manifest is now {"version": 2, "archives": {}, "config": {}}.
  • Cache config files that still contain the two feature keys load fine (configparser ignores keys nobody reads) and lose them on the next save.

Full suite passes locally (FUSE mount tests deselected: macFUSE is unavailable on this machine after an OS update, they fail identically on master).

🤖 Generated with Claude Code

@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.11%. Comparing base (12360cb) to head (f9e112f).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10374   +/-   ##
=======================================
  Coverage   88.10%   88.11%           
=======================================
  Files         103      103           
  Lines       18923    18832   -91     
  Branches     2923     2909   -14     
=======================================
- Hits        16672    16593   -79     
+ Misses       1560     1554    -6     
+ Partials      691      685    -6     

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

ThomasWaldmann and others added 2 commits September 15, 2026 21:19
The manifest could carry per-operation "mandatory feature" sets that lock
out borg versions not supporting them, mirrored into the cache config as
ignored_features / mandatory_features to force cache rebuilds. No feature
was ever defined (SUPPORTED_REPO_FEATURES was empty) and nothing ever wrote
feature flags, so the whole mechanism was dead code: the compatibility
checks in Manifest.load(), the cache compatibility check/wipe/update, the
ManifestItem validation of config["feature_flags"] and the docs.

The manifest's config dict stays (general purpose, preserved by all borg
versions), but borg does not store anything in it now.

MandatoryFeatureUnsupported is kept (never raised) so that its return code
25 stays reserved.

The Manifest.Operation names and the compatibility= argument of the
with_repository decorators are left in place as inert placeholders, they
are removed in the next commit.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Leftovers of the feature flags mechanism removed in the previous commit:
the Manifest.Operation enum, NO_OPERATION_CHECK, the operations parameter
of Manifest.load(), compat_check() and the compatibility= argument of the
with_repository / with_other_repository decorators, plus all their call
sites in the archiver command modules and the tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ThomasWaldmann
ThomasWaldmann merged commit 71d26b0 into borgbackup:master Sep 15, 2026
28 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the drop-feature-flags branch September 15, 2026 19:59
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