Skip to content

Split backend code from restic package#4499

Merged
MichaelEischer merged 6 commits into
restic:masterfrom
MichaelEischer:modular-backend-code
Oct 27, 2023
Merged

Split backend code from restic package#4499
MichaelEischer merged 6 commits into
restic:masterfrom
MichaelEischer:modular-backend-code

Conversation

@MichaelEischer

Copy link
Copy Markdown
Member

What does this PR change? What problem does it solve?

The restic package is currently a big bunch of partially related code. In particular, it contains backend, repository and data format specific code. This makes it tempting to create leaky abstractions that expose internals of the repository format which should rather be encapsulated.

This PR splits the backend code from the restic package to provide a cleaner separation. There is still a significant amount of code that (unnecessarily) reaches into the backend of a repository.

Was the change previously discussed in an issue or on the forum?

No.

Checklist

  • I have read the contribution guidelines.
  • I have enabled maintainer edits.
  • [ ] I have added tests for all code changes.
  • [ ] I have added documentation for relevant changes (in the manual).
  • [ ] There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I have run gofmt on the code in all commits.
  • All commit messages are formatted in the same style as the other commits in the repo.
  • I'm done! This pull request is ready for review.

@MichaelEischer MichaelEischer force-pushed the modular-backend-code branch 2 times, most recently from 7af93e5 to 5a6c630 Compare October 17, 2023 21:28
This removes code that is only used within a backend implementation from
the backend package. The latter now only contains code that also has
external users.
Ideally, code that uses a repository shouldn't directly interact with
the underlying backend. Thus, move MemorizeList one layer up.

@MichaelEischer MichaelEischer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LGTM.

@MichaelEischer MichaelEischer merged commit 45962c2 into restic:master Oct 27, 2023
@MichaelEischer MichaelEischer deleted the modular-backend-code branch October 27, 2023 18:19
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