Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Design and implement package feeds and views for local and upstream packages

A worked example

Single answer

The Azure Artifacts feed WebFeed has two upstream sources, in this order:

  1. npmjs.com
  2. PlatformFeed@Release (an Azure Artifacts feed in the same organization)

The platform team republished a customized build of the open-source npm package chart-render to PlatformFeed and promoted it to @Release. No version of chart-render has been saved to WebFeed yet. Developers' .npmrc files reference only WebFeed, and you must make the change without changing developers' .npmrc files. Developers already have the Feed and Upstream Reader (Collaborator) role on WebFeed. Restores of chart-render through WebFeed must return the customized build.

What should you do?

Choose one answer
Why

When a feed has several upstream sources, it searches them in the configured order and uses the first one that holds the requested package. With npmjs.com listed first, WebFeed resolves the public chart-render package. Moving PlatformFeed@Release above npmjs.com makes WebFeed return the customized build, while developers keep referencing only WebFeed.

  • Not correct: Promote the public chart-render version to the @Release view of WebFeed. Promoting the public version would make the public build more visible to consumers, which is the opposite of the requirement to serve the customized build.
  • Not correct: Grant developers the Feed and Upstream Reader (Collaborator) role on WebFeed. Developers already hold this role, and the role governs who can save packages from upstream sources, not which upstream source is searched first.
  • Not correct: Add PlatformFeed as a second registry in each developer's .npmrc file. This edits client configuration, which the scenario forbids, and goes against the guidance to reference one feed and use upstream sources for other sources.
  • Correct: Move PlatformFeed@Release above npmjs.com in the WebFeed upstream source order. The feed searches its upstream sources in sequence and uses the first source that holds the package, so listing PlatformFeed first makes WebFeed resolve the customized build.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free