[cipd-resolver] Prefer newer tags

The old tag resolution logic had a small bug that prevented it from
always choosing the latest possible set of package instances.

After choosing the anchor package instance, it would choose a subset of
the anchor instance's tags for which there existed an instance of all
the other packages with those tags. However, in the case where the
anchor package has many different version tags and other packages only
have a couple tags per instance (e.g. because the code that produces
those packages changes much more frequently) we wouldn't always choose
the tags that gave us the latest version of all the non-anchor packages.

We solve that by preferring tags on the anchor package that are newer.
This is not perfect because tags may be registered out of order, but in
practice it should work well enough most of the time.

Bug: b/229884348
Change-Id: I7b3cc0d1319b9c760a3d8314971e6b87ba364d56
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/infra/+/672646
Fuchsia-Auto-Submit: Oliver Newman <olivernewman@google.com>
Reviewed-by: Aaron Knobloch <aknobloch@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
2 files changed
tree: 5fac17abffbcbebadf8bcd8dea4309f8d051a696
  1. artifacts/
  2. buildbucket/
  3. checkout/
  4. cmd/
  5. codifier/
  6. execution/
  7. flagutil/
  8. gerrit/
  9. gitiles/
  10. monorail/
  11. rpcutil/
  12. scripts/
  13. third_party/
  14. vendor/
  15. .gitignore
  16. AUTHORS
  17. go.mod
  18. go.sum
  19. LICENSE
  20. MAINTAINERS
  21. manifest
  22. PATENTS
  23. README.md
README.md

infra

This repo contains tools and config files necessary to run infrastructure related to builds, code review, version control, and continuous integrations.