Skip to content

Devices batching support added#75

Merged
sergkh merged 3 commits intomasterfrom
batching-support
Feb 15, 2022
Merged

Devices batching support added#75
sergkh merged 3 commits intomasterfrom
batching-support

Conversation

@sergkh
Copy link
Copy Markdown
Member

@sergkh sergkh commented Feb 14, 2022

Adds ability to automatically batch devices post issuence.
How it works?

  • FidesmoCard now have online and offline device identification options, where online version tries to identify device by the CPLC data on the server as the last resort
  • Implicit batching for operations that require a Fidesmo device, like installation, store-data etc
  • On device info command we only print instructions of how to do batching manually without performing any changes

Other related changes:

  • As batchId in the FidesmoCard can be obtained from the server it moved to integer, breaking change, but AFAIK it's only used internally and was always converted to int every time, so better to have it correct as soon as possible.
  • Added a batched flag to the FidesmoCard.
  • Added a DeliveryUrl parser, as it started to be used in multiple places
  • Env variable normalisation: we expect an URL ending with / and if the variable specified without it client fails.
  • Moved validation of the fidesmo device presence closer to the usage, as some operations allows chaining and it was throwing an error for instance if user obtains device information on non Fidesmo device

@sergkh sergkh requested a review from martinpaljak as a code owner February 14, 2022 14:41
@sergkh sergkh requested review from JSantosP and removed request for martinpaljak February 14, 2022 14:41
Copy link
Copy Markdown
Member

@JSantosP JSantosP left a comment

Choose a reason for hiding this comment

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

LGTM (too hacky the way we validate URIs BTW)

@sergkh
Copy link
Copy Markdown
Member Author

sergkh commented Feb 15, 2022

You mean new URI(...) or in general? I've tried to get something like ADT with proper fields for different deliveries, but it's a pain in Java, that's why it's a compromise of reducing fields bug still having validation.

@JSantosP
Copy link
Copy Markdown
Member

I mean splitting the uri string and look for specific positions to generate the DeliveryUrl.
I would add some ADT regarding that as you mention, but I guess having less abstract layers over a command line interpreter may make it lighter. I don't know...

@sergkh
Copy link
Copy Markdown
Member Author

sergkh commented Feb 15, 2022

Yeah that one is hacky indeed. Even though every unstructured input parsing is always hacky. As for ADTs I've tried, but the usability of in in java is still quite bad. Hope this will change with Java 18 :)

@sergkh sergkh merged commit cda587c into master Feb 15, 2022
@sergkh sergkh deleted the batching-support branch February 15, 2022 10:46
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.

2 participants