{"id":43675,"date":"2018-05-23T16:35:13","date_gmt":"2018-05-23T23:35:13","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/devops\/?p=43675"},"modified":"2019-02-14T15:49:59","modified_gmt":"2019-02-14T23:49:59","slug":"upstreams-for-vsts-feeds","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/upstreams-for-vsts-feeds\/","title":{"rendered":"Use packages reliably with upstreams for VSTS feeds"},"content":{"rendered":"<p>Software packages are a crucial part of development in languages ranging from C# to JavaScript to Python to Go. They help you iterate faster, avoid solving a problem that\u2019s been solved many times before, and allow you to focus on your unique value. But, they can also add uncertainty and risk to your development process. Packages are sometimes removed from the public registries, or those registries are down. Even packages from other teams in your organization can sometimes become unavailable, if the creating team deletes the feed or has a retention policy that cleans up old versions you still rely on.<\/p>\n<p>With the upstream sources features that are now rolling out to all Package Management feeds, you can eliminate these concerns and consolidate all the packages you depend on into one feed.<\/p>\n<h2>Upstream sources between VSTS feeds<\/h2>\n<p>Upstream sources (for NuGet and npm) are now available between VSTS feeds within the same account, and between feeds in multiple VSTS accounts that are within an <a href=\"https:\/\/blogs.msdn.microsoft.com\/devops\/2016\/01\/11\/how-we-plan-to-enable-creating-multiple-collections-per-account\/\">organization<\/a>. With a few clicks, you can add another team\u2019s feed as an upstream source and start using their packages, without altering the NuGet.config or .npmrc in your project.<\/p>\n<p>When you use packages through an upstream source, a few helpful things happen. First, your feed saves a copy of the package that\u2019s retained until you delete it. That means that if the upstream feed goes away, your builds keep running. You can also manage this package just like any other package in your feed. If you want to move your team off an old version of a package from an upstream, you can unlist\/deprecate it or delete it. And finally, the saved package also remembers where it comes from and provides a helpful link back to the package in the upstream feed.<\/p>\n<p><img decoding=\"async\" width=\"1010\" height=\"427\" class=\"alignnone size-full wp-image-43695\" alt=\"A package in the list with the source column highlighted\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2018\/05\/package-list.png\" \/><\/p>\n<h2>Upstream sources for public registries<\/h2>\n<p>You can also add upstream sources to public registries like\u00a0<a href=\"https:\/\/nuget.org\">nuget.org<\/a>\u00a0and <a href=\"https:\/\/npmjs.com\">npmjs.com<\/a>. Just like with VSTS feeds as upstream sources, using public registries via upstream sources means VSTS keeps a saved copy of every package you use from the public source.<\/p>\n<h2>Getting started with VSTS upstream sources<\/h2>\n<p>Setting up a VSTS upstream source is a 2-stage process. First, you\u2019ll need to ensure that the feed you want to add as an upstream source has a view that\u2019s shared. Feeds created in the last few weeks will already have this set up correctly.<\/p>\n<p>If the feed you\u2019re adding is older, have its owner go to <strong>feed settings, <\/strong>select the <strong>Views<\/strong> pivot, select the view they want to share with you (<strong>@local <\/strong>is a great one to start with), click <strong>Edit, <\/strong>and select the <strong>Shared with my organization<\/strong> radio button and click <strong>Save. <\/strong>Learn more about views and upstream sources <a href=\"https:\/\/docs.microsoft.com\/en-us\/vsts\/package\/concepts\/views\">in the docs<\/a>.<\/p>\n<p><img decoding=\"async\" width=\"1057\" height=\"484\" class=\"alignnone size-full wp-image-43705\" alt=\"The configuration panel for adding a view\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2018\/05\/view.png\" \/><\/p>\n<p>Then, to add an upstream source, go to <strong>feed settings<\/strong>, select the <strong>Upstream sources<\/strong> pivot, then select <strong>Add<\/strong>.<\/p>\n<p><img decoding=\"async\" width=\"1285\" height=\"635\" class=\"alignnone size-full wp-image-43725\" alt=\"The configuration panel for adding an upstream source\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2018\/05\/upstream-source.png\" \/><\/p>\n<p>For more detailed instructions, <a href=\"https:\/\/docs.microsoft.com\/en-us\/vsts\/package\/how-to\/set-up-upstream-sources?view=vsts\">see the docs<\/a>.<\/p>\n<h2>Getting started with upstream sources to public registries<\/h2>\n<p>If you&#8217;ve created your feed within the last few months, you&#8217;re already set to use the\u00a0<a href=\"https:\/\/nuget.org\">nuget.org<\/a>\u00a0and <a href=\"https:\/\/npmjs.com\">npmjs.com<\/a>\u00a0upstream sources, unless you selected &#8220;Only use packages published to this feed&#8221; when you created your feed. If you did, or if your feed is older, just go to <strong>feed settings<\/strong>, select the <strong>Upstream sources<\/strong> pivot, then select <strong>Add<\/strong>.<\/p>\n<h2>New \u201cCollaborator\u201d permission for feeds<\/h2>\n<p>With upstream sources comes a new permissions level: \u201cCollaborator\u201d. In the private preview of upstream sources, we heard from many of you that there\u2019s a different level of trust between \u201centities allowed to publish my packages to my feed\u201d and \u201centities allowed to use packages from an upstream I already trust\u201d. If that sounds like you, you\u2019re in luck. \u201cContributors\u201d, as always, are able to publish packages directly to the feed (e.g. with <code>npm publish<\/code>). \u201cCollaborators\u201d can save new packages from upstream sources (e.g. \u2018npm install package-from-upstream\u2019). \u201cReaders\u201d can only use packages that a Collaborator or above has already saved or published to the feed.<\/p>\n<h2>What\u2019s next<\/h2>\n<p>Over the course of the summer, we expect to add support for other public\/non-authenticated NuGet and npm package sources. Upstream sources for Maven packages are on the backlog \u2013 help us prioritize by voting on <a href=\"https:\/\/visualstudio.uservoice.com\/forums\/330519-visual-studio-team-services\/suggestions\/32996752-add-upstream-sources-for-maven-feeds\">this UserVoice item<\/a>.<\/p>\n<p>If you\u2019d like to learn more about the concepts behind upstream sources, <a href=\"https:\/\/docs.microsoft.com\/en-us\/vsts\/package\/concepts\/upstream-sources\">check out the docs<\/a>.<\/p>\n<p>We\u2019d love to hear from you about how upstream sources are working for you \u2013 just shoot me a tweet <a href=\"https:\/\/twitter.com\/alexmullans\">@alexmullans<\/a> or use the blog comments below. If you run into any bugs (we hope not!), log \u2018em on <a href=\"https:\/\/developercommunity.visualstudio.com\/spaces\/21\/index.html\">Developer Community<\/a> and we\u2019ll take a look.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Software packages are a crucial part of development in languages ranging from C# to JavaScript to Python to Go. They help you iterate faster, avoid solving a problem that\u2019s been solved many times before, and allow you to focus on your unique value. But, they can also add uncertainty and risk to your development process. [&hellip;]<\/p>\n","protected":false},"author":734,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-43675","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"acf":[],"blog_post_summary":"<p>Software packages are a crucial part of development in languages ranging from C# to JavaScript to Python to Go. They help you iterate faster, avoid solving a problem that\u2019s been solved many times before, and allow you to focus on your unique value. But, they can also add uncertainty and risk to your development process. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/43675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/734"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=43675"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/43675\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=43675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=43675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=43675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}