Commit 469b54d
authored
sync-common: Rewrite sync logic in Rust with unit tests (#49)
Replace the bash script implementation with a testable Rust program that
handles file synchronization using git history to track deletions.
The Rust implementation:
- Uses xshell for ergonomic subprocess handling
- Provides proper error handling with anyhow
- Is fully unit tested with 11 tests (6 unit + 5 integration)
- Uses git to find deleted files instead of maintaining a manifest
- Uses rsync to forcibly overwrite existing files and create directories
The workflow now:
1. Builds the sync-common tool using cargo
2. Runs the tool to sync files from infra/common/ to target repositories
3. Only syncs when there are actual changes
This fixes the original patch-based approach which failed when creating
files in non-existent directories or overwriting existing files.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>1 parent ad66814 commit 469b54d
File tree
5 files changed
+643
-36
lines changed- .github/workflows
- scripts/sync-common
- src
5 files changed
+643
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
23 | 44 | | |
24 | 45 | | |
25 | 46 | | |
| |||
73 | 94 | | |
74 | 95 | | |
75 | 96 | | |
76 | | - | |
| 97 | + | |
77 | 98 | | |
78 | 99 | | |
79 | 100 | | |
| |||
103 | 124 | | |
104 | 125 | | |
105 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
106 | 133 | | |
107 | 134 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 135 | + | |
| 136 | + | |
143 | 137 | | |
144 | 138 | | |
145 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments