-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Create Device Models Repository Client #14863
Conversation
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
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.
The client should detect when the requested model-id does not match casing.
Eg, the next resolution should fail
const dmr = require("../../dist/index.js")
const dmrClient = new dmr.ModelsRepositoryClient()
main = async () => {
const models = await dmrClient.getModels('dtmi:com:example:temperatureController;1')
console.log(JSON.stringify(models, null, 2))
}
main().catch(e=>console.error(e))
sdk/iot/modelsrepository/review/iot-modelsrepository-client.api.md
Outdated
Show resolved
Hide resolved
sdk/iot/modelsrepository/review/iot-modelsrepository-client.api.md
Outdated
Show resolved
Hide resolved
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.
Good work! I'm happy with where this has landed, thanks for the quick turnaround in handling feedback. I replied to the open threads I saw, let me know if I missed anything.
@@ -0,0 +1,158 @@ | |||
<!-- The following YAML bit is needed by the docs system to publish the samples online. Uncomment/Update it when the samples can be published publically --> |
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.
/cc @willmtemple for feedback on the samples workflow
} | ||
}; | ||
|
||
const currentPlatform = isBrowser() ? "browser" : isNode() ? "node" : "undefined"; |
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.
out of curiosity, what do you do when currentPlatform
is "undefined"? Also curious if it should be the actual value undefined
instead of the string
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.
right now there is no real use for currentPlatform, which is probably why I let the bug on uncalled functions through. It is used to create a default user agent string, but the service is unmanaged so there's really no user agent string processing right now. This is just a future-proofing step.
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.
UserAgentPolicy can take care of platform detection:
It already grabs the platform, bitness, etc
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.
It's part of the default pipeline returned by createPipelineFromOptions
:
export function createPipelineFromOptions(options: InternalPipelineOptions): Pipeline { |
Or you can make an empty one and add it in if you don't want the other default behaviors
[resources] delete useless track1 configuration for python (Azure#14863) * Update readme.python.md * Update readme.md
[resources] delete useless track1 configuration for python (Azure#14863) * Update readme.python.md * Update readme.md
[resources] delete useless track1 configuration for python (Azure#14863) * Update readme.python.md * Update readme.md
[resources] delete useless track1 configuration for python (Azure#14863) * Update readme.python.md * Update readme.md
[resources] delete useless track1 configuration for python (Azure#14863) * Update readme.python.md * Update readme.md
[resources] delete useless track1 configuration for python (Azure#14863) * Update readme.python.md * Update readme.md
This includes the untested new code structure for the Device Models Repository Client, following closely to the architecture of the Python Models Repository Client (Azure/azure-sdk-for-python#17180)
It is currently untested, and likely has bugs. In addition the tests for Node.js are not complete and neither is the rollup configuration. Futher testing using karma must be conducted to validate browser compatibility, based on shimming the filesystem calls and other node specific utilities.