From 26e4d5eb5413895d08aca4f9d5cdfb5231137e84 Mon Sep 17 00:00:00 2001 From: Dima Date: Tue, 27 Jan 2026 01:45:51 +0100 Subject: [PATCH] fix: Github diffs URL In https://github.com/NixOS/hydra/pull/1549 diffs were offloaded to github for performance reasons. While in some endpoints github accepts `.git` suffixed in the repository name, in the comparison endpoint this does not seem to be the case. Specifically, on the main nixos org hydra this isn't working: Example job: https://hydra.nixos.org/build/320178054 Generates a comparison link like so: https://github.com/NixOS/nixpkgs.git/compare/078d69f03934859a181e81ba987c2bb033eebfc5...1cd347bf3355fce6c64ab37d3967b4a2cb4b878c This just stips away the suffix and seems to work fine in local testing. --- src/root/common.tt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/root/common.tt b/src/root/common.tt index 14dad68a..b0a997d5 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -347,9 +347,10 @@ BLOCK renderDiffUri; url = res.0; branch = res.1; IF bi1.type == "hg" || bi1.type == "git" %] - [% IF url.substr(0, 19) == "https://github.com/" %] + [% IF url.substr(0, 19) == "https://github.com/"; + github_url = url.replace('\.git$', '') %] - url + github_url _ "/compare/" _ bi1.revision _ "..."