Fix Cosmos Samples#18623
Conversation
|
API changes have been detected in |
simorenoh
left a comment
There was a problem hiding this comment.
Just had a couple questions, but it looks great! Good to have this fixed!
| "@azure/cosmos": "latest", | ||
| "dotenv": "latest", | ||
| "@azure/identity": "^2.0.1", | ||
| "@azure/identity": "^1.1.0", |
There was a problem hiding this comment.
why are we lowering this version?
There was a problem hiding this comment.
The sample tool automatically picks the version of @azure/identity that @azure/cosmos uses for its own samples. We can just manually undo this change or upgrade @azure/cosmos to identity v2.
There was a problem hiding this comment.
@azure/cosmos Upgraded to identity v2
| "@azure/cosmos": "latest", | ||
| "dotenv": "latest", | ||
| "@azure/identity": "^2.0.1", | ||
| "@azure/identity": "^1.1.0", |
There was a problem hiding this comment.
same question as other package.json
There was a problem hiding this comment.
@azure/cosmos Upgraded to identity v2
| import { SasTokenPermissionKind } from "../../../dist-esm/common"; | ||
| import { createAuthorizationSasToken } from "../../../dist-esm/utils/SasToken"; | ||
| import { SasTokenProperties } from "../../../dist-esm/client/SasToken/SasTokenProperties"; | ||
| import { SasTokenProperties,SasTokenPermissionKind,createAuthorizationSasToken } from "@azure/cosmos"; |
There was a problem hiding this comment.
since all the imports are from @azure/cosmos and so is the CosmosClient then why not have them in the same import statement?
There was a problem hiding this comment.
I recommend running the "organize imports" source action in VSCode. It will combine and sort imports.
There was a problem hiding this comment.
since these are tests , i have changed it to import from the src
witemple-msft
left a comment
There was a problem hiding this comment.
The samples themselves already look a lot better. There are several things I noticed looking through that we need to address first, and two high-level comments:
- Files in the /samples folder at the root of the repo are deleted in this PR. You'll need to check them back out from the main branch to restore that directory.
- There are a lot of uses of
?.which is good syntax but won't work in Node 12. I've shown an example of some patterns that you can use instead in the comments, but in a lot of cases you're working with an object that it would be an error of some kind if it were undefined, so if you notice you're doingx?.ya lot, and you really expectxto have a value, you can instead wrap the whole thing in an if:
if (x !== undefined) {
// Body here
} else {
// print an error message
} | } | ||
|
|
||
| // @public (undocumented) | ||
| export function getUserAgent(suffix?: string): string; |
There was a problem hiding this comment.
Function has no documentation comment. Are you certain this should be public?
| } | ||
|
|
||
| // @public (undocumented) | ||
| export enum SasTokenPermissionKind { |
xirzec
left a comment
There was a problem hiding this comment.
I'm confused about the changes outside of the cosmos folder
xirzec
left a comment
There was a problem hiding this comment.
Thanks for fixing the deletion issue! 👍
|
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: |
|
/azp run js - cosmosdb - ci |
|
Azure Pipelines failed to run 1 pipeline(s). |
|
/azp run js - cosmosdb - ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
API changes have been detected in |
|
@sajeetharan I made a few changes.
|
|
/azp run js - cosmosdb - tests |
|
No pipelines are associated with this pull request. |
witemple-msft
left a comment
There was a problem hiding this comment.
Thank you, @sajeetharan for your hard work on this.
| "composite": false, | ||
| "noEmit": true, | ||
| "strict": true | ||
| "strict": false |
There was a problem hiding this comment.
I wonder why this change was needed?
Fix issue #17930
Note : We need to publish the SDK as the samples uses some of the exports which are not in live yet. SasTokenAuth.ts