Skip to content
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

Merged
merged 6 commits into from
Apr 9, 2021

Conversation

jeremymeng
Copy link
Member

  • move to sample v2 workflow

@jeremymeng jeremymeng removed the request for review from bterlson April 6, 2021 19:55
"JavaScript"
"azure",
"cloud",
"typescript"
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member Author

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?

Copy link
Member

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");
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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 });
Copy link
Member

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
Copy link
Member

@witemple-msft witemple-msft left a comment

Choose a reason for hiding this comment

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

LGTM.

sdk/containerregistry/container-registry/sample.env Outdated Show resolved Hide resolved
Co-authored-by: Will Temple <witemple@microsoft.com>
@jeremymeng jeremymeng enabled auto-merge (squash) April 9, 2021 18:48
@jeremymeng jeremymeng merged commit 9eaccd3 into Azure:master Apr 9, 2021
@jeremymeng jeremymeng deleted the acr-samples-v2 branch April 9, 2021 19:29
jay-most pushed a commit to jay-most/azure-sdk-for-js that referenced this pull request Apr 26, 2021
* [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>
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.

3 participants