VirtusLab / bazel-steward

A bot to keep Bazel dependencies up to date
https://virtuslab.github.io/bazel-steward/
Apache License 2.0
62 stars 5 forks source link

Reduced false positives in rules update heuristic #225

Closed lukaszwawrzyk closed 1 year ago

lukaszwawrzyk commented 1 year ago

Lookup for version and checksum replacement now ignores matches that are surrounded with characters that would definitely be a part of if. This avoids replacements like expeced: "3.1" -> "5.2" actual: "3.18.2a" -> "5.28.2a"

Additionally, replacements that found more than 2 components of rule version (version + sha + maybe link) are preferred over single replacement which are likely incorrect.

Fixed a bug in FileChange application logic: it must happen in order of offsets of changes. Otherwise the adjusted offset will not be correct. This worked before due to ordering of version and checksum in test files and ordering of version and checksum in the heuristic that were matching.