Repository navigation
feat: Improved Refresh() Varlink method - #634
Merged
Merged
Conversation
jirihnidek
force-pushed
the
jhnidek/varlink_improved_refresh_method
branch
2 times, most recently
from
November 6, 2026 14:16
e0dd96f to
ae42b0f
Compare
DuckBoss
self-requested a review
November 6, 2026 15:50
DuckBoss
requested changes
Nov 6, 2026
DuckBoss
left a comment
Contributor
There was a problem hiding this comment.
I have some small requests, but overall it looks good.
jirihnidek
force-pushed
the
jhnidek/varlink_improved_refresh_method
branch
from
November 9, 2026 13:48
ae42b0f to
9b1587a
Compare
Contributor
Author
|
This PR is blocking another PR for our libdnf5 plugin: candlepin/rhsm-dnf5-plugins#31 |
Peto-RH
reviewed
Nov 10, 2026
Peto-RH
left a comment
Contributor
There was a problem hiding this comment.
This PR looks already good to me. I have just one nit comment.
* Card ID: CCT-1865 * Method com.redhat.rhsm.testing.content.Refresh() returns information about updated entitlement certificate and key. The returned object could look like this: ```json { "result" : { "certificate_path" : "/etc/pki/entitlement/8892792528256186296.pem", "key_path" : "/etc/pki/entitlement/8892792528256186296-key.pem" } } ``` * It also returns specific error: `com.redhat.rhsm.testing.content.CertificateUpToDate`, when certificate is up-to-date. There is nothing wrong about this approach. Many systemd Varlink methods return custom errors to signal various normal states. * Modified .varlink definition file accordingly * When redhat.repo file is not possible to write, then return appropriate error * The `redhat.repo` file is regenerated by Refresh() method, when something or somebody deleted this file * Modified and improved integration tests; added a new JSON schema for object returned by Refresh() * Found one issue in rhc-server and added commented integration test for this case. It will be fixed in rhsm2 * Updated go.mod Assisted by: Claude Opus 5.5 Signed-off-by: Jiri Hnidek <jhnidek@redhat.com>
jirihnidek
force-pushed
the
jhnidek/varlink_improved_refresh_method
branch
from
November 10, 2026 13:47
9b1587a to
c9326d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
com.redhat.rhsm.testing.content.Refresh()returns information about updated entitlement certificate and key. The returned object could look like this now:{ "result" : { "certificate_path" : "/etc/pki/entitlement/8892792528256186296.pem", "key_path" : "/etc/pki/entitlement/8892792528256186296-key.pem" } }"success": truecom.redhat.rhsm.testing.content.CertificateUpToDate, when certificate is up-to-date. There is nothing wrong about this approach. E.g. many systemd Varlink methods return custom errors to signal various normal states. This approach is IMHO more elegant than returning object with some boolean attribute signaling some state or returning object with result and some boolean attribute signaling some state.redhat.repofile is not possible to write, then return appropriate errorredhat.repofile is regenerated by Refresh() method, when something or somebody deleted this fileAssisted by: Claude Opus 5.5