Commit c55065c
authored
Skip large files during export-dir instead of failing (#3984)
Fixes #3691
Skip large files in workspace export-dir with warnings instead of
failing
## Changes
- Modified `workspace export-dir` to handle files exceeding the 10MB
size limit gracefully
- When a file exceeds the limit, log a warning and continue exporting
other files
- Display a summary of all skipped files at the end of the export
- Added integration test `TestExportDirSkipsLargeFiles` to verify the
behavior
## Why
Previously, when exporting a directory containing files larger than 10MB
(the workspace API limit), the entire command would fail with an error.
This made it impossible to export directories containing a mix of small
and large files. Users would have to manually identify and exclude large
files before running the export.
Now the command skips oversized files with a clear warning, allowing
users to export what they can and see which files were skipped in a
summary at the end.
## Tests
- Added integration test `TestExportDirSkipsLargeFiles` that:
- Creates an 11MB file (exceeds 10MB limit) and smaller files
- Verifies large file is skipped with appropriate warnings in stderr
- Verifies smaller files are exported successfully
- Verifies no empty file is created locally for skipped files1 parent fc6eb0a commit c55065c
File tree
6 files changed
+107
-6
lines changed- acceptance/cmd/workspace/export-dir-file-size-limit
- cmd/workspace/workspace
6 files changed
+107
-6
lines changedLines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
24 | 52 | | |
25 | 53 | | |
26 | 54 | | |
27 | 55 | | |
28 | | - | |
| 56 | + | |
29 | 57 | | |
30 | 58 | | |
31 | 59 | | |
| |||
59 | 87 | | |
60 | 88 | | |
61 | 89 | | |
62 | | - | |
63 | | - | |
| 90 | + | |
| 91 | + | |
64 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
65 | 100 | | |
66 | 101 | | |
67 | | - | |
| 102 | + | |
68 | 103 | | |
69 | | - | |
70 | | - | |
| 104 | + | |
| 105 | + | |
71 | 106 | | |
72 | 107 | | |
73 | 108 | | |
| 109 | + | |
| 110 | + | |
74 | 111 | | |
75 | 112 | | |
76 | 113 | | |
| |||
103 | 140 | | |
104 | 141 | | |
105 | 142 | | |
| 143 | + | |
106 | 144 | | |
107 | 145 | | |
108 | 146 | | |
| |||
120 | 158 | | |
121 | 159 | | |
122 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
123 | 172 | | |
124 | 173 | | |
125 | 174 | | |
| |||
0 commit comments