* docs: add Architecture Decision Records (ADRs) Established a system for documenting architectural decisions. - Created docs/adr directory - Added ADR template (0000-template.md) - Established ADR process in docs/adr/README.md - Documented 4 key existing decisions (0001-0004) - Integrated ADRs into mkdocs.yml and docs/index.md * docs: add Architecture Decision Records (ADRs) Established a system for documenting architectural decisions. - Created docs/adr directory - Added ADR template (0000-template.md) - Established ADR process in docs/adr/README.md - Documented 4 key existing decisions (0001-0004) - Integrated ADRs into mkdocs.yml and docs/index.md - Fixed formatting in pkg/io/local/client.go * docs: add ADRs and fix auto-merge CI - Added Architecture Decision Records (ADRs) to docs/adr/ - Integrated ADRs into mkdocs.yml and docs/index.md - Localized .github/workflows/auto-merge.yml to fix "fatal: not a git repository" error in the reusable workflow by adding explicit --repo context.
36 lines
1.1 KiB
Markdown
36 lines
1.1 KiB
Markdown
# ADR 0004: Storage Abstraction via Medium Interface
|
|
|
|
* Status: accepted
|
|
* Deciders: Project Maintainers
|
|
* Date: 2025-05-15
|
|
|
|
## Context and Problem Statement
|
|
|
|
The application needs to support different storage backends (local file system, SFTP, WebDAV, etc.) for its workspace data. Hardcoding file system operations would make it difficult to support remote storage.
|
|
|
|
## Decision Drivers
|
|
|
|
* Flexibility in storage backends.
|
|
* Ease of testing (mocking storage).
|
|
* Uniform API for file operations.
|
|
|
|
## Considered Options
|
|
|
|
* Standard `os` package.
|
|
* Interface abstraction (`Medium`).
|
|
* `spf13/afero` library.
|
|
|
|
## Decision Outcome
|
|
|
|
Chosen option: "Interface abstraction (`Medium`)". We defined a custom `Medium` interface in `pkg/io` that abstracts common file operations.
|
|
|
|
### Positive Consequences
|
|
|
|
* Application logic is agnostic of where files are actually stored.
|
|
* Easy to implement new backends (SFTP, WebDAV).
|
|
* Simplified testing using `MockMedium`.
|
|
|
|
### Negative Consequences
|
|
|
|
* Small overhead of interface calls.
|
|
* Need to ensure all file operations go through the `Medium` interface.
|