Add Technical_Decomp_Diff
parent
b900873405
commit
bd62c814c5
1 changed files with 30 additions and 0 deletions
30
Technical_Decomp_Diff.md
Normal file
30
Technical_Decomp_Diff.md
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
## enroll/diff.py
|
||||||
|
|
||||||
|
### BundleRef (dataclass)
|
||||||
|
|
||||||
|
Purpose: represents a prepared harvest bundle that diff can read from.
|
||||||
|
|
||||||
|
#### Fields:
|
||||||
|
|
||||||
|
`dir`: Path: directory containing at least `state.json` and (optionally) artifacts/
|
||||||
|
|
||||||
|
`tempdir`: Optional[tempfile.TemporaryDirectory]: Set only when the bundle had to be extracted/decrypted into a temporary directory. Lets the caller clean up later
|
||||||
|
|
||||||
|
#### Property:
|
||||||
|
|
||||||
|
`state_path` -> Path: dir / "state.json"
|
||||||
|
|
||||||
|
#### Lifecycle / where it’s used:
|
||||||
|
|
||||||
|
Constructed by _bundle_from_input(path, sops_mode=...) which accepts:
|
||||||
|
|
||||||
|
- bundle directory
|
||||||
|
- direct state.json path
|
||||||
|
- .tar.gz/.tgz
|
||||||
|
- .sops encrypted tarball (or when --sops is enabled)
|
||||||
|
|
||||||
|
`compare_harvests()` uses `ExitStack` to ensure any `tempdir.cleanup()` happens.
|
||||||
|
|
||||||
|
#### Key design detail:
|
||||||
|
|
||||||
|
This class is the bridge between "user supplied something" and “we have a real directory with files”.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue