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

Refactor source resource to return more metadata #1304

Merged
merged 10 commits into from
Apr 27, 2023

Conversation

olblak
Copy link
Member

@olblak olblak commented Apr 25, 2023

Related to #1299

Instead of returning a source result as a simple string.

This pullrequest introduces the result.Source struct. This new struct allows to save additional information such as the "source" execution description, result, and information retrieved from the source.

Any error returned by the function would result the source execution as a failure.

It's up to the source plugin to decide if an empty value should be considered as an error or not.
If an empty value is allowed by a plugin, then we always display a "debug" message.

While some mistake could have slip during the refactor, normally everything should work the same way it used to be

Test

To test this pull request, you can run the following commands:

cp <to_package_directory>
go test

Additional Information

Tradeoff

Potential improvement

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added the cleanup label Apr 25, 2023
@olblak olblak marked this pull request as draft April 25, 2023 18:53
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
@olblak olblak marked this pull request as ready for review April 27, 2023 11:48
@olblak olblak merged commit 32d6408 into updatecli:main Apr 27, 2023
5 checks passed
@olblak olblak changed the title Refactor source report Refactor source resource to return more metadata May 5, 2023
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

1 participant