-
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
[ContainerRegistry] Migrate samples to v2 workflow #14750
Conversation
jeremymeng
commented
Apr 6, 2021
- move to sample v2 workflow
"JavaScript" | ||
"azure", | ||
"cloud", | ||
"typescript" |
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.
I'm not sure what the precedent for JS/TS libraries is here, but would it make sense to keep JavaScript in the list?
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.
I'd prefer JavaScript over typescript because our customers are JS developers and TS is one of the tool in JS ecosystem.
Regarding the casing, this file is generated. @willmtemple we should use lower case keywords to be consistent with out SDK libraries?
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.
ah I miss read the comments. It's reasonable to have JavaScript
in the JS samples' package.json. @willmtemple maybe you can replace "typescript"
with "javascript"
while generate the package.json?
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.
My thought is that putting "javascript" as a keyword in an NPM package is a bit like putting ".NET" as a tag on a NuGet package. It's implicitly assumed that an NPM package is a JavaScript package. In any case, these aren't indexed at all, so if we want to replace them I'm happy to add an item to implement that feature, but it seems low priority to me.
console.log(` repository: ${repository}`); | ||
} | ||
|
||
console.log(" by pages"); |
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.
In .NET, iterating through the collection by pages -- rather than one element at a time and letting the client handle retrieving subsequent pages -- is a relatively advanced scenario and not something we distract customers with in our "getting started" documentation. I don't mind providing a sample for it, but I would make sure the sample indicated that this is relatively advanced, and not the "getting started" path.
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.
That's fair. I will extract it into a new method and add some comments
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.
We do include paged iteration in some form or another in most package samples for packages that support it. For Form, we show how to do paged iteration of models. There, it is in a specific sample that we use to show methods of iterating over the models.
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, in storage we also have separate samples iterators (because we have so many ways to use them). I will consider doing similar in next release.
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.
Tracked in #14674
} | ||
|
||
console.log(" by pages"); | ||
const pages = client.listTags().byPage({ maxPageSize: 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.
See comment above re: byPage being advanced usage.
- move listing by pages to separate methods as they are more advanced scenarios. - also update apidocs link for beta.1 as docs haven't been published
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.
LGTM.
Co-authored-by: Will Temple <witemple@microsoft.com>
* [ContainerRegistry] Migrate samples to v2 workflow * Add comments about endpoint format * Address CR feedback - move listing by pages to separate methods as they are more advanced scenarios. - also update apidocs link for beta.1 as docs haven't been published * Use javascript tag in JS samples' package.json * Update sdk/containerregistry/container-registry/sample.env Co-authored-by: Will Temple <witemple@microsoft.com> Co-authored-by: Will Temple <witemple@microsoft.com>