Skip to content

Comments

Add a summary of how many files are uploaded and ignored as part of bundle deploy#3739

Closed
andrewnester wants to merge 13 commits intomainfrom
feat/show-msg-gitignore
Closed

Add a summary of how many files are uploaded and ignored as part of bundle deploy#3739
andrewnester wants to merge 13 commits intomainfrom
feat/show-msg-gitignore

Conversation

@andrewnester
Copy link
Contributor

Changes

Add a summary of how many files are uploaded and ignored as part of bundle deploy

Some 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

@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Oct 8, 2025

Run: 18498091002

Env 🔄​flaky ✅​pass 🙈​skip
✅​ aws linux 322 545
✅​ aws windows 323 544
✅​ aws-ucws linux 438 441
✅​ aws-ucws windows 439 440
✅​ azure linux 322 544
✅​ azure windows 323 543
🔄​ azure-ucws linux 7 431 440
🔄​ azure-ucws windows 8 431 439
🔄​ gcp linux 3 318 546
✅​ gcp windows 322 545
12 failing tests:
Test Name azure-ucws linux azure-ucws windows gcp linux
TestAccept ✅​p ✅​p 🔄​f
TestAccept/bundle/deployment/bind/dashboard ✅​p 🔄​f ✅​p
TestAccept/bundle/deployment/bind/dashboard/recreation ✅​p 🔄​f ✅​p
TestAccept/bundle/resources/dashboards/detect-change 🔄​f 🔄​f ✅​p
TestAccept/bundle/resources/dashboards/generate_inplace 🔄​f 🔄​f ✅​p
TestAccept/bundle/resources/dashboards/nested-folders 🔄​f 🔄​f ✅​p
TestAccept/bundle/resources/dashboards/simple 🔄​f 🔄​f ✅​p
TestAccept/bundle/resources/dashboards/simple_outside_bundle_root 🔄​f 🔄​f ✅​p
TestAccept/bundle/resources/dashboards/simple_syncroot 🔄​f ✅​p ✅​p
TestAccept/bundle/resources/pipelines/allow-duplicate-names ✅​p ✅​p 🔄​f
TestAccept/bundle/resources/pipelines/allow-duplicate-names/DATABRICKS_BUNDLE_ENGINE=direct-exp ✅​p ✅​p 🔄​f
TestDashboardAssumptions_WorkspaceImport 🔄​f 🔄​f ✅​p

"method": "POST",
"path": "/api/2.0/workspace/mkdirs",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/my_default_python/prod/files/scratch"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This folder was always in template and it seems like previous gitignore logic was too eager

Copy link
Contributor

@denik denik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have 2 messages for the same event? If uploading files then I won't see number, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the ux

  1. The first one shows that we started to do the uploading
  2. 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)'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Local and Cloud have different number of files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't yet have answer for this, need to dive deeper into this

@andrewnester andrewnester requested a review from denik October 17, 2025 16:16
Copy link
Contributor

@shreyas-goenka shreyas-goenka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Confusing comment logic - Line 277 in libs/sync/sync.go has a confusing double-negative comment about the exclude filtering logic
  2. 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
  3. 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

  1. 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)
  2. Consider adding a helper method to FileList for generating the message, making it more testable
  3. 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants