Skip to content

acc: Replace find with find.py - #6714

Open
janniklasrose wants to merge 2 commits into
mainfrom
janniklasrose/use-find.py
Open

janniklasrose wants to merge 2 commits into
mainfrom
janniklasrose/use-find.py

Conversation

@janniklasrose

Copy link
Copy Markdown
Member

Replace all* usages of find in acceptance/**/script with find.py

*Except: https://github.com/databricks/cli/blob/main/acceptance/bundle/templates/pydabs/init-classic/script#L4 because it uses -delete and would make find.py mutating (read-only now).

@janniklasrose
janniklasrose requested a review from denik September 16, 2026 15:39
@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

19 files changed
Suggested: @denik
Also eligible: @shreyas-goenka, @pietern, @andrewnester, @anton-107, @lennartkats-db

General files (require maintainer)

Files: acceptance/bin/find.py
Based on git history:

  • @denik -- recent work in acceptance/bundle/migrate/auto-migrate-plan-failure/, acceptance/bundle/migrate/auto-migrate-default/, acceptance/bundle/migrate/auto-migrate-clean/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @lennartkats-db, @rugpanov, @rclarey) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 2f2a5d4

Run: 35116926478

Env 🔄​flaky ✅​pass 🙈​skip Time
✅​ aws linux 280 24 12:30
✅​ aws windows 282 22 7:21
🔄​ azure linux 2 277 24 12:01
🔄​ azure windows 1 280 22 8:59
🔄​ gcp linux 2 278 24 14:44
✅​ gcp windows 282 22 7:40
Test Name azure linux azure windows gcp linux
🔄​ TestSyncFullFileSync ✅​p 🔄​f ✅​p
🔄​ TestSyncIncrementalFileOverwritesFolder 🔄​f ✅​p ✅​p
🔄​ TestSyncIncrementalFileSync 🔄​f ✅​p ✅​p
🔄​ TestSyncIncrementalSyncFileToPythonNotebook ✅​p ✅​p 🔄​f
🔄​ TestSyncIncrementalSyncPythonNotebookToFile ✅​p ✅​p 🔄​f
Top 14 slowest tests (at least 2 minutes):
duration env testname
4:42 azure windows TestAccept
3:48 gcp windows TestAccept
3:43 aws windows TestAccept
3:18 aws windows TestImportDirDoesNotOverwrite
3:03 azure windows TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
3:00 gcp windows TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=terraform/DMS=
2:57 azure windows TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=terraform/DMS=
2:38 gcp windows TestFilerWorkspaceFilesExtensionsReadDir
2:36 azure linux TestFilerWorkspaceFilesExtensionsReadDir
2:26 gcp linux TestFilerWorkspaceFilesExtensionsReadDir
2:22 gcp linux TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
2:08 gcp linux TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=terraform/DMS=
2:06 gcp windows TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
2:03 gcp windows TestFilerRecursiveDelete/workspace_files

Comment thread acceptance/bin/find.py

If --expect N is provided, the number of matches must be N or error is printed.
If --include-dirs is provided, directories are matched and printed too (default: files only).
If --prune REGEX is provided, directories whose path matches REGEX are not descended into or printed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems odd that --prune only prunes directories. Should it be called --prune-dirs in that case? or should it prune files as well?

=== Assert destroy leaves the bundle state dir clean:

>>> find .databricks -name terraform -prune -o -print
>>> find.py --include-dirs --prune terraform$ ^\.databricks(/|$)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looking at this, I think find.py --dirs would be enough.

=== Direct-engine state is now in place; terraform state is backed up

>>> find .databricks/bundle -name resources.json -type f
>>> find.py ^\.databricks/bundle/.*resources\.json$

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we just teach it to accept exact directories as parameter like find?

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.

3 participants