Skip to content

Commit 7aa1e47

Browse files
authoredMar 17, 2025··
fix(nix): urldecode gitlab subgroups (#34863)
1 parent 1e8f437 commit 7aa1e47

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed
 

‎lib/modules/manager/nix/extract.spec.ts

+41
Original file line numberDiff line numberDiff line change
@@ -602,4 +602,45 @@ describe('modules/manager/nix/extract', () => {
602602
],
603603
});
604604
});
605+
606+
const flake12Lock = `{
607+
"nodes": {
608+
"subgroup-project": {
609+
"locked": {
610+
"lastModified": 1739792862,
611+
"narHash": "sha256-n0MrSIZZknq2OqOYgNS0iMp2yVRekpBFGhrhsT7aXGg=",
612+
"owner": "group%2Fsub-group",
613+
"repo": "subgroup-project",
614+
"rev": "24b560624f154c9e962d146217b2a964faaf2055",
615+
"type": "gitlab"
616+
},
617+
"original": {
618+
"owner": "group%2Fsub-group",
619+
"repo": "subgroup-project",
620+
"type": "gitlab"
621+
}
622+
},
623+
"root": {
624+
"inputs": {
625+
"subgroup-project": "subgroup-project"
626+
}
627+
}
628+
},
629+
"root": "root",
630+
"version": 7
631+
}`;
632+
633+
it('uri decode gitlab subgroup', async () => {
634+
fs.readLocalFile.mockResolvedValueOnce(flake12Lock);
635+
expect(await extractPackageFile('', 'flake.nix')).toMatchObject({
636+
deps: [
637+
{
638+
currentDigest: '24b560624f154c9e962d146217b2a964faaf2055',
639+
datasource: 'git-refs',
640+
depName: 'subgroup-project',
641+
packageName: 'https://gitlab.com/group/sub-group/subgroup-project',
642+
},
643+
],
644+
});
645+
});
605646
});

‎lib/modules/manager/nix/extract.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export async function extractPackageFile(
105105
currentValue: flakeOriginal.ref,
106106
currentDigest: flakeLocked.rev,
107107
datasource: GitRefsDatasource.id,
108-
packageName: `https://${flakeOriginal.host ?? 'gitlab.com'}/${flakeOriginal.owner}/${flakeOriginal.repo}`,
108+
packageName: `https://${flakeOriginal.host ?? 'gitlab.com'}/${decodeURIComponent(flakeOriginal.owner!)}/${flakeOriginal.repo}`,
109109
});
110110
break;
111111
case 'git':

0 commit comments

Comments
 (0)
Please sign in to comment.