Skip to content
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

STL-744: Add error relate to synchronize translation to execution log #1986

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.68
3.7.69
24 changes: 22 additions & 2 deletions lib/gooddata/lcm/actions/synchronize_clients.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,27 @@ def error_handle(segment, error_result, continue_on_error, params)

# Synchronize failure for all clients in segment
if continue_on_error && success_count.zero? && failed_count.positive?
segment_warning_message = "Failed to synchronize clients for #{segment.segment_id} segment. Details: #{sync_result['links']['details']}"
segment_warning_message = "Failed to synchronize all clients for #{segment.segment_id} segment. Details: #{sync_result['links']['details']}"
if sync_result['links'] && sync_result['links']['details'] # rubocop:disable Style/SafeNavigation
begin
client = params.gdc_gd_client
response = client.get sync_result['links']['details']
error_detail_result = response['synchronizationResultDetails']

if error_detail_result && error_detail_result['items'] # rubocop:disable Style/SafeNavigation
error_count = 1
error_detail_result['items'].each do |item|
break if error_count > 5

GoodData.logger.warn(error_message(item, segment))
error_count += 1
end
end
rescue StandardError => ex
GoodData.logger.warn "Failed to fetch result of synchronize clients. Error: #{ex.message}"
end
end

add_failed_segment(segment.segment_id, segment_warning_message, short_name, params)
return
end
Expand All @@ -192,7 +212,7 @@ def error_handle(segment, error_result, continue_on_error, params)

def error_message(error_item, segment)
error_client_id = error_item['id']
error_message = "Failed to synchronize #{error_client_id} client in #{segment.segment_id} segment."
error_message = "Failed to synchronize #{error_client_id} client in #{segment.segment_id} segment"
error_message = "#{error_message}. Detail: #{error_item['error']['message']}" if error_item['error'] && error_item['error']['message']

error_message = "#{error_message}. Error items: #{error_item['error']['parameters']}" if error_item['error'] && error_item['error']['parameters']
Expand Down