MSF-21292: Add capability to remove old master workspaces to LCM brick#1802
MSF-21292: Add capability to remove old master workspaces to LCM brick#18021 commit merged intogooddata:masterfrom
Conversation
|
Build succeeded (check pipeline). |
|
Build in pipeline check aborted. |
1 similar comment
|
Build in pipeline check aborted. |
|
Build in pipeline check aborted. |
|
Build succeeded (check pipeline). |
|
Build in pipeline check aborted. |
|
Build succeeded (check pipeline). |
|
Build in pipeline check aborted. |
|
Build succeeded (check pipeline). |
| project = client.projects(project_wrapper[:master_project_id]) | ||
| GoodData.logger.info "Segment #{segment.segment_id}: Deleting old master workspace, project: '#{project.title}', PID: (#{project.pid})." | ||
| project.delete | ||
| removal_master_project_ids << project_wrapper[:master_project_id] |
There was a problem hiding this comment.
Add catch exception for each project deletion.
|
Build in pipeline check aborted. |
|
Build succeeded (check pipeline). |
|
Build in pipeline check aborted. |
|
Build succeeded (check pipeline). |
|
Build in pipeline check aborted. |
|
Build succeeded (check pipeline). |
| begin | ||
| removal_master_project_ids = remove_old_master_workspace(params, segment.segment_id, master_projects, number_of_deleted_projects) | ||
| remove_release_table(params, domain_name, data_product.data_product_id, segment.segment_id, master_projects, removal_master_project_ids) | ||
| rescue => e |
There was a problem hiding this comment.
rescue StandardError => e , Or we can move rescue to remove_release_table function, we already have rescue for remove_old_master_workspace
| "Details: #{sync_result['links']['details']}") | ||
| end | ||
|
|
||
| # rubocop:disable Style/RescueStandardError |
| end | ||
| end | ||
| end | ||
| # rubocop:enable Style/RescueStandardError |
| [ | ||
| { master_project_id: 'foo', version: 2, segment_id: 'premium' }, | ||
| { master_project_id: 'bar', version: 3, segment_id: 'premium' }, | ||
| { master_project_id: 'baz', version: 1, segment_id: 'premium' } |
| expect(GoodData::LCM2::Helpers.get_master_project_list_from_nfs(domain_id, data_prod_id, 'first_segment')).to eq(result) | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Add test for update_master_project_from_nfs and remove_old_master_workspace
| GoodData.logger.info "Segment #{segment_id}: Deleting old master workspace, project: '#{project.title}', PID: (#{project.pid})." | ||
| project.delete if project && !project.deleted? | ||
| removal_master_project_ids << project_wrapper[:master_project_id] | ||
| rescue => ex |
| if keep_only_previous_masters_count >= 0 | ||
| number_of_deleted_projects = master_projects.count - (keep_only_previous_masters_count + 1) | ||
|
|
||
| if number_of_deleted_projects.positive? |
There was a problem hiding this comment.
why don't we just simply check something like: master_projects.count - keep_only_previous_masters_count > 1
There was a problem hiding this comment.
discussed about it and we keep it as current because we need to remove latest master workspace from list
| project.delete if project && !project.deleted? | ||
| removal_master_project_ids << project_wrapper[:master_project_id] | ||
| rescue => ex | ||
| GoodData.logger.error "Unable to remove master workspace, reason: #{ex}" |
There was a problem hiding this comment.
"Unable to remove master workspace: '#{master_project_id}', Error: #{ex}"
|
Build in pipeline check aborted. |
1 similar comment
|
Build in pipeline check aborted. |
|
Build in pipeline check aborted. |
|
Build in pipeline check aborted. |
1 similar comment
|
Build in pipeline check aborted. |
|
Build in pipeline check aborted. |
1 similar comment
|
Build in pipeline check aborted. |
|
Build in pipeline check aborted. |
|
Build succeeded (check pipeline). |
|
Build in pipeline check aborted. |
1 similar comment
|
Build in pipeline check aborted. |
|
Build in pipeline check aborted. |
|
Build succeeded (check pipeline). |
|
LGTM |
| let(:latest_data) do | ||
| [ | ||
| { master_project_id: 'opi15', version: 3 } | ||
| ] |
There was a problem hiding this comment.
Here we test only WRITE "one master project", missing usecase WRITE "many master projects". It can miss the bug that our loop to write multiple projects doesn't work.
|
Build in pipeline check aborted. |
|
Build succeeded (check pipeline). |
|
Build in pipeline check aborted. |
|
Build succeeded (check pipeline). |
Sonar scan resultMore detail, see in https://sonarqube-gate.intgdc.com/dashboard?id=gooddata-ruby-gate-PR1802 To scan for vulnerabilities in dependencies and run unit tests (to get coverage report in sonar) please comment your PR with 'extended check sonar'. |
|
Build succeeded (gate pipeline).
|
Uh oh!
There was an error while loading. Please reload this page.