Add a summary of how many files are uploaded and ignored as part of bundle deploy#3739
Add a summary of how many files are uploaded and ignored as part of bundle deploy#3739andrewnester wants to merge 13 commits intomainfrom
Conversation
12 failing tests:
|
2477bc1 to
5c95e65
Compare
| "method": "POST", | ||
| "path": "/api/2.0/workspace/mkdirs", | ||
| "body": { | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/my_default_python/prod/files/scratch" |
There was a problem hiding this comment.
This folder was always in template and it seems like previous gitignore logic was too eager
denik
left a comment
There was a problem hiding this comment.
General question - does this result in the same number of syscalls as before (just extra bookkeeping) or does it do more work on file system?
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Uploaded [NUMID] files (ignored [NUMID] directories by .gitignore) |
There was a problem hiding this comment.
Why have 2 messages for the same event? If uploading files then I won't see number, right?
There was a problem hiding this comment.
For the ux
- The first one shows that we started to do the uploading
- 2nd one - how many uploaded
We could add a number to the first message, but it would require changing sync.RunOnce interface to take the list of files. Don't really have a strong opinion if it's best to keep one longer message or 2 separate ones
|
|
||
| [[Repls]] | ||
| Old = 'Uploaded \d+ files \(ignored \d+ directories( and \d+ files)? by .gitignore\)' | ||
| New = 'Uploaded [NUMID] files (ignored [NUMID] directories by .gitignore)' |
There was a problem hiding this comment.
Why Local and Cloud have different number of files?
There was a problem hiding this comment.
I don't yet have answer for this, need to dive deeper into this
There was a problem hiding this comment.
This is a review completely generated by claude and not reviewed by me. I was testing the reviewbot, but this might be useful.
Issues Found
- Confusing comment logic - Line 277 in libs/sync/sync.go has a confusing double-negative comment about the exclude filtering logic
- Missing unit tests - No unit tests for the message formatting logic in bundle/deploy/files/upload.go, especially edge cases like zero counts or combinations of exclusion types
- Performance consideration - The exclude filtering iterates over all files after building the set (lines 270-282 in sync.go), which could be slow for large filesets. Consider documenting this trade-off
Suggestions
- Add unit tests for the message formatting logic to ensure edge cases are handled correctly (e.g., only directories excluded, only files excluded, both, neither)
- Consider adding a helper method to FileList for generating the message, making it more testable
- The ExcludedBySyncExclude field could have a more descriptive name like ExcludedBySyncExcludePatterns
Review generated by reviewbot
| log.Errorf(ctx, "cannot check if file matches exclude pattern: %s", err) | ||
| return nil, err | ||
| } | ||
| // If not ignored by excluder, it means the file matches exclude patterns |
There was a problem hiding this comment.
This comment is confusing due to double-negative logic. The excludeIgnorer uses an includer with inverted semantics where IgnoreFile() returns false when a file matches the pattern. Consider clarifying: "If file matches exclude pattern (indicated by IgnoreFile returning false), remove it"
Changes
Add a summary of how many files are uploaded and ignored as part of
bundle deploySome of the tests (which run on Local and Cloud) have a different number of files uploaded/ignored, thus sometimes we include a replacement for the number of files in the message we print in acceptance tests.
Tests
Existing acceptance tests show the output