AddAssetLocationToDependenciesAsync should be (a little) smarter
- [ ] This issue is blocking
- [x] This issue is causing unreasonable pain - Well, maybe.
When we have two branches with the same commit that are producing a stable build, the dependency updater can get confused and remove (or not add) maestro managed feeds from the nuget.config file. This is generally when:
- Two builds of the same commit have been made
- They are on different branches
- The later build (in terms of BAR assignment) is not assigned to a channel.
What happens is that the existing and new dependencies are looked up in BAR. this lookup is only by asset name and version, then match based on commit, because that's what is specified in the version file. This is by design for lots of reasons and we cannot change this. This means that multiple BAR ids could correspond to the same assets. Anyways, we go to find the assets, then note their locations. In case we find more than one match, we pick the locations from the latest build. These are then fed into the update and we can get maestro feeds in the nuget.config file.
The problem is that if the latest build wasn't published, then we wouldn't see any locations, and then we would add any feeds. This is mainly annoying as it requires constantly adding back feeds, turning off mirrors to avoid multiple builds, or potentially publishing the later build.
We can make this a bit smarter by doing the following in cases of multiple builds:
- Filter away ones that aren't published to a channel if any one was published to a channel.
- If there are other existing or new dependencies that we can say definitively came from a specific build, preference use of that build.
@riarenas More nuance in dependency-land
It feels like there are quite a handful of dependency flow issues floating in un-triaged land. Should we consider a sort of mini "dependency flow cleanup/tech debt" epic for them? @markwilkie @Chrisboh @mmitche
Isn't that sort of dotnet/arcade-services#2570?