-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
To ensure build artifacts and local caches are not accidentally committed to version control, same should automatically initialize a .gitignore file within its internal metadata directory (.same/). This follows the "Reliable" and "Simple" brand pillars by providing sensible, secure defaults without requiring manual user intervention.
The implementation will reside in the internal/adapters/cas layer, ensuring that whenever a new Content Addressable Store is initialized, the corresponding ignore rules are also established.
Goals
- Prevent Data Leakage: Automatically exclude the local
store/andcache/directories from Git. - Centralized Configuration: Utilize the existing
internal/core/domain/layout.goto define the.gitignorepath and filename. - Idempotent Execution: Ensure the file is only created if it does not already exist, allowing for potential future user overrides.
Acceptance Criteria
- Domain Definition:
internal/core/domain/layout.gocontains a constant for.gitignoreand a helper functionDefaultGitIgnorePath(). - Automatic Creation: When
cas.NewStore()orcas.NewStoreWithPath()is called and creates the directory, it also writes a.gitignorefile if one is missing. - File Content: The generated
.gitignorecontains exactly the following lines:
store/
cache/
- Hermetic Verification:
nix develop -c go test -race ./cli/internal/adapters/cas/...passes with new assertions.nix develop -c golangci-lint run ./cli/...passes without violations.
- Unit Tests: Existing tests in
store_test.goare updated to verify the physical presence and content of the.gitignorefile after initialization.
Metadata
Metadata
Assignees
Labels
No labels