- 
                Notifications
    
You must be signed in to change notification settings  - Fork 466
 
          [Internal] Rewrite databricks_job data source to use Go SDK
          #5078
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
With this refactoring we'll fix a problem when a job has more than 100 tasks - current implementation won't handle it correctly. Plus, it won't work in the workspaces with a lot of jobs... Also, refactored job tests to use Mock API instead of `HTTPFixture`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the databricks_job data source to use the Go SDK instead of the legacy APIs, fixing pagination issues for workspaces with more than 100 jobs and improving support for jobs with more than 100 tasks. The changes also migrate job tests from HTTPFixtures to the Mock API pattern for better maintainability.
Key Changes:
- Migrated data source from legacy API to Go SDK with proper pagination support
 - Refactored all job tests to use Mock API instead of HTTPFixture pattern
 - Removed legacy API functions like 
ListByNameandListmethods - Fixed git source schema conflicts with proper prefix handling
 
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description | 
|---|---|
jobs/data_job.go | 
Core data source refactoring to use Go SDK with improved job listing and retrieval | 
jobs/data_job_test.go | 
Complete test migration from HTTPFixture to Mock API pattern | 
jobs/resource_job.go | 
Removed legacy API methods and fixed git source schema conflicts | 
jobs/resource_job_test.go | 
Extensive test refactoring using Mock API for better test isolation | 
jobs/resource_job_webhook_test.go | 
Updated webhook notification tests to use Mock API | 
NEXT_CHANGELOG.md | 
Added changelog entry for the refactoring | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
| 
          
 If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs: 
 Checks will be approved automatically on success.  | 
    
Changes
With this refactoring, we'll fix a problem that occurs when a job has more than 100 tasks - the current implementation does not handle it correctly. Additionally, it won't work in workspaces with a large number of jobs...
Additionally, I refactored job tests to use the Mock API instead of
HTTPFixture. And started to remove unnecessary functions for legacy Jobs APIs.Tests
make testrun locallydocs/folderinternal/acceptanceNEXT_CHANGELOG.mdfile