ci: fetch dependencies before evaluate #128

merged
opened by a.starrysky.fyi targeting main from private/minion/push-mlmuvqqtptlt

Due to what I suspect must be either an npins or a lix bug, we get this error when evaluating our configuration on new machines:

… while fetching the input 'git+https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch?rev=398c9fa782843d8b3aeaa5ebb1c1b3db35c3382f'

error: Cannot find Git revision '398c9fa782843d8b3aeaa5ebb1c1b3db35c3382f' in ref 'refs/heads/master' of repository 'https://gerrit.wikimedia.org/r/mediawiki/extensions/AdvancedSearch'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.

Now, this is what I'd expect - because we're not meant to be fetching master of this extension - we're meant to be fetching a branch! By using npins to prefetch all dependencies, we get around this.

Due to a nilla bug, fetching dependencies is required for evaluation anyway - so this isn't too much more of an issue than it would already have been...

Changed files
+36 -14
packetmix
+32 -10
packetmix/npins/default.nix
··· 85 url, 86 submodules, 87 rev, 88 name, 89 narHash, 90 }: 91 - pkgs.fetchgit { 92 - inherit url rev name; 93 - fetchSubmodules = submodules; 94 - hash = narHash; 95 - }; 96 }; 97 98 # Dispatch to the correct code path based on the type ··· 124 repository, 125 revision, 126 url ? null, 127 submodules, 128 hash, 129 ... ··· 159 "${if matched == null then "source" else builtins.head matched}${appendShort}"; 160 name = urlToName url revision; 161 in 162 - fetchGit { 163 - rev = revision; 164 - narHash = hash; 165 166 - inherit name submodules url; 167 - }; 168 169 mkPyPiSource = 170 { fetchurl, ... }:
··· 85 url, 86 submodules, 87 rev, 88 + branch ? null, 89 name, 90 narHash, 91 }: 92 + pkgs.fetchgit ( 93 + { 94 + inherit url rev name; 95 + fetchSubmodules = submodules; 96 + hash = narHash; 97 + } 98 + // ( 99 + if branch == null then 100 + { } 101 + else 102 + { 103 + ref = "refs/heads/${branch}"; 104 + } 105 + ) 106 + ); 107 }; 108 109 # Dispatch to the correct code path based on the type ··· 135 repository, 136 revision, 137 url ? null, 138 + branch ? null, 139 submodules, 140 hash, 141 ... ··· 171 "${if matched == null then "source" else builtins.head matched}${appendShort}"; 172 name = urlToName url revision; 173 in 174 + fetchGit ( 175 + { 176 + rev = revision; 177 + narHash = hash; 178 179 + inherit name submodules url; 180 + } 181 + // ( 182 + if branch == null then 183 + { } 184 + else 185 + { 186 + ref = "refs/heads/${branch}"; 187 + } 188 + ) 189 + ); 190 191 mkPyPiSource = 192 { fetchurl, ... }:
+4 -4
packetmix/npins/sources.json
··· 22 "submodules": false, 23 "revision": "12fb5f6d1a4bcfd1741b02fd60ec3c9ff6ec5faa", 24 "url": null, 25 - "hash": "sha256-vaSNVdiU9tLA5DujSFKAvY4fUiHVGEMvBzuswyPG22k=" 26 }, 27 "AutoCreateCategoryPages": { 28 "type": "GitRelease", ··· 520 }, 521 "branch": "master", 522 "submodules": false, 523 - "revision": "f4e3698681704e74196fa0f905c7dfdd43cf5c86", 524 - "url": "https://github.com/andir/npins/archive/f4e3698681704e74196fa0f905c7dfdd43cf5c86.tar.gz", 525 - "hash": "sha256-8lkiistkBemkRN4aTqGW3SvI1CqibOnvFvNJS9OOdnU=" 526 }, 527 "scriptfs": { 528 "type": "Git",
··· 22 "submodules": false, 23 "revision": "12fb5f6d1a4bcfd1741b02fd60ec3c9ff6ec5faa", 24 "url": null, 25 + "hash": "sha256-yks79QtWndY2+ESKFcO2EPlj886TDLV+DldK+GpiMXI=" 26 }, 27 "AutoCreateCategoryPages": { 28 "type": "GitRelease", ··· 520 }, 521 "branch": "master", 522 "submodules": false, 523 + "revision": "0d6aaa4b3dcd1d8badbed2b66e0c50867330a86e", 524 + "url": "https://github.com/andir/npins/archive/0d6aaa4b3dcd1d8badbed2b66e0c50867330a86e.tar.gz", 525 + "hash": "sha256-9N14/tliOiA49Us2uFUWHcrhYN8AmJjR+bnwzcxejgs=" 526 }, 527 "scriptfs": { 528 "type": "Git",