Package Source Aggregation and Fallback Behavior

Coordinator
Nov 8, 2010 at 4:28 PM

One of the features we implemented recently was the concept of an Aggregate Package Source an a means of implementing the Package Source Fallback Behavior.

The basic idea is the aggregate source is a special package source that is an aggregate of all the others. You might call it a "virtual" package source since it itself doesn't have a source URI.

Thus when you have the Aggregate source selected, a package with a dependency that's in another feed will install correctly. The common use case for this is if you have a package on a local machine, but it has dependencies on packages in an online feed, you still want to be able to install the local package and its online dependencies.

However, there's a few behaviors we need to clarify and decide upon.

1. In the Add Package Dialog, I can explicitly specify one of the package sources. If I choose to install a package when I have a package source selected, the package should be installed from that source. The packages dependencies should also be installed from that source, unless they don't exist in that source. If they don't exist, the fallback behavior should only fallback to the Aggregate source. Is that the current behavior?

2. I assume the Aggregate source itself aggregates feeds using some ordering. If so, then it may still make sense to allow ordering of the package sources. Of course, this may not be all that important as we make the strong assumption that a package with an id is the same no matter which feed it's in. Should we allow ordering or is that unnecessarily adding more complexity? Keep in mind that we do allow specifying a specific package source in the Add Package Dialog.

Nov 8, 2010 at 5:01 PM

For #2, I think allowing ordering is nice, but low-pri. Maybe for vNext.

Nov 8, 2010 at 5:38 PM

I can add ordering to the Options UI (see issue 356), but I guess I'm still confused on how the aggregate source would work.

If the user selects the Aggregate source, then NuGet should search for package and dependencies in source order. If user selects a specific source, does NuGet *only* search that source, or does it still search the Aggregate?

I think it would make sense to either Search All (Aggregate) or Search Specific. If a users selects a specific source, it seems to me they only want to use that source. Perhaps they want to set up an internal repository of "approved" packages. If NuGet tells them which dependencies are missing from their repository, then they can get approval for the missing packages and add them to their repo. Otherwise, it would kind of make having custom package sources a moot point (NOTE: moot, not mute. Twitter #FTW) :)

 

 

Developer
Nov 8, 2010 at 5:44 PM

For #1 we only ever use the current selected source, we never fall back to the aggregate.

Nov 8, 2010 at 6:03 PM
Edited Nov 8, 2010 at 6:04 PM

That makes more sense. My concern is that this may complicate the Options UI.

If we add an Aggregate source to the list in Options UI:

  • You said it should not be movable - always first in list (also assume not removable)
  • Do we need it to be in the list? Assume it's always available?
  • Only reason I can think to have it in the list is to be able to set it as the Active source.

If we don't add Addregate to the list in Options UI:

  • It simplifies the ordering
  • It would make no sense to have "Active" source, because setting a source here would make it specific and thus prevent searching Aggregate. Catch-22?
  • Can you "Unset" Active source.. meaning nothing is Active (no checkmark), so defaults to Aggregate
  • Perhaps we don't need to have Active source. That we always assume Aggregate unless they specify the Source in console or Add Package UI.

Doesn't it suck when a seemingly simple feature is no longer simple? Sigh.

 

Nov 8, 2010 at 6:07 PM
Edited Nov 8, 2010 at 6:08 PM

Phil and I used to agree on removing the concept of Active source in the Options UI altogether. Phil, is it still the plan?

Developer
Nov 8, 2010 at 6:11 PM

I think active source should be a console only concept (dropdown list). It's confusing to have an active source in the UI. 

Coordinator
Nov 8, 2010 at 6:15 PM

Ah, yes. Let's remove the concept of Active source in the Options UI. I'll create a bug.

Coordinator
Nov 8, 2010 at 6:15 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.