diff --git a/docs/usage/examples/opentelemetry.md b/docs/usage/examples/opentelemetry.md index 0429e319cf3..7c221f692d1 100644 --- a/docs/usage/examples/opentelemetry.md +++ b/docs/usage/examples/opentelemetry.md @@ -22,7 +22,7 @@ services: # Prometheus for storing metrics prometheus: - image: prom/prometheus:v3.2.1 + image: prom/prometheus:v3.3.0 ports: - '9090:9090' # Web UI - '4318' # OTLP HTTP diff --git a/lib/modules/manager/azure-pipelines/readme.md b/lib/modules/manager/azure-pipelines/readme.md index 049767b73e4..9157e6be39d 100644 --- a/lib/modules/manager/azure-pipelines/readme.md +++ b/lib/modules/manager/azure-pipelines/readme.md @@ -44,7 +44,7 @@ resources: - container: linux image: ubuntu:24.04 - container: python - image: python:3.13@sha256:aaf6d3c4576a462fb335f476bed251511f2f1e61ca8e8e97e9e197bc92a7a1ee + image: python:3.13@sha256:9819e5616923079cc16af4a93d4be92c0c487c6e02fd9027220381f3e125d64a stages: - stage: StageOne diff --git a/lib/modules/manager/devbox/artifacts.ts b/lib/modules/manager/devbox/artifacts.ts index bce51c80974..a3aec8a583b 100644 --- a/lib/modules/manager/devbox/artifacts.ts +++ b/lib/modules/manager/devbox/artifacts.ts @@ -26,6 +26,13 @@ export async function updateArtifacts({ const execOptions: ExecOptions = { cwdFile: packageFileName, toolConstraints: [ + // we are required to install nix because devbox spawns nix commands internally + // https://github.com/renovatebot/renovate/discussions/35382 + // https://github.com/jetify-com/devbox/issues/2585 + { + toolName: 'nix', + constraint: constraints?.nix, + }, { toolName: 'devbox', constraint: constraints?.devbox, diff --git a/lib/modules/manager/nix/extract.spec.ts b/lib/modules/manager/nix/extract.spec.ts index 67dd53c68d9..798a160d157 100644 --- a/lib/modules/manager/nix/extract.spec.ts +++ b/lib/modules/manager/nix/extract.spec.ts @@ -1,3 +1,4 @@ +import { codeBlock } from 'common-tags'; import { GitRefsDatasource } from '../../datasource/git-refs'; import { id as nixpkgsVersioning } from '../../versioning/nixpkgs'; import { extractPackageFile } from '.'; @@ -6,31 +7,30 @@ import { fs } from '~test/util'; vi.mock('../../../util/fs'); describe('modules/manager/nix/extract', () => { - const flake1Lock = `{ + const flake1Lock = codeBlock`{ "nodes": { "root": {} }, "root": "root", "version": 7 }`; - const flake1Nix = `{ - inputs = {}; - }`; it('returns null when no nixpkgs input exists', async () => { + const flakeNix = codeBlock`{ + inputs = {}; + }`; fs.readLocalFile.mockResolvedValueOnce(flake1Lock); - expect(await extractPackageFile(flake1Nix, 'flake.nix')).toBeNull(); + expect(await extractPackageFile(flakeNix, 'flake.nix')).toBeNull(); }); - const flake2Nix = `{ - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11"; - }; - }`; - it('match nixpkgs input', async () => { + const flakeNix = codeBlock`{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11"; + }; + }`; fs.readLocalFile.mockResolvedValueOnce(flake1Lock); - expect(await extractPackageFile(flake2Nix, 'flake.nix')).toEqual({ + expect(await extractPackageFile(flakeNix, 'flake.nix')).toEqual({ deps: [ { depName: 'nixpkgs', @@ -43,15 +43,14 @@ describe('modules/manager/nix/extract', () => { }); }); - const flake3Nix = `{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; - }; - }`; - it('match nixpkgs input case insensitive', async () => { + const flakeNix = codeBlock`{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; + }; + }`; fs.readLocalFile.mockResolvedValueOnce(flake1Lock); - expect(await extractPackageFile(flake3Nix, 'flake.nix')).toEqual({ + expect(await extractPackageFile(flakeNix, 'flake.nix')).toEqual({ deps: [ { depName: 'nixpkgs', @@ -64,15 +63,14 @@ describe('modules/manager/nix/extract', () => { }); }); - const flake4Nix = `{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - }; - }`; - it('includes nixpkgs input with no explicit ref', async () => { + const flakeNix = codeBlock`{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + }; + }`; fs.readLocalFile.mockResolvedValueOnce(flake1Lock); - expect(await extractPackageFile(flake4Nix, 'flake.nix')).toEqual({ + expect(await extractPackageFile(flakeNix, 'flake.nix')).toEqual({ deps: [ { currentValue: undefined, @@ -90,36 +88,35 @@ describe('modules/manager/nix/extract', () => { expect(await extractPackageFile('', 'flake.nix')).toBeNull(); }); - const flake2Lock = `{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1720031269, - "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + it('returns nixpkgs input', async () => { + const flakeLock = codeBlock`{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1720031269, + "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } } }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 - }`; - - it('returns nixpkgs input', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake2Lock); + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toEqual({ deps: [ { @@ -133,35 +130,34 @@ describe('modules/manager/nix/extract', () => { }); }); - const flake3Lock = `{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1728650607, - "narHash": "sha256-0lOnVTzRXzpk5uxbHLm3Ti3tyPAvirAIQDfwEUd8arg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "612ee628421ba2c1abca4c99684862f76cb3b089", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" + it('includes nixpkgs with no explicit ref', async () => { + const flakeLock = codeBlock`{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1728650607, + "narHash": "sha256-0lOnVTzRXzpk5uxbHLm3Ti3tyPAvirAIQDfwEUd8arg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "612ee628421ba2c1abca4c99684862f76cb3b089", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } } }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 - }`; - - it('includes nixpkgs with no explicit ref', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake3Lock); + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toMatchObject({ deps: [ { @@ -174,53 +170,52 @@ describe('modules/manager/nix/extract', () => { }); }); - const flake4Lock = `{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1672057183, - "narHash": "sha256-GN7/10DNNvs1FPj9tlZA2qgNdFuYKKuS3qlHTqAxasQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b139e44d78c36c69bcbb825b20dbfa51e7738347", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixpkgs-unstable", - "type": "indirect" - } - }, - "patchelf": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1718457448, - "narHash": "sha256-FSoxTcRZMGHNJh8dNtKOkcUtjhmhU6yQXcZZfUPLhQM=", - "ref": "refs/heads/master", - "rev": "a0f54334df36770b335c051e540ba40afcbf8378", - "revCount": 844, - "type": "git", - "url": "https://github.com/NixOS/patchelf.git" - }, - "original": { - "type": "git", - "url": "https://github.com/NixOS/patchelf.git" + it('includes patchelf from HEAD', async () => { + const flakeLock = codeBlock`{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1672057183, + "narHash": "sha256-GN7/10DNNvs1FPj9tlZA2qgNdFuYKKuS3qlHTqAxasQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b139e44d78c36c69bcbb825b20dbfa51e7738347", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixpkgs-unstable", + "type": "indirect" + } + }, + "patchelf": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1718457448, + "narHash": "sha256-FSoxTcRZMGHNJh8dNtKOkcUtjhmhU6yQXcZZfUPLhQM=", + "ref": "refs/heads/master", + "rev": "a0f54334df36770b335c051e540ba40afcbf8378", + "revCount": 844, + "type": "git", + "url": "https://github.com/NixOS/patchelf.git" + }, + "original": { + "type": "git", + "url": "https://github.com/NixOS/patchelf.git" + } + }, + "root": { + "inputs": { + "patchelf": "patchelf" + } } }, - "root": { - "inputs": { - "patchelf": "patchelf" - } - } - }, - "root": "root", - "version": 7 - }`; - - it('includes patchelf from HEAD', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake4Lock); + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toMatchObject({ deps: [ { @@ -233,36 +228,35 @@ describe('modules/manager/nix/extract', () => { }); }); - const flake5Lock = `{ - "nodes": { - "ijq": { - "flake": false, - "locked": { - "lastModified": 1723569650, - "narHash": "sha256-Ho/sAhEUeSug52JALgjrKVUPCBe8+PovbJj/lniKxp8=", - "owner": "~gpanders", - "repo": "ijq", - "rev": "88f0d9ae98942bf49cba302c42b2a0f6e05f9b58", - "type": "sourcehut" - }, - "original": { - "owner": "~gpanders", - "repo": "ijq", - "type": "sourcehut" + it('includes ijq from sourcehut without a flake', async () => { + const flakeLock = codeBlock`{ + "nodes": { + "ijq": { + "flake": false, + "locked": { + "lastModified": 1723569650, + "narHash": "sha256-Ho/sAhEUeSug52JALgjrKVUPCBe8+PovbJj/lniKxp8=", + "owner": "~gpanders", + "repo": "ijq", + "rev": "88f0d9ae98942bf49cba302c42b2a0f6e05f9b58", + "type": "sourcehut" + }, + "original": { + "owner": "~gpanders", + "repo": "ijq", + "type": "sourcehut" + } + }, + "root": { + "inputs": { + "ijq": "ijq" + } } }, - "root": { - "inputs": { - "ijq": "ijq" - } - } - }, - "root": "root", - "version": 7 - }`; - - it('includes ijq from sourcehut without a flake', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake5Lock); + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toMatchObject({ deps: [ { @@ -275,36 +269,35 @@ describe('modules/manager/nix/extract', () => { }); }); - const flake6Lock = `{ - "nodes": { - "home-manager": { - "flake": false, - "locked": { - "lastModified": 1728650932, - "narHash": "sha256-mGKzqdsRyLnGNl6WjEr7+sghGgBtYHhJQ4mjpgRTCsU=", - "owner": "rycee", - "repo": "home-manager", - "rev": "65ae9c147349829d3df0222151f53f79821c5134", - "type": "gitlab" - }, - "original": { - "owner": "rycee", - "repo": "home-manager", - "type": "gitlab" + it('includes home-manager from gitlab', async () => { + const flakeLock = codeBlock`{ + "nodes": { + "home-manager": { + "flake": false, + "locked": { + "lastModified": 1728650932, + "narHash": "sha256-mGKzqdsRyLnGNl6WjEr7+sghGgBtYHhJQ4mjpgRTCsU=", + "owner": "rycee", + "repo": "home-manager", + "rev": "65ae9c147349829d3df0222151f53f79821c5134", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "home-manager", + "type": "gitlab" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager" + } } }, - "root": { - "inputs": { - "home-manager": "home-manager" - } - } - }, - "root": "root", - "version": 7 - }`; - - it('includes home-manager from gitlab', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake6Lock); + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toMatchObject({ deps: [ { @@ -317,50 +310,48 @@ describe('modules/manager/nix/extract', () => { }); }); - const flake7Lock = `{ - "nodes": { - "root": {} - }, - "root": "root", - "version": 6 - }`; - it('test other version', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake7Lock); + const flakeLock = codeBlock`{ + "nodes": { + "root": {} + }, + "root": "root", + "version": 6 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toBeNull(); }); - const flake8Lock = `{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1728492678, - "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", - "ref": "nixos-unstable", - "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", - "shallow": true, - "type": "git", - "url": "https://github.com/NixOS/nixpkgs" - }, - "original": { - "ref": "nixos-unstable", - "shallow": true, - "type": "git", - "url": "https://github.com/NixOS/nixpkgs" + it('includes nixpkgs with ref and shallow arguments', async () => { + const flakeLock = codeBlock`{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1728492678, + "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", + "ref": "nixos-unstable", + "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", + "shallow": true, + "type": "git", + "url": "https://github.com/NixOS/nixpkgs" + }, + "original": { + "ref": "nixos-unstable", + "shallow": true, + "type": "git", + "url": "https://github.com/NixOS/nixpkgs" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } } }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 - }`; - - it('includes nixpkgs with ref and shallow arguments', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake8Lock); + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toMatchObject({ deps: [ { @@ -373,121 +364,148 @@ describe('modules/manager/nix/extract', () => { }); }); - const flake9Lock = `{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1728538411, - "narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" + it('includes nixpkgs but using indirect type that cannot be updated', async () => { + const flakeLock = codeBlock`{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1728538411, + "narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } } }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 - }`; - - it('includes nixpkgs but using indirect type that cannot be updated', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake9Lock); + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toBeNull(); }); - const flake10Lock = `{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1728492678, - "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-extra-pkgs": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - }, - "locked": { - "host": "github.corp.example.com", - "lastModified": 1728666512, - "narHash": "sha256-p+l16Zzyl2DXG695yks6KQP7NkjsnEksu5GBvtL1QYg=", - "owner": "my-org", - "repo": "nixpkgs-extra-pkgs", - "rev": "6bf2706348447df6f8b86b1c3e54f87b0afda84f", - "type": "github" - }, - "original": { - "host": "github.corp.example.com", - "owner": "my-org", - "repo": "nixpkgs-extra-pkgs", - "type": "github" + it('includes nixpkgs but using indirect type and path locked type that cannot be updated', async () => { + const flakeLock = codeBlock`{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1687274257, + "narHash": "sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF+/SUBNnAOE=", + "path": "/nix/store/22qgs3skscd9bmrxv9xv4q5d4wwm5ppx-source", + "rev": "2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } } }, - "root": { - "inputs": { - "nixpkgs-extra-pkgs": "nixpkgs-extra-pkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 - }`; + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); + expect(await extractPackageFile('', 'flake.nix')).toBeNull(); + }); it('includes flake from GitHub Enterprise', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake10Lock); + const flakeLock = codeBlock`{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1728492678, + "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-extra-pkgs": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "host": "github.corp.example.com", + "lastModified": 1728666512, + "narHash": "sha256-p+l16Zzyl2DXG695yks6KQP7NkjsnEksu5GBvtL1QYg=", + "owner": "my-org", + "repo": "nixpkgs-extra-pkgs", + "rev": "6bf2706348447df6f8b86b1c3e54f87b0afda84f", + "type": "github" + }, + "original": { + "host": "github.corp.example.com", + "owner": "my-org", + "repo": "nixpkgs-extra-pkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs-extra-pkgs": "nixpkgs-extra-pkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toMatchObject({ deps: [ { @@ -501,96 +519,95 @@ describe('modules/manager/nix/extract', () => { }); }); - const flake11Lock = `{ - "nodes": { - "data-mesher": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs", - "treefmt-nix": "treefmt-nix" - }, - "locked": { - "lastModified": 1727355895, - "narHash": "sha256-grZIaLgk5GgoDuTt49RTCLBh458H4YJdIAU4B3onXRw=", - "rev": "c7e39452affcc0f89e023091524e38b3aaf109e9", - "type": "tarball", - "url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/c7e39452affcc0f89e023091524e38b3aaf109e9.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://git.clan.lol/clan/data-mesher/archive/main.tar.gz" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "data-mesher", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1726153070, - "narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1726871744, - "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "data-mesher": "data-mesher" + it('includes flake with tarball type', async () => { + const flakeLock = codeBlock`{ + "nodes": { + "data-mesher": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1727355895, + "narHash": "sha256-grZIaLgk5GgoDuTt49RTCLBh458H4YJdIAU4B3onXRw=", + "rev": "c7e39452affcc0f89e023091524e38b3aaf109e9", + "type": "tarball", + "url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/c7e39452affcc0f89e023091524e38b3aaf109e9.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://git.clan.lol/clan/data-mesher/archive/main.tar.gz" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "data-mesher", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1726153070, + "narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1726871744, + "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "data-mesher": "data-mesher" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "data-mesher", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1726734507, + "narHash": "sha256-VUH5O5AcOSxb0uL/m34dDkxFKP6WLQ6y4I1B4+N3L2w=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "ee41a466c2255a3abe6bc50fc6be927cdee57a9f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "data-mesher", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1726734507, - "narHash": "sha256-VUH5O5AcOSxb0uL/m34dDkxFKP6WLQ6y4I1B4+N3L2w=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "ee41a466c2255a3abe6bc50fc6be927cdee57a9f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - } - }, - "root": "root", - "version": 7 - }`; - - it('includes flake with tarball type', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake11Lock); + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toMatchObject({ deps: [ { @@ -603,35 +620,34 @@ describe('modules/manager/nix/extract', () => { }); }); - const flake12Lock = `{ - "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" + it('uri decode gitlab subgroup', async () => { + const flakeLock = codeBlock`{ + "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": { - "inputs": { - "subgroup-project": "subgroup-project" - } - } - }, - "root": "root", - "version": 7 - }`; - - it('uri decode gitlab subgroup', async () => { - fs.readLocalFile.mockResolvedValueOnce(flake12Lock); + "root": "root", + "version": 7 + }`; + fs.readLocalFile.mockResolvedValueOnce(flakeLock); expect(await extractPackageFile('', 'flake.nix')).toMatchObject({ deps: [ { diff --git a/lib/modules/manager/nix/schema.ts b/lib/modules/manager/nix/schema.ts index af8e0e33e95..bf5e58ee903 100644 --- a/lib/modules/manager/nix/schema.ts +++ b/lib/modules/manager/nix/schema.ts @@ -6,6 +6,7 @@ const InputType = z.enum([ 'github', 'gitlab', 'indirect', + 'path', 'sourcehut', 'tarball', ]); diff --git a/lib/util/yaml.spec.ts b/lib/util/yaml.spec.ts index 30eb236473a..aa09241eb32 100644 --- a/lib/util/yaml.spec.ts +++ b/lib/util/yaml.spec.ts @@ -189,6 +189,33 @@ describe('util/yaml', () => { }, ]); }); + + it('should parse content with templates without quotes', () => { + expect( + parseYaml( + codeBlock` + myObject: + aString: {{ value }} + {{ prefixKey }}anotherString: value + --- + foo: {{ foo.bar }} + bar: value{{ value }}:v2 + `, + { removeTemplates: true }, + ), + ).toEqual([ + { + myObject: { + aString: null, + anotherString: 'value', + }, + }, + { + foo: null, + bar: 'value:v2', + }, + ]); + }); }); describe('load', () => { @@ -296,6 +323,33 @@ describe('util/yaml', () => { }); }); + it('should parse content with template without quotes', () => { + expect( + parseSingleYaml( + codeBlock` + myObject: + aString: {{value}} + {{prefixKey}}anotherString: value + {% if test.enabled %} + myNestedObject: + aNestedString: {{value}} + anotherNestedString: value{{value}}:v2 + {% endif %} + `, + { removeTemplates: true }, + ), + ).toEqual({ + myObject: { + aString: null, + anotherString: 'value', + myNestedObject: { + aNestedString: null, + anotherNestedString: 'value:v2', + }, + }, + }); + }); + it('should parse content with yaml tags', () => { expect( parseSingleYaml( diff --git a/lib/util/yaml.ts b/lib/util/yaml.ts index cd898fad46d..eacf4c9d156 100644 --- a/lib/util/yaml.ts +++ b/lib/util/yaml.ts @@ -9,7 +9,6 @@ import type { import { parseAllDocuments, parseDocument, stringify } from 'yaml'; import type { ZodType } from 'zod'; import { logger } from '../logger'; -import { regEx } from './regex'; import { stripTemplates } from './string'; export interface YamlOptions< @@ -77,7 +76,7 @@ export function parseYaml( if (errors?.length) { const error = new AggregateError(errors, 'Failed to parse YAML file'); if (options?.failureBehaviour === 'filter') { - logger.debug(`Failed to parse YAML file: ${error.message}`); + logger.debug(`Failed to parse YAML file`); continue; } throw error; @@ -168,7 +167,7 @@ export function dump(obj: any, opts?: DumpOptions): string { function massageContent(content: string, options?: YamlOptions): string { if (options?.removeTemplates) { - return stripTemplates(content.replace(regEx(/\s+{{.+?}}:.+/gs), '')); + return stripTemplates(content); } return content; diff --git a/lib/workers/repository/process/sort.spec.ts b/lib/workers/repository/process/sort.spec.ts index 186e1d46348..d3974ea0ec0 100644 --- a/lib/workers/repository/process/sort.spec.ts +++ b/lib/workers/repository/process/sort.spec.ts @@ -15,7 +15,15 @@ describe('workers/repository/process/sort', () => { }, { updateType: 'minor' as UpdateType, - prTitle: 'a minor update', + prTitle: 'a minor update 1.10', + }, + { + updateType: 'minor' as UpdateType, + prTitle: 'a minor update 1.2', + }, + { + updateType: 'minor' as UpdateType, + prTitle: 'a minor update 1.1', }, { updateType: 'pin' as UpdateType, @@ -31,7 +39,9 @@ describe('workers/repository/process/sort', () => { { prTitle: 'some other other pin', updateType: 'pin' }, { prTitle: 'some other pin', updateType: 'pin' }, { prTitle: 'some pin', updateType: 'pin' }, - { prTitle: 'a minor update', updateType: 'minor' }, + { prTitle: 'a minor update 1.1', updateType: 'minor' }, + { prTitle: 'a minor update 1.2', updateType: 'minor' }, + { prTitle: 'a minor update 1.10', updateType: 'minor' }, { prTitle: 'some major update', updateType: 'major' }, ]); }); diff --git a/lib/workers/repository/process/sort.ts b/lib/workers/repository/process/sort.ts index 48fe33abb95..f45678493e3 100644 --- a/lib/workers/repository/process/sort.ts +++ b/lib/workers/repository/process/sort.ts @@ -33,7 +33,7 @@ export function sortBranches(branches: Partial[]): void { } // TODO #22198 // Sort by prTitle if updateType is the same - return a.prTitle! < b.prTitle! ? -1 : 1; + return a.prTitle!.localeCompare(b.prTitle!, undefined, { numeric: true }); }); } diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 4448b3b7629..913b3b4944e 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -1,4 +1,4 @@ -# syntax=docker/dockerfile:1.14.0@sha256:4c68376a702446fc3c79af22de146a148bc3367e73c25a5803d453b6b3f722fb +# syntax=docker/dockerfile:1.15.0@sha256:05e0ad437efefcf144bfbf9d7f728c17818408e6d01432d9e264ef958bbd52f3 ARG BASE_IMAGE_TYPE=slim