Consolidate code duplicated in ArtifactCache and SourceCache
- Dominant language
- Python
- Stars
- 140
- Forks
- 45
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
[See original issue on GitLab](https://gitlab.com/BuildStream/buildstream/-/issues/1166)
In GitLab by [[Gitlab user @juergbi]](https://gitlab.com/juergbi) on Oct 9, 2019, 16:37
The following discussion from !1635 should be addressed:
- [ ] [[Gitlab user @juergbi]](https://gitlab.com/juergbi) started a [discussion](https://gitlab.com/BuildStream/buildstream/merge_requests/1635#note_228185667): (+1 comment)
> This makes sense. However, it seems we have some code duplication between `ArtifactCache` and `SourceCache` with differences in error handling. We should fix this with a method in `CASCache` that fetches a directory with file blobs (or adding a parameter to the already existing `_fetch_directory()`) and possibly a helper method in the `BaseCache` class. The former can be implemented with a single `FetchTree` call to buildbox-casd in the future.
>
> Do you want to update this branch or defer this to a separate MR?
Contributor guide
Research direction
Read ArtifactCache and SourceCache alongside CASCache._fetch_directory() and the BaseCache helper area; use the linked GitLab discussion and MR !1635 for context. Identify the duplicated directory-fetch logic, preserve the differing error handling, and confirm that both cache paths still behave as before.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100