[cipd-resolver] Ensure deterministic tag ordering

If a package has multiple tags with the same timestamp, fall back to
sorting by tag value to ensure determinism - otherwise the ordering
would be nondeterministic (since it depends on map ordering), leading to
nondeterministic behavior.

This was manifesting in the recipe-tools-roller when it encountered a
package whose latest instance had multiple tags with the same key but
different values, and one of those two tags was duplicated on another
instance, making it unresolvable. So the roller's behavior varied
depending on which tag it happened to check first:
https://screenshot.googleplex.com/4XN6rpBFzzfRrCL

Bug: 341709889
Change-Id: I1d1f150e3118c2e863aee3914c66d7f8d1d07220
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/infra/+/1050394
Fuchsia-Auto-Submit: Oliver Newman <olivernewman@google.com>
Reviewed-by: Danielle Kay <danikay@google.com>
Reviewed-by: David Fang <fangism@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
1 file changed
tree: 3fc3b1dc23f5acc094b3c75c7b7be91f70ac864c
  1. artifacts/
  2. buildbucket/
  3. checkout/
  4. cmd/
  5. execution/
  6. flagutil/
  7. functools/
  8. gerrit/
  9. gitiles/
  10. issuetracker/
  11. rpcutil/
  12. scripts/
  13. third_party/
  14. vendor/
  15. .gitignore
  16. AUTHORS
  17. go.mod
  18. go.sum
  19. LICENSE
  20. manifest
  21. PATENTS
  22. 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.