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

Add documenation for the rust client #260

Merged
merged 9 commits into from
Apr 17, 2023

Conversation

QuantumDancer
Copy link
Collaborator

This PR introduces the following changes:

  • Add documentation to the client module
  • Removed direct constructors for clients (use the client builder instead)
  • ClientError is now used as the error type in all methods of the client builder and clients

Instead of calling `AuditorClient::new()` directly,
the `AuditorClientBuilder` should be used.
Instead of calling `AuditorClient::from_connection_string()`
directly, the `AuditorClientBuilder` should be used.
This function is actually never used and to create a client the
AuditorClientBuilder should be used anyway.
Instead of calling `AuditorClientBlocking::from_connection_string()`
directly, the `AuditorClientBuilder` should be used.
Besides adding the documenation, this commit also improves the error
propagation for the `build()` and `build_blocking()` methods by
converting possible errors to `ClientError`.
This commit also harmonizes the types of possible that are returned
in the client methods. Now, all errors have the type `ClientError`.
@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2023

Codecov Report

Merging #260 (8d45176) into main (a54f1d6) will increase coverage by 1.35%.
The diff coverage is 93.96%.

@@            Coverage Diff             @@
##             main     #260      +/-   ##
==========================================
+ Coverage   50.86%   52.22%   +1.35%     
==========================================
  Files          41       41              
  Lines        3049     3102      +53     
==========================================
+ Hits         1551     1620      +69     
+ Misses       1498     1482      -16     
Impacted Files Coverage Δ
collectors/slurm-epilog/src/main.rs 0.98% <0.00%> (-0.02%) ⬇️
plugins/priority/src/main.rs 57.60% <0.00%> (-0.64%) ⬇️
pyauditor/src/blocking_client.rs 0.00% <ø> (ø)
auditor/src/client/mod.rs 94.03% <99.09%> (+3.68%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@QuantumDancer QuantumDancer marked this pull request as ready for review April 5, 2023 13:26
Copy link
Contributor

@stefan-k stefan-k left a comment

Choose a reason for hiding this comment

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

Thanks, already looks pretty good. Just a few minor comments.

auditor/src/client/mod.rs Outdated Show resolved Hide resolved
auditor/src/client/mod.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@stefan-k stefan-k left a comment

Choose a reason for hiding this comment

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

Much better! I only have a few minor comments.

auditor/src/client/mod.rs Outdated Show resolved Hide resolved
auditor/src/client/mod.rs Outdated Show resolved Hide resolved
auditor/src/client/mod.rs Outdated Show resolved Hide resolved
auditor/src/client/mod.rs Outdated Show resolved Hide resolved
auditor/src/client/mod.rs Outdated Show resolved Hide resolved
auditor/src/client/mod.rs Outdated Show resolved Hide resolved
auditor/src/client/mod.rs Outdated Show resolved Hide resolved
auditor/src/client/mod.rs Outdated Show resolved Hide resolved
This allows us to reduce the usage of `map_err()` calls.
Copy link
Contributor

@stefan-k stefan-k left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks a lot!

@QuantumDancer QuantumDancer merged commit 74a1fec into ALU-Schumacher:main Apr 17, 2023
@QuantumDancer QuantumDancer deleted the client-docs branch April 17, 2023 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants