-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Milestone
Description
follow-up on #16984 (comment)
- re-visit
FindFilesWithVersionsByPatternand howokhandled compare toerr
if de-facto it's always handled same way - then think again on API ofFindFilesWithVersionsByPattern- provide some examples in code - on how this func Expected to be used.
Currently we are wordy:
fPathMask, err := version.ReplaceVersionWithMask(filepath.Join(snapDir, t.FileName(t.Versions().Current, r.From(), r.To())))
if err != nil {
return fmt.Errorf("[merge] can't replace with mask in file %s: %w", fPathMask, err)
}
fPath, _, ok, err := version.FindFilesWithVersionsByPattern(fPathMask)
if err != nil {
_, fName := filepath.Split(fPath)
return fmt.Errorf("[merge] find files by pattern err %w fname %s", err, fName)
}
if !ok {
_, fName := filepath.Split(fPath)
return fmt.Errorf("[merge] find files by pattern err %w fname %s", os.ErrNotExist, fName)
}
- Seems we clearly see new concept:
- new files names (which we planing to build)
- existing files names (which we got from disk)
Maybe if we thin more in this direction - we will find better API/Types - to make "wrong version" impossible at compile-time.
-
Block Files are far from state files (code-wise). Create 1-2 GitHub issues to make small step towards unification (step-by-step we will get there).
-
What is next step about
snaptype.ParseFileName? -
Please add here more follow-ups - about challenges we faced during
release/3.1, building indexes on old files if have some #16984, and other tasks
sub-tasks:
Sub-issues
Metadata
Metadata
Assignees
Labels
No labels