Skip to content

Commit f66a10f

Browse files
khaliqgantclaude
andcommitted
fix(mount): include types.go (BulkWriteFile aliases + BulkWriteResponse)
CI failed on the PR because syncer.go references BulkWriteFile, BulkWriteResponse, BulkWriteError, and ErrEmptyBulkWrite — all defined in this file, but the file was created during the workflow run and never committed. The workflow's commit step listed files explicitly and missed this one. Confirmed `go test ./internal/mountsync/...` passes locally once this file is present. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 987fb3d commit f66a10f

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

internal/mountsync/types.go

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package mountsync
2+
3+
import (
4+
"errors"
5+
"strings"
6+
7+
"github.com/agentworkforce/relayfile/internal/relayfile"
8+
)
9+
10+
type BulkWriteFile = relayfile.BulkWriteFile
11+
12+
type BulkWriteError = relayfile.BulkWriteError
13+
14+
type BulkWriteResult struct {
15+
Path string `json:"path"`
16+
Revision string `json:"revision"`
17+
ContentType string `json:"contentType,omitempty"`
18+
}
19+
20+
type BulkWriteResponse struct {
21+
Written int `json:"written"`
22+
ErrorCount int `json:"errorCount"`
23+
Errors []BulkWriteError `json:"errors"`
24+
Results []BulkWriteResult `json:"results,omitempty"`
25+
Files []RemoteFile `json:"files,omitempty"`
26+
CorrelationID string `json:"correlationId"`
27+
}
28+
29+
var ErrEmptyBulkWrite = errors.New("bulk write requires at least one file")
30+
31+
func (r BulkWriteResponse) revisionsByPath() map[string]string {
32+
byPath := make(map[string]string, len(r.Results)+len(r.Files))
33+
for _, result := range r.Results {
34+
revision := strings.TrimSpace(result.Revision)
35+
if revision == "" {
36+
continue
37+
}
38+
byPath[normalizeRemotePath(result.Path)] = revision
39+
}
40+
for _, file := range r.Files {
41+
revision := strings.TrimSpace(file.Revision)
42+
if revision == "" {
43+
continue
44+
}
45+
byPath[normalizeRemotePath(file.Path)] = revision
46+
}
47+
return byPath
48+
}

0 commit comments

Comments
 (0)