-
Notifications
You must be signed in to change notification settings - Fork 88
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
Fixing groups in config file not considered for group migration job #943
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #943 +/- ##
==========================================
+ Coverage 87.76% 87.78% +0.02%
==========================================
Files 43 43
Lines 5213 5223 +10
Branches 939 943 +4
==========================================
+ Hits 4575 4585 +10
Misses 434 434
Partials 204 204 ☔ View full report in Codecov by Sentry. |
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.
I am not sure this is the best way to solve the issue. It would be better to filter the groups when we fetch them (in _fetcher
method). We are already filtering the groups when we crawl. We just need to add simple filter when we fetch as well. This would be one-liner fix.
@mwojtyczka I would like to identify groups specified in the conf that aren't in the groups table. Today if you specify random groups in the conf it is completely silented. |
Got it. It's another use case then. There is another issue with the fetcher that is not filtering the groups from the config. |
@mwojtyczka After discussion with Jince, it's better to move the logic to the fetcher() because of what you mention and also for keeping the consistency of the logic. Let's keep things as clean as possible |
6b42f61
to
3b0bda5
Compare
if not self._include_group_names: | ||
return state | ||
|
||
new_state = [] |
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.
Do we need this detailed log? If you look at get_filtered_groups
method that we use for crawler, we just filter out the groups based on _include_group_names
. If you report issues with _include_group_names
here then we should also do it in get_filtered_groups
method to make it consistent.
Can we eliminate all the additional loops?
shouldn't something like below be enough?
for row in self._backend.fetch(f"SELECT * FROM {self._full_name}"):
g = MigratedGroup(*row)
if not self._include_group_names or g.name_in_workspace in self._include_group_names:
yield g
…943) ## Changes If the customer runs the assessment, then changes the configuration file to add a new group, UCX won't be able to reflect the changes. This change fixes the above scenario and aims towards an incremental group migration. ### Linked issues Closes #941 ### Tests - [X] manually tested - [X] added unit tests
* Added CLI Command `databricks labs ucx principal-prefix-access` ([#949](#949)). * Added a widget with all jobs to track migration progress ([#940](#940)). * Added legacy cluster types to the assessment result ([#932](#932)). * Cleanup of install documentation ([#951](#951), [#947](#947)). * Fixed `WorkspaceConfig` initialization for `DEBUG` notebook ([#934](#934)). * Fixed installer not opening config file during the installation ([#945](#945)). * Fixed groups in config file not considered for group migration job ([#943](#943)). * Fixed bug where `tenant_id` inside secret scope is not detected ([#942](#942)).
* Added CLI Command `databricks labs ucx principal-prefix-access` ([#949](#949)). * Added a widget with all jobs to track migration progress ([#940](#940)). * Added legacy cluster types to the assessment result ([#932](#932)). * Cleanup of install documentation ([#951](#951), [#947](#947)). * Fixed `WorkspaceConfig` initialization for `DEBUG` notebook ([#934](#934)). * Fixed installer not opening config file during the installation ([#945](#945)). * Fixed groups in config file not considered for group migration job ([#943](#943)). * Fixed bug where `tenant_id` inside secret scope is not detected ([#942](#942)).
* Added CLI Command `databricks labs ucx principal-prefix-access` ([#949](#949)). * Added a widget with all jobs to track migration progress ([#940](#940)). * Added legacy cluster types to the assessment result ([#932](#932)). * Cleanup of install documentation ([#951](#951), [#947](#947)). * Fixed `WorkspaceConfig` initialization for `DEBUG` notebook ([#934](#934)). * Fixed installer not opening config file during the installation ([#945](#945)). * Fixed groups in config file not considered for group migration job ([#943](#943)). * Fixed bug where `tenant_id` inside secret scope is not detected ([#942](#942)).
Changes
If the customer runs the assessment, then changes the configuration file to add a new group, UCX won't be able to reflect the changes.
This change fixes the above scenario and aims towards an incremental group migration.
Linked issues
Closes #941
Tests