-
Notifications
You must be signed in to change notification settings - Fork 22
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
license show
command
#374
base: dev
Are you sure you want to change the base?
license show
command
#374
Conversation
Two EndToEnd tests fail with a message:
Is there anything in this PR that could cause this error? Looks strange to me. |
Thanks! That looks great. Currently, RE the output wrapper entity, this looks great, but because not all licenses carry subscription ids (e.g. trials, the Individual version, etc.), output won't be optimal in those cases. I think supplying the certificate in the output wrapper's Sorry about the "cluster nodes" test failure. Unfortunately we've published a 2025.1 |
We have an API client update that will work its way through to |
I've made the requested edits.
|
@nblumhardt did you already check on this? |
Hi @gprossliner! Thanks for following up; we've pulled in the Seq 2025.1 API and have the tests running on |
{ | ||
Log.Warning("No license is currently applied to the server."); | ||
return 2; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we should remove this. If there's no license applied to the server, since the output format is effectively just what's displayed in the "License text" control, returning 0
here with no output is fine. (The rest of seqcli
follows a fairly similar set of conventions, e.g. seqcli config get -k ...
will produce no output if a setting is blank. This makes use in shell scripts easier.)
The test will only see the license supplied on STDIN if it takes a dependency on |
Relevant issue here #373
There are some open points for discussion:
OutputFormatter
I use the
OutputFormatFeature
like other commands do. This enables--json
output, which looks great. But without--json
it just printslicense-server
, which is not very informative.I currently find no way to behave the
OutputFormatter.WriteEntity
in a different way, because it has like a constant format string$"{entity.Id} {dyn.Title ?? dyn.Name ?? dyn.Username ?? dyn.Expression}"
.I could:
!_output.Json
and create a DTO object for output likenew {Id=license.SubscriptionId}
so this get printed instead._output
but write directly to the console / Serilog--json
EDIT: I've implemented a OutputWrapperLicenseEntity for better text output.
Return code
If no licence is applied, should be an error returned or not? Currently I return 2, which should be distinct from a "general error".
Test cases
I could write Tests as there are some for the Apply command as well LicenseApplyTestsCasecs.cs. As soon as we get the Return code sorted out, I could write one for the unlicensed server. But because I won't publish the license file of the company I work for, I can't add a test showing a license.
Is there a way to get a sort of "Test Licence" that is cryptographically valid, but marked as Testing only? I don't know anything about how you issue licenses, but like one that sets the relevant fields to
0
?If such a license would be available for the public, other use-cases like testing automation in general, should benefit from this.
Please give me some feedback so I can make the final edits on this PR.
Thank you!