Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions lib/modules/manager/nix/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,4 +602,45 @@ describe('modules/manager/nix/extract', () => {
],
});
});

const flake12Lock = `{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be moved inside the test and use codeBlock template helper

"nodes": {
"subgroup-project": {
"locked": {
"lastModified": 1739792862,
"narHash": "sha256-n0MrSIZZknq2OqOYgNS0iMp2yVRekpBFGhrhsT7aXGg=",
"owner": "group%2Fsub-group",
"repo": "subgroup-project",
"rev": "24b560624f154c9e962d146217b2a964faaf2055",
"type": "gitlab"
},
"original": {
"owner": "group%2Fsub-group",
"repo": "subgroup-project",
"type": "gitlab"
}
},
"root": {
"inputs": {
"subgroup-project": "subgroup-project"
}
}
},
"root": "root",
"version": 7
}`;

it('uri decode gitlab subgroup', async () => {
fs.readLocalFile.mockResolvedValueOnce(flake12Lock);
expect(await extractPackageFile('', 'flake.nix')).toMatchObject({
deps: [
{
currentDigest: '24b560624f154c9e962d146217b2a964faaf2055',
datasource: 'git-refs',
depName: 'subgroup-project',
packageName: 'https://gitlab.com/group/sub-group/subgroup-project',
},
],
});
});
});
2 changes: 1 addition & 1 deletion lib/modules/manager/nix/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export async function extractPackageFile(
currentValue: flakeOriginal.ref,
currentDigest: flakeLocked.rev,
datasource: GitRefsDatasource.id,
packageName: `https://${flakeOriginal.host ?? 'gitlab.com'}/${flakeOriginal.owner}/${flakeOriginal.repo}`,
packageName: `https://${flakeOriginal.host ?? 'gitlab.com'}/${decodeURIComponent(flakeOriginal.owner!)}/${flakeOriginal.repo}`,
});
break;
case 'git':
Expand Down