dart-lang / dart_ci

Tools used by Dart's continuous integration (CI) testing that aren't needed by Dart SDK contributors. Mirrored from dart.googlesource.com/dart_ci. Do not land pull requests on Github.
BSD 3-Clause "New" or "Revised" License
18 stars 5 forks source link

Results feed source, history, and log links are broken for changes that have been pinned #124

Closed whesse closed 2 years ago

whesse commented 2 years ago

The source link for a results change is broken, if those results have been pinned to a commit other than the last commit of their prior blamelist.

The calculation of the source URL throws an exception, which means that the log link and history link are also not calculated. Example image, showing the links as plain text rather than links.

image

whesse commented 2 years ago

The failure is caused by https://github.com/dart-lang/dart_ci/blob/master/results_feed/lib/src/test_source.dart#L13 which says

 commits.singleWhere((c) => c.index == change.blamelistEndIndex).hash

If the change is pinned, the list "commits" only contains the single pinned commit, not the range from blamelistStartIndex to blamelistEndIndex.

The solution is to replace change.blamelistEndIndex with change.pinnedIndex ?? change.blamelistEndIndex, which is the expression used to compute the last element of the list "commits" when it is constructed.

whesse commented 2 years ago

Fix is in https://dart-review.googlesource.com/c/dart_ci/+/233602