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

[Nuctl] Change error handling logic for function import #3106

Merged
merged 8 commits into from
Jan 4, 2024

Conversation

rokatyy
Copy link
Contributor

@rokatyy rokatyy commented Jan 2, 2024

Jira - https://jira.iguazeng.com/browse/NUC-118
It's just a first iteration of upcoming changes in nuctl import logic.
In this PR, we introduce error logging for each function import process.

We are moving away from using errgroup to enable the tracking of errors for each import individually. This change will enable us to generate a finely-grained report (in following PR) for each failed import, complete with a detailed description and recommendations.

@rokatyy rokatyy changed the title [Nuctl] Change function import logic [Nuctl] Change error handling for function import logic Jan 2, 2024
@github-actions github-actions bot added the nuctl label Jan 2, 2024
@rokatyy rokatyy changed the title [Nuctl] Change error handling for function import logic [Nuctl] Change error handling logic for function import Jan 2, 2024
@rokatyy rokatyy marked this pull request as ready for review January 2, 2024 16:58
Copy link
Contributor

@TomerShor TomerShor left a comment

Choose a reason for hiding this comment

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

Minor English suggestions, otherwise lgtm

pkg/nuctl/command/import.go Outdated Show resolved Hide resolved
pkg/nuctl/command/import.go Outdated Show resolved Hide resolved
pkg/nuctl/command/import.go Outdated Show resolved Hide resolved
Co-authored-by: TomerShor <90552140+TomerShor@users.noreply.github.com>
pkg/nuctl/command/import.go Outdated Show resolved Hide resolved
pkg/nuctl/command/import.go Outdated Show resolved Hide resolved
pkg/nuctl/command/import.go Outdated Show resolved Hide resolved
Comment on lines 146 to 148
if importFailed.Load() {
return errors.New("Import failed for some of the functions")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs to be more indicative. at least provide function names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@liranbg then we will logs them twice - firstly right from goroutine and secondly from here

Copy link
Contributor

Choose a reason for hiding this comment

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

@rokatyy It's not that bad to log that again, because with many functions the logs can be noisy and it can be easy to miss warnings/errors.

a single log line at the end can be very useful.

Copy link
Contributor Author

@rokatyy rokatyy Jan 3, 2024

Choose a reason for hiding this comment

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

@TomerShor Agreed. I've added TODO for this. The plan is to create a custom structure importReport in the following PR which will contain methods like Print and SaveToFile.

pkg/nuctl/command/import.go Show resolved Hide resolved
pkg/nuctl/command/import.go Outdated Show resolved Hide resolved
pkg/nuctl/command/import.go Show resolved Hide resolved
Comment on lines 146 to 148
if importFailed.Load() {
return errors.New("Import failed for some of the functions")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@rokatyy It's not that bad to log that again, because with many functions the logs can be noisy and it can be easy to miss warnings/errors.

a single log line at the end can be very useful.

@rokatyy rokatyy requested a review from TomerShor January 3, 2024 11:17
@TomerShor TomerShor merged commit 244802f into nuclio:development Jan 4, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants