renovate 39.77.0 → 39.78.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/config/presets/internal/group.js +2 -1
- package/dist/config/presets/internal/group.js.map +1 -1
- package/dist/config/types.d.ts +2 -0
- package/dist/config/types.js.map +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js +9 -1
- package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
- package/dist/modules/manager/npm/post-update/index.js +1 -1
- package/dist/modules/manager/npm/post-update/index.js.map +1 -1
- package/dist/modules/versioning/api.js +2 -0
- package/dist/modules/versioning/api.js.map +1 -1
- package/dist/modules/versioning/devbox/index.d.ts +7 -0
- package/dist/modules/versioning/devbox/index.js +65 -0
- package/dist/modules/versioning/devbox/index.js.map +1 -0
- package/dist/workers/global/config/parse/env.js +1 -1
- package/dist/workers/global/config/parse/env.js.map +1 -1
- package/dist/workers/repository/init/vulnerability.js +3 -3
- package/dist/workers/repository/init/vulnerability.js.map +1 -1
- package/dist/workers/repository/onboarding/branch/index.js +1 -1
- package/dist/workers/repository/onboarding/branch/index.js.map +1 -1
- package/dist/workers/repository/process/extract-update.js +1 -1
- package/dist/workers/repository/process/extract-update.js.map +1 -1
- package/package.json +7 -7
- package/renovate-schema.json +1 -0
@@ -313,9 +313,10 @@ const staticGroups = {
|
|
313
313
|
'k8s.io/cluster-bootstrap**',
|
314
314
|
'k8s.io/code-generator**',
|
315
315
|
'k8s.io/component-base**',
|
316
|
+
'k8s.io/component-helpers**',
|
316
317
|
'k8s.io/controller-manager**',
|
317
318
|
'k8s.io/cri-api**',
|
318
|
-
// 'k8s.io/csi-api', has
|
319
|
+
// 'k8s.io/csi-api', has no go.mod set up and does not follow the versioning of other repos
|
319
320
|
'k8s.io/csi-translation-lib**',
|
320
321
|
'k8s.io/kube-aggregator**',
|
321
322
|
'k8s.io/kube-controller-manager**',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../../lib/config/presets/internal/group.ts"],"names":[],"mappings":";;;;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;IACpC,MAAM,CAAC,IAAI,CAAC,GAAG;QACb,YAAY,EAAE;YACZ;gBACE,WAAW,EAAE,uBAAuB,QAAQ,qBAAqB;gBACjE,OAAO,EAAE,CAAC,YAAY,QAAQ,EAAE,CAAC;gBACjC,SAAS,EAAE,GAAG,QAAQ,WAAW;gBACjC,gBAAgB,EAAE,iBAAiB;aACpC;SACF;KACF,CAAC;AACJ,CAAC;AACD,MAAM,CAAC,SAAS,GAAG;IACjB,WAAW,EAAE,yCAAyC;IACtD,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,EAAE,EAAE,4CAA4C;CAC7D,CAAC;AAEW,QAAA,OAAO,GAA2B,MAAM,CAAC","sourcesContent":["import type { Preset } from '../types';\nimport * as monorepos from './monorepos';\n\nconst nonPinUpdateTypes = ['digest', 'patch', 'minor', 'major'];\n\n/* eslint sort-keys: [\"error\", \"asc\", {caseSensitive: false, natural: true}] */\n\nconst staticGroups = {\n all: {\n description: 'Group all updates together.',\n groupName: 'all dependencies',\n groupSlug: 'all',\n lockFileMaintenance: {\n enabled: false,\n },\n packageRules: [\n {\n groupName: 'all dependencies',\n groupSlug: 'all',\n matchPackageNames: ['*'],\n },\n ],\n\n separateMajorMinor: false,\n },\n allApollographql: {\n description: 'Group all packages published by Apollo GraphQL together.',\n packageRules: [\n {\n extends: ['packages:apollographql'],\n groupName: 'Apollo GraphQL packages',\n },\n ],\n },\n allDigest: {\n description: 'Group all `digest` updates together.',\n packageRules: [\n {\n groupName: 'all digest updates',\n groupSlug: 'all-digest',\n matchPackageNames: ['*'],\n matchUpdateTypes: ['digest'],\n },\n ],\n },\n allNonMajor: {\n description: 'Group all `minor` and `patch` updates together.',\n packageRules: [\n {\n groupName: 'all non-major dependencies',\n groupSlug: 'all-minor-patch',\n matchPackageNames: ['*'],\n matchUpdateTypes: ['minor', 'patch'],\n },\n ],\n },\n atlaskit: {\n description: 'Group all Atlassian `@atlaskit` packages together.',\n packageRules: [\n {\n extends: ['packages:atlaskit'],\n groupName: 'Atlassian Atlaskit packages',\n },\n ],\n },\n codemirror: {\n description: 'Group CodeMirror packages together.',\n packageRules: [\n {\n groupName: 'CodeMirror',\n matchPackageNames: ['@codemirror/**'],\n },\n ],\n },\n definitelyTyped: {\n description: 'Group all `@types` packages together.',\n packageRules: [\n {\n groupName: 'definitelyTyped',\n matchPackageNames: ['@types/**'],\n },\n ],\n },\n dotNetCore: {\n description: '.NET Core Docker containers.',\n packageRules: [\n {\n groupName: '.NET Core Docker containers',\n matchDatasources: ['docker'],\n matchPackageNames: ['mcr.microsoft.com/dotnet/**'],\n },\n ],\n },\n flyway: {\n description: 'Group Java Flyway packages.',\n packageRules: [\n {\n groupName: 'flyway',\n matchPackageNames: ['org.flywaydb:*', 'org.flywaydb.flyway:*'],\n },\n ],\n },\n fortawesome: {\n description: 'Group all packages by Font Awesome together.',\n packageRules: [\n {\n groupName: 'Font Awesome',\n matchPackageNames: ['@fortawesome/**'],\n },\n ],\n },\n fusionjs: {\n description: 'Group Fusion.js packages together.',\n packageRules: [\n {\n groupName: 'Fusion.js packages',\n matchPackageNames: [\n 'fusion-cli',\n 'fusion-core',\n 'fusion-test-utils',\n 'fusion-tokens',\n 'fusion-plugin-**',\n 'fusion-react**',\n 'fusion-apollo**',\n ],\n },\n ],\n },\n githubArtifactActions: {\n description:\n 'Group `download-artifact` and `upload-artifact` major updates together.',\n packageRules: [\n {\n groupName: 'GitHub Artifact Actions',\n matchManagers: ['github-actions'],\n matchPackageNames: [\n 'actions/download-artifact',\n 'actions/upload-artifact',\n ],\n matchUpdateTypes: ['major'],\n },\n ],\n },\n glimmer: {\n description: 'Group Glimmer.js packages together.',\n packageRules: [\n {\n groupName: 'Glimmer.js packages',\n groupSlug: 'glimmer',\n matchPackageNames: ['@glimmer/component', '@glimmer/tracking'],\n },\n ],\n },\n googleapis: {\n description: 'Group `googleapis` packages together.',\n packageRules: [\n {\n extends: ['packages:googleapis'],\n groupName: 'googleapis packages',\n },\n ],\n },\n goOpenapi: {\n description: 'Group `go-openapi` packages together.',\n packageRules: [\n {\n groupName: 'go-openapi packages',\n groupSlug: 'go-openapi',\n matchDatasources: ['go'],\n matchPackageNames: ['github.com/go-openapi/**'],\n },\n ],\n },\n hibernateCommons: {\n description: 'Group Java Hibernate Commons packages.',\n packageRules: [\n {\n groupName: 'hibernate commons',\n matchPackageNames: ['org.hibernate.common:**'],\n },\n ],\n },\n hibernateCore: {\n description: 'Group Java Hibernate Core packages.',\n packageRules: [\n {\n groupName: 'hibernate core',\n matchPackageNames: ['org.hibernate:**'],\n },\n ],\n },\n hibernateOgm: {\n description: 'Group Java Hibernate OGM packages.',\n packageRules: [\n {\n groupName: 'hibernate ogm',\n matchPackageNames: ['org.hibernate.ogm:**'],\n },\n ],\n },\n hibernateValidator: {\n description: 'Group Java Hibernate Validator packages.',\n packageRules: [\n {\n groupName: 'hibernate validator',\n matchPackageNames: ['org.hibernate.validator:**'],\n },\n ],\n },\n illuminate: {\n description: 'Group PHP Illuminate packages together.',\n packageRules: [\n {\n groupName: 'illuminate packages',\n groupSlug: 'illuminate',\n matchPackageNames: ['illuminate/**'],\n },\n ],\n },\n jekyllEcosystem: {\n description: 'Group Jekyll and related Ruby packages together.',\n packageRules: [\n {\n groupName: 'jekyll ecosystem packages',\n matchSourceUrls: [\n 'https://github.com/jekyll/**',\n 'https://github.com/github/pages-gem**',\n ],\n },\n ],\n },\n jestPlusTSJest: {\n description: 'Add `ts-jest` `major` update to Jest monorepo.',\n packageRules: [\n {\n groupName: 'jest monorepo',\n matchSourceUrls: ['https://github.com/kulshekhar/ts-jest'],\n matchUpdateTypes: ['major'],\n },\n ],\n },\n jestPlusTypes: {\n description: 'Add `@types/jest` update to Jest monorepo.',\n packageRules: [\n {\n groupName: 'jest monorepo',\n matchPackageNames: ['@types/jest'],\n matchUpdateTypes: nonPinUpdateTypes,\n },\n ],\n },\n jsTest: {\n description: 'Group JS test packages together.',\n packageRules: [\n {\n extends: ['packages:jsTest'],\n groupName: 'JS test packages',\n },\n ],\n },\n jsTestNonMajor: {\n description: 'Group non-major JS test package updates together.',\n packageRules: [\n {\n extends: ['packages:jsTest'],\n groupName: 'JS test packages',\n matchUpdateTypes: ['minor', 'patch'],\n },\n ],\n },\n jsUnitTest: {\n description: 'Group JavaScript unit test packages together.',\n packageRules: [\n {\n extends: ['packages:jsUnitTest'],\n groupName: 'JS unit test packages',\n },\n ],\n },\n jsUnitTestNonMajor: {\n description:\n 'Group JavaScipt unit test packages together for non-major updates.',\n packageRules: [\n {\n extends: ['packages:jsUnitTest'],\n groupName: 'JS unit test packages',\n matchUpdateTypes: ['minor', 'patch'],\n },\n ],\n },\n jwtFramework: {\n description: 'Group JWT Framework packages together.',\n packageRules: [\n {\n groupName: 'JWT Framework packages',\n matchDatasources: ['packagist'],\n matchPackageNames: ['web-token/**'],\n },\n ],\n },\n kubernetes: {\n description: 'Group Kubernetes packages together.',\n packageRules: [\n {\n groupName: 'kubernetes packages',\n groupSlug: 'kubernetes-go',\n matchDatasources: ['go'],\n matchPackageNames: [\n 'k8s.io/api**',\n 'k8s.io/apiextensions-apiserver**',\n 'k8s.io/apimachinery**',\n 'k8s.io/apiserver**',\n 'k8s.io/cli-runtime**',\n 'k8s.io/client-go**',\n 'k8s.io/cloud-provider**',\n 'k8s.io/cluster-bootstrap**',\n 'k8s.io/code-generator**',\n 'k8s.io/component-base**',\n 'k8s.io/controller-manager**',\n 'k8s.io/cri-api**',\n // 'k8s.io/csi-api', has not go.mod set up and does not follow the versioning of other repos\n 'k8s.io/csi-translation-lib**',\n 'k8s.io/kube-aggregator**',\n 'k8s.io/kube-controller-manager**',\n 'k8s.io/kube-proxy**',\n 'k8s.io/kube-scheduler**',\n 'k8s.io/kubectl**',\n 'k8s.io/kubelet**',\n 'k8s.io/legacy-cloud-providers**',\n 'k8s.io/metrics**',\n 'k8s.io/mount-utils**',\n 'k8s.io/pod-security-admission**',\n 'k8s.io/sample-apiserver**',\n 'k8s.io/sample-cli-plugin**',\n 'k8s.io/sample-controller**',\n ],\n },\n ],\n },\n linters: {\n description: 'Group various lint packages together.',\n packageRules: [\n {\n extends: ['packages:linters'],\n groupName: 'linters',\n },\n ],\n },\n micrometer: {\n description:\n \"Group Micrometer packages together, e.g. 'io.micrometer:micrometer-core'.\",\n packageRules: [\n {\n groupName: 'micrometer',\n matchPackageNames: ['io.micrometer:micrometer-**'],\n },\n ],\n },\n nodeJs: {\n description:\n \"Group anything that looks like Node.js together so that it's updated together.\",\n packageRules: [\n {\n commitMessageTopic: 'Node.js',\n matchDatasources: ['docker', 'node-version'],\n matchPackageNames: [\n '/(?:^|/)node$/', // node or ends with \"/node, except those below\"\n '!calico/node',\n '!docker.io/calico/node',\n '!kindest/node',\n ],\n },\n ],\n },\n phpstan: {\n description: 'Group PHPStan packages together.',\n packageRules: [\n {\n groupName: 'PHPStan packages',\n matchDatasources: ['packagist'],\n matchPackageNames: [\n 'phpstan/phpstan',\n '//phpstan-/',\n '//larastan/',\n 'phpstan/extension-installer',\n ],\n },\n ],\n },\n polymer: {\n description: 'Group all `@polymer` packages together.',\n packageRules: [\n {\n groupName: 'polymer packages',\n matchPackageNames: ['@polymer/**'],\n },\n ],\n },\n postcss: {\n description: 'Group PostCSS packages together.',\n packageRules: [\n {\n extends: ['packages:postcss'],\n groupName: 'postcss packages',\n },\n ],\n },\n pulumi: {\n description: 'Group Pulumi packages together.',\n packageRules: [\n {\n description: 'Group Pulumi Node.JS packages together.',\n groupName: 'Pulumi',\n groupSlug: 'pulumi-node',\n matchDatasources: ['npm'],\n matchPackageNames: ['@pulumi/**'],\n },\n {\n description: 'Group Pulumi Python packages together.',\n groupName: 'Pulumi',\n groupSlug: 'pulumi-python',\n matchDatasources: ['pypi'],\n matchPackageNames: ['pulumi-**'],\n },\n {\n description: 'Group Pulumi Go packages together.',\n groupName: 'Pulumi',\n groupSlug: 'pulumi-go',\n matchDatasources: ['go'],\n matchPackageNames: ['github.com/pulumi/**'],\n },\n {\n description: 'Group Pulumi Java packages together.',\n groupName: 'Pulumi',\n groupSlug: 'pulumi-java',\n matchDatasources: ['maven'],\n matchPackageNames: ['com.pulumi**'],\n },\n {\n description: 'Group Pulumi .NET packages together.',\n groupName: 'Pulumi',\n groupSlug: 'pulumi-dotnet',\n matchDatasources: ['nuget'],\n matchPackageNames: ['Pulumi**'],\n },\n ],\n },\n react: {\n description: 'Group React and corresponding `@types` packages together.',\n packageRules: [\n {\n groupName: 'react monorepo',\n matchPackageNames: ['@types/react', '@types/react-dom'],\n },\n ],\n },\n recommended: {\n description:\n 'Use curated list of recommended non-monorepo package groupings.',\n extends: [\n 'group:nodeJs',\n 'group:allApollographql',\n 'group:codemirror',\n 'group:flyway',\n 'group:fortawesome',\n 'group:fusionjs',\n 'group:githubArtifactActions',\n 'group:glimmer',\n 'group:goOpenapi',\n 'group:hibernateCore',\n 'group:hibernateValidator',\n 'group:hibernateOgm',\n 'group:hibernateCommons',\n 'group:illuminate',\n 'group:jekyllEcosystem',\n 'group:jestPlusTSJest',\n 'group:jestPlusTypes',\n 'group:jwtFramework',\n 'group:kubernetes',\n 'group:micrometer',\n 'group:phpstan',\n 'group:polymer',\n 'group:react',\n 'group:remark',\n 'group:resilience4j',\n 'group:rubyOnRails',\n 'group:rubyOmniauth',\n 'group:socketio',\n 'group:springAmqp',\n 'group:springAndroid',\n 'group:springBatch',\n 'group:springBoot',\n 'group:springCloud',\n 'group:springCore',\n 'group:springData',\n 'group:springHateoas',\n 'group:springIntegration',\n 'group:springKafka',\n 'group:springLdap',\n 'group:springMobile',\n 'group:springOsgi',\n 'group:springRestDocs',\n 'group:springRoo',\n 'group:springScala',\n 'group:springSecurity',\n 'group:springSession',\n 'group:springShell',\n 'group:springSocial',\n 'group:springStatemachine',\n 'group:springWebflow',\n 'group:springWs',\n 'group:symfony',\n ],\n ignoreDeps: [], // Hack to improve onboarding PR description\n },\n remark: {\n description: 'Group remark packages together.',\n packageRules: [\n {\n groupName: 'remark',\n matchDatasources: ['npm'],\n matchSourceUrls: ['https://github.com/remarkjs/**'],\n },\n ],\n },\n resilience4j: {\n description: 'Group Java Resilience4j packages.',\n packageRules: [\n {\n groupName: 'resilience4j',\n matchPackageNames: ['io.github.resilience4j:**'],\n },\n ],\n },\n rubyOmniauth: {\n description: 'Group OmniAuth packages together.',\n packageRules: [\n {\n groupName: 'omniauth packages',\n matchDatasources: ['rubygems'],\n matchPackageNames: ['omniauth**'],\n },\n ],\n },\n rubyOnRails: {\n description: 'Group Ruby on Rails packages together.',\n packageRules: [\n {\n groupName: 'Ruby on Rails packages',\n matchDatasources: ['rubygems'],\n matchPackageNames: [\n 'actioncable',\n 'actionmailbox',\n 'actionmailer',\n 'actionpack',\n 'actiontext',\n 'actionview',\n 'activejob',\n 'activemodel',\n 'activerecord',\n 'activestorage',\n 'activesupport',\n 'railties',\n 'rails',\n ],\n },\n ],\n },\n socketio: {\n description: 'Group socket.io packages.',\n packageRules: [\n {\n groupName: 'socket.io packages',\n matchPackageNames: ['socket.io**'],\n },\n ],\n },\n springAmqp: {\n description: 'Group Java Spring AMQP packages.',\n packageRules: [\n {\n groupName: 'spring amqp',\n matchPackageNames: ['org.springframework.amqp:**'],\n },\n ],\n },\n springAndroid: {\n description: 'Group Java Spring Android packages.',\n packageRules: [\n {\n groupName: 'spring android',\n matchPackageNames: ['org.springframework.android:**'],\n },\n ],\n },\n springBatch: {\n description: 'Group Java Spring Batch packages.',\n packageRules: [\n {\n groupName: 'spring batch',\n matchPackageNames: ['org.springframework.batch:**'],\n },\n ],\n },\n springBoot: {\n description: 'Group Java Spring Boot packages.',\n packageRules: [\n {\n groupName: 'spring boot',\n matchDepNames: ['org.springframework.boot'],\n },\n {\n groupName: 'spring boot',\n matchPackageNames: ['org.springframework.boot:**'],\n },\n ],\n },\n springCloud: {\n description: 'Group Java Spring Cloud packages.',\n packageRules: [\n {\n groupName: 'spring cloud',\n matchPackageNames: ['org.springframework.cloud:**'],\n },\n ],\n },\n springCore: {\n description: 'Group Java Spring Core packages.',\n packageRules: [\n {\n groupName: 'spring core',\n matchPackageNames: ['org.springframework:**'],\n },\n ],\n },\n springData: {\n description: 'Group Java Spring Data packages.',\n packageRules: [\n {\n groupName: 'spring data',\n matchPackageNames: ['org.springframework.data:**'],\n },\n ],\n },\n springHateoas: {\n description: 'Group Java Spring HATEOAS packages.',\n packageRules: [\n {\n groupName: 'spring hateoas',\n matchPackageNames: ['org.springframework.hateoas:**'],\n },\n ],\n },\n springIntegration: {\n description: 'Group Java Spring Integration packages.',\n packageRules: [\n {\n groupName: 'spring integration',\n matchPackageNames: ['org.springframework.integration:**'],\n },\n ],\n },\n springKafka: {\n description: 'Group Java Spring Kafka packages.',\n packageRules: [\n {\n groupName: 'spring kafka',\n matchPackageNames: ['org.springframework.kafka:**'],\n },\n ],\n },\n springLdap: {\n description: 'Group Java Spring LDAP packages.',\n packageRules: [\n {\n groupName: 'spring ldap',\n matchPackageNames: ['org.springframework.ldap:**'],\n },\n ],\n },\n springMobile: {\n description: 'Group Java Spring Mobile packages.',\n packageRules: [\n {\n groupName: 'spring mobile',\n matchPackageNames: ['org.springframework.mobile:**'],\n },\n ],\n },\n springOsgi: {\n description: 'Group Java Spring OSGi packages.',\n packageRules: [\n {\n groupName: 'spring osgi',\n matchPackageNames: ['org.springframework.osgi:**'],\n },\n ],\n },\n springRestDocs: {\n description: 'Group Java Spring REST Docs packages.',\n packageRules: [\n {\n groupName: 'spring restdocs',\n matchPackageNames: ['org.springframework.restdocs:**'],\n },\n ],\n },\n springRoo: {\n description: 'Group Java Spring Roo packages.',\n packageRules: [\n {\n groupName: 'spring roo',\n matchPackageNames: ['org.springframework.roo:**'],\n },\n ],\n },\n springScala: {\n description: 'Group Java Spring Scala packages.',\n packageRules: [\n {\n groupName: 'spring scala',\n matchPackageNames: ['org.springframework.scala:**'],\n },\n ],\n },\n springSecurity: {\n description: 'Group Java Spring Security packages.',\n packageRules: [\n {\n groupName: 'spring security',\n matchPackageNames: ['org.springframework.security:**'],\n },\n ],\n },\n springSession: {\n description: 'Group Java Spring Session packages.',\n packageRules: [\n {\n groupName: 'spring session',\n matchPackageNames: ['org.springframework.session:**'],\n },\n ],\n },\n springShell: {\n description: 'Group Java Spring Shell packages.',\n packageRules: [\n {\n groupName: 'spring shell',\n matchPackageNames: ['org.springframework.shell:**'],\n },\n ],\n },\n springSocial: {\n description: 'Group Java Spring Social packages.',\n packageRules: [\n {\n groupName: 'spring social',\n matchPackageNames: ['org.springframework.social:**'],\n },\n ],\n },\n springStatemachine: {\n description: 'Group Java Spring Statemachine packages.',\n packageRules: [\n {\n groupName: 'spring statemachine',\n matchPackageNames: ['org.springframework.statemachine:**'],\n },\n ],\n },\n springWebflow: {\n description: 'Group Java Spring WebFlow packages.',\n packageRules: [\n {\n groupName: 'spring webflow',\n matchPackageNames: ['org.springframework.webflow:**'],\n },\n ],\n },\n springWs: {\n description: 'Group Java Spring WS packages.',\n packageRules: [\n {\n groupName: 'spring ws',\n matchPackageNames: ['org.springframework.ws:**'],\n },\n ],\n },\n symfony: {\n description: 'Group PHP Symfony packages together.',\n packageRules: [\n {\n groupName: 'symfony packages',\n groupSlug: 'symfony',\n matchPackageNames: ['symfony/**'],\n },\n ],\n },\n test: {\n description: 'Group all test packages together.',\n packageRules: [\n {\n extends: ['packages:test'],\n groupName: 'test packages',\n },\n ],\n },\n testNonMajor: {\n description: 'Group all non-major test package updates together.',\n packageRules: [\n {\n extends: ['packages:test'],\n groupName: 'test packages',\n matchUpdateTypes: ['minor', 'patch'],\n },\n ],\n },\n unitTest: {\n description: 'Group all unit test packages together.',\n packageRules: [\n {\n extends: ['packages:unitTest'],\n groupName: 'unit test packages',\n },\n ],\n },\n unitTestNonMajor: {\n description: 'Group all unit test packages together for non-major updates.',\n packageRules: [\n {\n extends: ['packages:unitTest'],\n groupName: 'unit test packages',\n matchUpdateTypes: ['minor', 'patch'],\n },\n ],\n },\n vite: {\n description: 'Group all Vite related packages together.',\n packageRules: [\n {\n extends: ['packages:vite'],\n groupName: 'Vite packages',\n },\n ],\n },\n};\n\nconst config: any = { ...staticGroups };\n\nconst monorepoNames = [];\nfor (const monorepo of Object.keys(monorepos.presets)) {\n const name = `${monorepo}Monorepo`;\n monorepoNames.push(`group:${name}`);\n config[name] = {\n packageRules: [\n {\n description: `Group packages from ${monorepo} monorepo together.`,\n extends: [`monorepo:${monorepo}`],\n groupName: `${monorepo} monorepo`,\n matchUpdateTypes: nonPinUpdateTypes,\n },\n ],\n };\n}\nconfig.monorepos = {\n description: 'Group known monorepo packages together.',\n extends: monorepoNames,\n ignoreDeps: [], // Hack to improve onboarding PR description\n};\n\nexport const presets: Record<string, Preset> = config;\n"]}
|
1
|
+
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../../lib/config/presets/internal/group.ts"],"names":[],"mappings":";;;;AACA,+DAAyC;AAEzC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAEhE,+EAA+E;AAE/E,MAAM,YAAY,GAAG;IACnB,GAAG,EAAE;QACH,WAAW,EAAE,6BAA6B;QAC1C,SAAS,EAAE,kBAAkB;QAC7B,SAAS,EAAE,KAAK;QAChB,mBAAmB,EAAE;YACnB,OAAO,EAAE,KAAK;SACf;QACD,YAAY,EAAE;YACZ;gBACE,SAAS,EAAE,kBAAkB;gBAC7B,SAAS,EAAE,KAAK;gBAChB,iBAAiB,EAAE,CAAC,GAAG,CAAC;aACzB;SACF;QAED,kBAAkB,EAAE,KAAK;KAC1B;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,0DAA0D;QACvE,YAAY,EAAE;YACZ;gBACE,OAAO,EAAE,CAAC,wBAAwB,CAAC;gBACnC,SAAS,EAAE,yBAAyB;aACrC;SACF;KACF;IACD,SAAS,EAAE;QACT,WAAW,EAAE,sCAAsC;QACnD,YAAY,EAAE;YACZ;gBACE,SAAS,EAAE,oBAAoB;gBAC/B,SAAS,EAAE,YAAY;gBACvB,iBAAiB,EAAE,CAAC,GAAG,CAAC;gBACxB,gBAAgB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OAAO,CAAC;aACrC;SACF;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,2CAA2C;QACxD,YAAY,EAAE;YACZ;gBACE,OAAO,EAAE,CAAC,eAAe,CAAC;gBAC1B,SAAS,EAAE,eAAe;aAC3B;SACF;KACF;CACF,CAAC;AAEF,MAAM,MAAM,GAAQ,EAAE,GAAG,YAAY,EAAE,CAAC;AAExC,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IACtD,MAAM,IAAI,GAAG,GAAG,QAAQ,UAAU,CAAC;IACnC,aAAa,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IACpC,MAAM,CAAC,IAAI,CAAC,GAAG;QACb,YAAY,EAAE;YACZ;gBACE,WAAW,EAAE,uBAAuB,QAAQ,qBAAqB;gBACjE,OAAO,EAAE,CAAC,YAAY,QAAQ,EAAE,CAAC;gBACjC,SAAS,EAAE,GAAG,QAAQ,WAAW;gBACjC,gBAAgB,EAAE,iBAAiB;aACpC;SACF;KACF,CAAC;AACJ,CAAC;AACD,MAAM,CAAC,SAAS,GAAG;IACjB,WAAW,EAAE,yCAAyC;IACtD,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,EAAE,EAAE,4CAA4C;CAC7D,CAAC;AAEW,QAAA,OAAO,GAA2B,MAAM,CAAC","sourcesContent":["import type { Preset } from '../types';\nimport * as monorepos from './monorepos';\n\nconst nonPinUpdateTypes = ['digest', 'patch', 'minor', 'major'];\n\n/* eslint sort-keys: [\"error\", \"asc\", {caseSensitive: false, natural: true}] */\n\nconst staticGroups = {\n all: {\n description: 'Group all updates together.',\n groupName: 'all dependencies',\n groupSlug: 'all',\n lockFileMaintenance: {\n enabled: false,\n },\n packageRules: [\n {\n groupName: 'all dependencies',\n groupSlug: 'all',\n matchPackageNames: ['*'],\n },\n ],\n\n separateMajorMinor: false,\n },\n allApollographql: {\n description: 'Group all packages published by Apollo GraphQL together.',\n packageRules: [\n {\n extends: ['packages:apollographql'],\n groupName: 'Apollo GraphQL packages',\n },\n ],\n },\n allDigest: {\n description: 'Group all `digest` updates together.',\n packageRules: [\n {\n groupName: 'all digest updates',\n groupSlug: 'all-digest',\n matchPackageNames: ['*'],\n matchUpdateTypes: ['digest'],\n },\n ],\n },\n allNonMajor: {\n description: 'Group all `minor` and `patch` updates together.',\n packageRules: [\n {\n groupName: 'all non-major dependencies',\n groupSlug: 'all-minor-patch',\n matchPackageNames: ['*'],\n matchUpdateTypes: ['minor', 'patch'],\n },\n ],\n },\n atlaskit: {\n description: 'Group all Atlassian `@atlaskit` packages together.',\n packageRules: [\n {\n extends: ['packages:atlaskit'],\n groupName: 'Atlassian Atlaskit packages',\n },\n ],\n },\n codemirror: {\n description: 'Group CodeMirror packages together.',\n packageRules: [\n {\n groupName: 'CodeMirror',\n matchPackageNames: ['@codemirror/**'],\n },\n ],\n },\n definitelyTyped: {\n description: 'Group all `@types` packages together.',\n packageRules: [\n {\n groupName: 'definitelyTyped',\n matchPackageNames: ['@types/**'],\n },\n ],\n },\n dotNetCore: {\n description: '.NET Core Docker containers.',\n packageRules: [\n {\n groupName: '.NET Core Docker containers',\n matchDatasources: ['docker'],\n matchPackageNames: ['mcr.microsoft.com/dotnet/**'],\n },\n ],\n },\n flyway: {\n description: 'Group Java Flyway packages.',\n packageRules: [\n {\n groupName: 'flyway',\n matchPackageNames: ['org.flywaydb:*', 'org.flywaydb.flyway:*'],\n },\n ],\n },\n fortawesome: {\n description: 'Group all packages by Font Awesome together.',\n packageRules: [\n {\n groupName: 'Font Awesome',\n matchPackageNames: ['@fortawesome/**'],\n },\n ],\n },\n fusionjs: {\n description: 'Group Fusion.js packages together.',\n packageRules: [\n {\n groupName: 'Fusion.js packages',\n matchPackageNames: [\n 'fusion-cli',\n 'fusion-core',\n 'fusion-test-utils',\n 'fusion-tokens',\n 'fusion-plugin-**',\n 'fusion-react**',\n 'fusion-apollo**',\n ],\n },\n ],\n },\n githubArtifactActions: {\n description:\n 'Group `download-artifact` and `upload-artifact` major updates together.',\n packageRules: [\n {\n groupName: 'GitHub Artifact Actions',\n matchManagers: ['github-actions'],\n matchPackageNames: [\n 'actions/download-artifact',\n 'actions/upload-artifact',\n ],\n matchUpdateTypes: ['major'],\n },\n ],\n },\n glimmer: {\n description: 'Group Glimmer.js packages together.',\n packageRules: [\n {\n groupName: 'Glimmer.js packages',\n groupSlug: 'glimmer',\n matchPackageNames: ['@glimmer/component', '@glimmer/tracking'],\n },\n ],\n },\n googleapis: {\n description: 'Group `googleapis` packages together.',\n packageRules: [\n {\n extends: ['packages:googleapis'],\n groupName: 'googleapis packages',\n },\n ],\n },\n goOpenapi: {\n description: 'Group `go-openapi` packages together.',\n packageRules: [\n {\n groupName: 'go-openapi packages',\n groupSlug: 'go-openapi',\n matchDatasources: ['go'],\n matchPackageNames: ['github.com/go-openapi/**'],\n },\n ],\n },\n hibernateCommons: {\n description: 'Group Java Hibernate Commons packages.',\n packageRules: [\n {\n groupName: 'hibernate commons',\n matchPackageNames: ['org.hibernate.common:**'],\n },\n ],\n },\n hibernateCore: {\n description: 'Group Java Hibernate Core packages.',\n packageRules: [\n {\n groupName: 'hibernate core',\n matchPackageNames: ['org.hibernate:**'],\n },\n ],\n },\n hibernateOgm: {\n description: 'Group Java Hibernate OGM packages.',\n packageRules: [\n {\n groupName: 'hibernate ogm',\n matchPackageNames: ['org.hibernate.ogm:**'],\n },\n ],\n },\n hibernateValidator: {\n description: 'Group Java Hibernate Validator packages.',\n packageRules: [\n {\n groupName: 'hibernate validator',\n matchPackageNames: ['org.hibernate.validator:**'],\n },\n ],\n },\n illuminate: {\n description: 'Group PHP Illuminate packages together.',\n packageRules: [\n {\n groupName: 'illuminate packages',\n groupSlug: 'illuminate',\n matchPackageNames: ['illuminate/**'],\n },\n ],\n },\n jekyllEcosystem: {\n description: 'Group Jekyll and related Ruby packages together.',\n packageRules: [\n {\n groupName: 'jekyll ecosystem packages',\n matchSourceUrls: [\n 'https://github.com/jekyll/**',\n 'https://github.com/github/pages-gem**',\n ],\n },\n ],\n },\n jestPlusTSJest: {\n description: 'Add `ts-jest` `major` update to Jest monorepo.',\n packageRules: [\n {\n groupName: 'jest monorepo',\n matchSourceUrls: ['https://github.com/kulshekhar/ts-jest'],\n matchUpdateTypes: ['major'],\n },\n ],\n },\n jestPlusTypes: {\n description: 'Add `@types/jest` update to Jest monorepo.',\n packageRules: [\n {\n groupName: 'jest monorepo',\n matchPackageNames: ['@types/jest'],\n matchUpdateTypes: nonPinUpdateTypes,\n },\n ],\n },\n jsTest: {\n description: 'Group JS test packages together.',\n packageRules: [\n {\n extends: ['packages:jsTest'],\n groupName: 'JS test packages',\n },\n ],\n },\n jsTestNonMajor: {\n description: 'Group non-major JS test package updates together.',\n packageRules: [\n {\n extends: ['packages:jsTest'],\n groupName: 'JS test packages',\n matchUpdateTypes: ['minor', 'patch'],\n },\n ],\n },\n jsUnitTest: {\n description: 'Group JavaScript unit test packages together.',\n packageRules: [\n {\n extends: ['packages:jsUnitTest'],\n groupName: 'JS unit test packages',\n },\n ],\n },\n jsUnitTestNonMajor: {\n description:\n 'Group JavaScipt unit test packages together for non-major updates.',\n packageRules: [\n {\n extends: ['packages:jsUnitTest'],\n groupName: 'JS unit test packages',\n matchUpdateTypes: ['minor', 'patch'],\n },\n ],\n },\n jwtFramework: {\n description: 'Group JWT Framework packages together.',\n packageRules: [\n {\n groupName: 'JWT Framework packages',\n matchDatasources: ['packagist'],\n matchPackageNames: ['web-token/**'],\n },\n ],\n },\n kubernetes: {\n description: 'Group Kubernetes packages together.',\n packageRules: [\n {\n groupName: 'kubernetes packages',\n groupSlug: 'kubernetes-go',\n matchDatasources: ['go'],\n matchPackageNames: [\n 'k8s.io/api**',\n 'k8s.io/apiextensions-apiserver**',\n 'k8s.io/apimachinery**',\n 'k8s.io/apiserver**',\n 'k8s.io/cli-runtime**',\n 'k8s.io/client-go**',\n 'k8s.io/cloud-provider**',\n 'k8s.io/cluster-bootstrap**',\n 'k8s.io/code-generator**',\n 'k8s.io/component-base**',\n 'k8s.io/component-helpers**',\n 'k8s.io/controller-manager**',\n 'k8s.io/cri-api**',\n // 'k8s.io/csi-api', has no go.mod set up and does not follow the versioning of other repos\n 'k8s.io/csi-translation-lib**',\n 'k8s.io/kube-aggregator**',\n 'k8s.io/kube-controller-manager**',\n 'k8s.io/kube-proxy**',\n 'k8s.io/kube-scheduler**',\n 'k8s.io/kubectl**',\n 'k8s.io/kubelet**',\n 'k8s.io/legacy-cloud-providers**',\n 'k8s.io/metrics**',\n 'k8s.io/mount-utils**',\n 'k8s.io/pod-security-admission**',\n 'k8s.io/sample-apiserver**',\n 'k8s.io/sample-cli-plugin**',\n 'k8s.io/sample-controller**',\n ],\n },\n ],\n },\n linters: {\n description: 'Group various lint packages together.',\n packageRules: [\n {\n extends: ['packages:linters'],\n groupName: 'linters',\n },\n ],\n },\n micrometer: {\n description:\n \"Group Micrometer packages together, e.g. 'io.micrometer:micrometer-core'.\",\n packageRules: [\n {\n groupName: 'micrometer',\n matchPackageNames: ['io.micrometer:micrometer-**'],\n },\n ],\n },\n nodeJs: {\n description:\n \"Group anything that looks like Node.js together so that it's updated together.\",\n packageRules: [\n {\n commitMessageTopic: 'Node.js',\n matchDatasources: ['docker', 'node-version'],\n matchPackageNames: [\n '/(?:^|/)node$/', // node or ends with \"/node, except those below\"\n '!calico/node',\n '!docker.io/calico/node',\n '!kindest/node',\n ],\n },\n ],\n },\n phpstan: {\n description: 'Group PHPStan packages together.',\n packageRules: [\n {\n groupName: 'PHPStan packages',\n matchDatasources: ['packagist'],\n matchPackageNames: [\n 'phpstan/phpstan',\n '//phpstan-/',\n '//larastan/',\n 'phpstan/extension-installer',\n ],\n },\n ],\n },\n polymer: {\n description: 'Group all `@polymer` packages together.',\n packageRules: [\n {\n groupName: 'polymer packages',\n matchPackageNames: ['@polymer/**'],\n },\n ],\n },\n postcss: {\n description: 'Group PostCSS packages together.',\n packageRules: [\n {\n extends: ['packages:postcss'],\n groupName: 'postcss packages',\n },\n ],\n },\n pulumi: {\n description: 'Group Pulumi packages together.',\n packageRules: [\n {\n description: 'Group Pulumi Node.JS packages together.',\n groupName: 'Pulumi',\n groupSlug: 'pulumi-node',\n matchDatasources: ['npm'],\n matchPackageNames: ['@pulumi/**'],\n },\n {\n description: 'Group Pulumi Python packages together.',\n groupName: 'Pulumi',\n groupSlug: 'pulumi-python',\n matchDatasources: ['pypi'],\n matchPackageNames: ['pulumi-**'],\n },\n {\n description: 'Group Pulumi Go packages together.',\n groupName: 'Pulumi',\n groupSlug: 'pulumi-go',\n matchDatasources: ['go'],\n matchPackageNames: ['github.com/pulumi/**'],\n },\n {\n description: 'Group Pulumi Java packages together.',\n groupName: 'Pulumi',\n groupSlug: 'pulumi-java',\n matchDatasources: ['maven'],\n matchPackageNames: ['com.pulumi**'],\n },\n {\n description: 'Group Pulumi .NET packages together.',\n groupName: 'Pulumi',\n groupSlug: 'pulumi-dotnet',\n matchDatasources: ['nuget'],\n matchPackageNames: ['Pulumi**'],\n },\n ],\n },\n react: {\n description: 'Group React and corresponding `@types` packages together.',\n packageRules: [\n {\n groupName: 'react monorepo',\n matchPackageNames: ['@types/react', '@types/react-dom'],\n },\n ],\n },\n recommended: {\n description:\n 'Use curated list of recommended non-monorepo package groupings.',\n extends: [\n 'group:nodeJs',\n 'group:allApollographql',\n 'group:codemirror',\n 'group:flyway',\n 'group:fortawesome',\n 'group:fusionjs',\n 'group:githubArtifactActions',\n 'group:glimmer',\n 'group:goOpenapi',\n 'group:hibernateCore',\n 'group:hibernateValidator',\n 'group:hibernateOgm',\n 'group:hibernateCommons',\n 'group:illuminate',\n 'group:jekyllEcosystem',\n 'group:jestPlusTSJest',\n 'group:jestPlusTypes',\n 'group:jwtFramework',\n 'group:kubernetes',\n 'group:micrometer',\n 'group:phpstan',\n 'group:polymer',\n 'group:react',\n 'group:remark',\n 'group:resilience4j',\n 'group:rubyOnRails',\n 'group:rubyOmniauth',\n 'group:socketio',\n 'group:springAmqp',\n 'group:springAndroid',\n 'group:springBatch',\n 'group:springBoot',\n 'group:springCloud',\n 'group:springCore',\n 'group:springData',\n 'group:springHateoas',\n 'group:springIntegration',\n 'group:springKafka',\n 'group:springLdap',\n 'group:springMobile',\n 'group:springOsgi',\n 'group:springRestDocs',\n 'group:springRoo',\n 'group:springScala',\n 'group:springSecurity',\n 'group:springSession',\n 'group:springShell',\n 'group:springSocial',\n 'group:springStatemachine',\n 'group:springWebflow',\n 'group:springWs',\n 'group:symfony',\n ],\n ignoreDeps: [], // Hack to improve onboarding PR description\n },\n remark: {\n description: 'Group remark packages together.',\n packageRules: [\n {\n groupName: 'remark',\n matchDatasources: ['npm'],\n matchSourceUrls: ['https://github.com/remarkjs/**'],\n },\n ],\n },\n resilience4j: {\n description: 'Group Java Resilience4j packages.',\n packageRules: [\n {\n groupName: 'resilience4j',\n matchPackageNames: ['io.github.resilience4j:**'],\n },\n ],\n },\n rubyOmniauth: {\n description: 'Group OmniAuth packages together.',\n packageRules: [\n {\n groupName: 'omniauth packages',\n matchDatasources: ['rubygems'],\n matchPackageNames: ['omniauth**'],\n },\n ],\n },\n rubyOnRails: {\n description: 'Group Ruby on Rails packages together.',\n packageRules: [\n {\n groupName: 'Ruby on Rails packages',\n matchDatasources: ['rubygems'],\n matchPackageNames: [\n 'actioncable',\n 'actionmailbox',\n 'actionmailer',\n 'actionpack',\n 'actiontext',\n 'actionview',\n 'activejob',\n 'activemodel',\n 'activerecord',\n 'activestorage',\n 'activesupport',\n 'railties',\n 'rails',\n ],\n },\n ],\n },\n socketio: {\n description: 'Group socket.io packages.',\n packageRules: [\n {\n groupName: 'socket.io packages',\n matchPackageNames: ['socket.io**'],\n },\n ],\n },\n springAmqp: {\n description: 'Group Java Spring AMQP packages.',\n packageRules: [\n {\n groupName: 'spring amqp',\n matchPackageNames: ['org.springframework.amqp:**'],\n },\n ],\n },\n springAndroid: {\n description: 'Group Java Spring Android packages.',\n packageRules: [\n {\n groupName: 'spring android',\n matchPackageNames: ['org.springframework.android:**'],\n },\n ],\n },\n springBatch: {\n description: 'Group Java Spring Batch packages.',\n packageRules: [\n {\n groupName: 'spring batch',\n matchPackageNames: ['org.springframework.batch:**'],\n },\n ],\n },\n springBoot: {\n description: 'Group Java Spring Boot packages.',\n packageRules: [\n {\n groupName: 'spring boot',\n matchDepNames: ['org.springframework.boot'],\n },\n {\n groupName: 'spring boot',\n matchPackageNames: ['org.springframework.boot:**'],\n },\n ],\n },\n springCloud: {\n description: 'Group Java Spring Cloud packages.',\n packageRules: [\n {\n groupName: 'spring cloud',\n matchPackageNames: ['org.springframework.cloud:**'],\n },\n ],\n },\n springCore: {\n description: 'Group Java Spring Core packages.',\n packageRules: [\n {\n groupName: 'spring core',\n matchPackageNames: ['org.springframework:**'],\n },\n ],\n },\n springData: {\n description: 'Group Java Spring Data packages.',\n packageRules: [\n {\n groupName: 'spring data',\n matchPackageNames: ['org.springframework.data:**'],\n },\n ],\n },\n springHateoas: {\n description: 'Group Java Spring HATEOAS packages.',\n packageRules: [\n {\n groupName: 'spring hateoas',\n matchPackageNames: ['org.springframework.hateoas:**'],\n },\n ],\n },\n springIntegration: {\n description: 'Group Java Spring Integration packages.',\n packageRules: [\n {\n groupName: 'spring integration',\n matchPackageNames: ['org.springframework.integration:**'],\n },\n ],\n },\n springKafka: {\n description: 'Group Java Spring Kafka packages.',\n packageRules: [\n {\n groupName: 'spring kafka',\n matchPackageNames: ['org.springframework.kafka:**'],\n },\n ],\n },\n springLdap: {\n description: 'Group Java Spring LDAP packages.',\n packageRules: [\n {\n groupName: 'spring ldap',\n matchPackageNames: ['org.springframework.ldap:**'],\n },\n ],\n },\n springMobile: {\n description: 'Group Java Spring Mobile packages.',\n packageRules: [\n {\n groupName: 'spring mobile',\n matchPackageNames: ['org.springframework.mobile:**'],\n },\n ],\n },\n springOsgi: {\n description: 'Group Java Spring OSGi packages.',\n packageRules: [\n {\n groupName: 'spring osgi',\n matchPackageNames: ['org.springframework.osgi:**'],\n },\n ],\n },\n springRestDocs: {\n description: 'Group Java Spring REST Docs packages.',\n packageRules: [\n {\n groupName: 'spring restdocs',\n matchPackageNames: ['org.springframework.restdocs:**'],\n },\n ],\n },\n springRoo: {\n description: 'Group Java Spring Roo packages.',\n packageRules: [\n {\n groupName: 'spring roo',\n matchPackageNames: ['org.springframework.roo:**'],\n },\n ],\n },\n springScala: {\n description: 'Group Java Spring Scala packages.',\n packageRules: [\n {\n groupName: 'spring scala',\n matchPackageNames: ['org.springframework.scala:**'],\n },\n ],\n },\n springSecurity: {\n description: 'Group Java Spring Security packages.',\n packageRules: [\n {\n groupName: 'spring security',\n matchPackageNames: ['org.springframework.security:**'],\n },\n ],\n },\n springSession: {\n description: 'Group Java Spring Session packages.',\n packageRules: [\n {\n groupName: 'spring session',\n matchPackageNames: ['org.springframework.session:**'],\n },\n ],\n },\n springShell: {\n description: 'Group Java Spring Shell packages.',\n packageRules: [\n {\n groupName: 'spring shell',\n matchPackageNames: ['org.springframework.shell:**'],\n },\n ],\n },\n springSocial: {\n description: 'Group Java Spring Social packages.',\n packageRules: [\n {\n groupName: 'spring social',\n matchPackageNames: ['org.springframework.social:**'],\n },\n ],\n },\n springStatemachine: {\n description: 'Group Java Spring Statemachine packages.',\n packageRules: [\n {\n groupName: 'spring statemachine',\n matchPackageNames: ['org.springframework.statemachine:**'],\n },\n ],\n },\n springWebflow: {\n description: 'Group Java Spring WebFlow packages.',\n packageRules: [\n {\n groupName: 'spring webflow',\n matchPackageNames: ['org.springframework.webflow:**'],\n },\n ],\n },\n springWs: {\n description: 'Group Java Spring WS packages.',\n packageRules: [\n {\n groupName: 'spring ws',\n matchPackageNames: ['org.springframework.ws:**'],\n },\n ],\n },\n symfony: {\n description: 'Group PHP Symfony packages together.',\n packageRules: [\n {\n groupName: 'symfony packages',\n groupSlug: 'symfony',\n matchPackageNames: ['symfony/**'],\n },\n ],\n },\n test: {\n description: 'Group all test packages together.',\n packageRules: [\n {\n extends: ['packages:test'],\n groupName: 'test packages',\n },\n ],\n },\n testNonMajor: {\n description: 'Group all non-major test package updates together.',\n packageRules: [\n {\n extends: ['packages:test'],\n groupName: 'test packages',\n matchUpdateTypes: ['minor', 'patch'],\n },\n ],\n },\n unitTest: {\n description: 'Group all unit test packages together.',\n packageRules: [\n {\n extends: ['packages:unitTest'],\n groupName: 'unit test packages',\n },\n ],\n },\n unitTestNonMajor: {\n description: 'Group all unit test packages together for non-major updates.',\n packageRules: [\n {\n extends: ['packages:unitTest'],\n groupName: 'unit test packages',\n matchUpdateTypes: ['minor', 'patch'],\n },\n ],\n },\n vite: {\n description: 'Group all Vite related packages together.',\n packageRules: [\n {\n extends: ['packages:vite'],\n groupName: 'Vite packages',\n },\n ],\n },\n};\n\nconst config: any = { ...staticGroups };\n\nconst monorepoNames = [];\nfor (const monorepo of Object.keys(monorepos.presets)) {\n const name = `${monorepo}Monorepo`;\n monorepoNames.push(`group:${name}`);\n config[name] = {\n packageRules: [\n {\n description: `Group packages from ${monorepo} monorepo together.`,\n extends: [`monorepo:${monorepo}`],\n groupName: `${monorepo} monorepo`,\n matchUpdateTypes: nonPinUpdateTypes,\n },\n ],\n };\n}\nconfig.monorepos = {\n description: 'Group known monorepo packages together.',\n extends: monorepoNames,\n ignoreDeps: [], // Hack to improve onboarding PR description\n};\n\nexport const presets: Record<string, Preset> = config;\n"]}
|
package/dist/config/types.d.ts
CHANGED
@@ -247,6 +247,8 @@ export interface RenovateConfig extends LegacyAdminConfig, RenovateSharedConfig,
|
|
247
247
|
statusCheckNames?: Record<StatusCheckKey, string | null>;
|
248
248
|
env?: UserEnv;
|
249
249
|
logLevelRemap?: LogLevelRemap[];
|
250
|
+
branchTopic?: string;
|
251
|
+
additionalBranchPrefix?: string;
|
250
252
|
}
|
251
253
|
declare const CustomDatasourceFormats: readonly ["json", "plain", "yaml", "html"];
|
252
254
|
export type CustomDatasourceFormats = (typeof CustomDatasourceFormats)[number];
|
package/dist/config/types.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../lib/config/types.ts"],"names":[],"mappings":";;;AAqNa,QAAA,yBAAyB,GAAG;IACvC,mBAAmB;IACnB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;CACP,CAAC;AA4FX,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC","sourcesContent":["import type { PlatformId } from '../constants';\nimport type { LogLevelRemap } from '../logger/types';\nimport type { CustomManager } from '../modules/manager/custom/types';\nimport type { RepoSortMethod, SortMethod } from '../modules/platform/types';\nimport type { HostRule, SkipReason } from '../types';\nimport type { StageName } from '../types/skip-reason';\nimport type { GitNoVerifyOption } from '../util/git/types';\nimport type { MergeConfidence } from '../util/merge-confidence/types';\n\nexport type RenovateConfigStage =\n | 'global'\n | 'inherit'\n | 'repository'\n | 'package'\n | 'branch'\n | 'pr';\n\nexport type RepositoryCacheConfig = 'disabled' | 'enabled' | 'reset';\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nexport type RepositoryCacheType = 'local' | string;\nexport type DryRunConfig = 'extract' | 'lookup' | 'full';\nexport type RequiredConfig = 'required' | 'optional' | 'ignored';\n\nexport interface GroupConfig extends Record<string, unknown> {\n branchName?: string;\n branchTopic?: string;\n}\n\nexport type RecreateWhen = 'auto' | 'never' | 'always';\nexport type PlatformCommitOptions = 'auto' | 'disabled' | 'enabled';\n// TODO: Proper typings\nexport interface RenovateSharedConfig {\n $schema?: string;\n addLabels?: string[];\n autoReplaceGlobalMatch?: boolean;\n automerge?: boolean;\n automergeSchedule?: string[];\n automergeStrategy?: MergeStrategy;\n branchName?: string;\n branchNameStrict?: boolean;\n branchPrefix?: string;\n branchPrefixOld?: string;\n commitMessage?: string;\n commitMessageAction?: string;\n commitMessageExtra?: string;\n commitMessageLowerCase?: 'auto' | 'never';\n commitMessagePrefix?: string;\n commitMessageTopic?: string;\n confidential?: boolean;\n changelogUrl?: string;\n dependencyDashboardApproval?: boolean;\n draftPR?: boolean;\n enabled?: boolean;\n enabledManagers?: string[];\n extends?: string[];\n fileMatch?: string[];\n force?: RenovateConfig;\n gitIgnoredAuthors?: string[];\n group?: GroupConfig;\n groupName?: string;\n groupSlug?: string;\n hashedBranchLength?: number;\n ignoreDeps?: string[];\n ignorePaths?: string[];\n ignoreTests?: boolean;\n includePaths?: string[];\n internalChecksAsSuccess?: boolean;\n keepUpdatedLabel?: string;\n labels?: string[];\n manager?: string;\n milestone?: number;\n npmrc?: string;\n npmrcMerge?: boolean;\n platformCommit?: PlatformCommitOptions;\n postUpgradeTasks?: PostUpgradeTasks;\n prBodyColumns?: string[];\n prBodyDefinitions?: Record<string, string>;\n prCreation?: 'immediate' | 'not-pending' | 'status-success' | 'approval';\n prPriority?: number;\n productLinks?: Record<string, string>;\n pruneBranchAfterAutomerge?: boolean;\n rebaseLabel?: string;\n rebaseWhen?: string;\n recreateClosed?: boolean;\n recreateWhen?: RecreateWhen;\n repository?: string;\n repositoryCache?: RepositoryCacheConfig;\n repositoryCacheType?: RepositoryCacheType;\n respectLatest?: boolean;\n schedule?: string[];\n semanticCommitScope?: string | null;\n semanticCommitType?: string;\n semanticCommits?: 'auto' | 'enabled' | 'disabled';\n stopUpdatingLabel?: string;\n suppressNotifications?: string[];\n timezone?: string;\n unicodeEmoji?: boolean;\n}\n\n// Config options used only within the global worker\n// The below should contain config options where stage=global\nexport interface GlobalOnlyConfig {\n autodiscover?: boolean;\n autodiscoverFilter?: string[] | string;\n autodiscoverNamespaces?: string[];\n autodiscoverProjects?: string[];\n autodiscoverTopics?: string[];\n baseDir?: string;\n cacheDir?: string;\n containerbaseDir?: string;\n detectHostRulesFromEnv?: boolean;\n dockerCliOptions?: string;\n endpoint?: string;\n forceCli?: boolean;\n gitNoVerify?: GitNoVerifyOption[];\n gitPrivateKey?: string;\n globalExtends?: string[];\n mergeConfidenceDatasources?: string[];\n mergeConfidenceEndpoint?: string;\n platform?: PlatformId;\n prCommitsPerRunLimit?: number;\n privateKeyPath?: string;\n privateKeyPathOld?: string;\n redisPrefix?: string;\n redisUrl?: string;\n repositories?: RenovateRepository[];\n useCloudMetadataServices?: boolean;\n deleteConfigFile?: boolean;\n}\n\n// Config options used within the repository worker, but not user configurable\n// The below should contain config options where globalOnly=true\nexport interface RepoGlobalConfig {\n allowCustomCrateRegistries?: boolean;\n allowPlugins?: boolean;\n allowPostUpgradeCommandTemplating?: boolean;\n allowScripts?: boolean;\n allowedEnv?: string[];\n allowedHeaders?: string[];\n allowedPostUpgradeCommands?: string[];\n binarySource?: 'docker' | 'global' | 'install' | 'hermit';\n cacheDir?: string;\n cacheHardTtlMinutes?: number;\n cacheTtlOverride?: Record<string, number>;\n containerbaseDir?: string;\n customEnvVariables?: Record<string, string>;\n dockerChildPrefix?: string;\n dockerCliOptions?: string;\n dockerSidecarImage?: string;\n dockerUser?: string;\n dryRun?: DryRunConfig;\n encryptedWarning?: string;\n endpoint?: string;\n executionTimeout?: number;\n exposeAllEnv?: boolean;\n gitTimeout?: number;\n githubTokenWarn?: boolean;\n includeMirrors?: boolean;\n localDir?: string;\n migratePresets?: Record<string, string>;\n platform?: PlatformId;\n presetCachePersistence?: boolean;\n privateKey?: string;\n privateKeyOld?: string;\n httpCacheTtlDays?: number;\n autodiscoverRepoSort?: RepoSortMethod;\n autodiscoverRepoOrder?: SortMethod;\n userAgent?: string;\n dockerMaxPages?: number;\n s3Endpoint?: string;\n s3PathStyle?: boolean;\n cachePrivatePackages?: boolean;\n}\n\nexport interface LegacyAdminConfig {\n localDir?: string;\n\n logContext?: string;\n\n onboarding?: boolean;\n onboardingBranch?: string;\n onboardingCommitMessage?: string;\n onboardingNoDeps?: 'auto' | 'enabled' | 'disabled';\n onboardingRebaseCheckbox?: boolean;\n onboardingPrTitle?: string;\n onboardingConfig?: RenovateSharedConfig;\n onboardingConfigFileName?: string;\n\n requireConfig?: RequiredConfig;\n}\n\nexport type ExecutionMode = 'branch' | 'update';\n\nexport interface PostUpgradeTasks {\n commands?: string[];\n fileFilters?: string[];\n executionMode: ExecutionMode;\n}\n\nexport type UpdateConfig<\n T extends RenovateSharedConfig = RenovateSharedConfig,\n> = Partial<Record<UpdateType, T | null>>;\n\nexport type RenovateRepository =\n | string\n | {\n repository: string;\n secrets?: Record<string, string>;\n };\n\nexport type UseBaseBranchConfigType = 'merge' | 'none';\nexport type ConstraintsFilter = 'strict' | 'none';\n\nexport const allowedStatusCheckStrings = [\n 'minimumReleaseAge',\n 'mergeConfidence',\n 'configValidation',\n 'artifactError',\n] as const;\nexport type StatusCheckKey = (typeof allowedStatusCheckStrings)[number];\nexport type UserEnv = Record<string, string>;\n\n// TODO: Proper typings\nexport interface RenovateConfig\n extends LegacyAdminConfig,\n RenovateSharedConfig,\n UpdateConfig<PackageRule>,\n AssigneesAndReviewersConfig,\n ConfigMigration,\n Record<string, unknown> {\n s3Endpoint?: string;\n s3PathStyle?: boolean;\n reportPath?: string;\n reportType?: 'logging' | 'file' | 's3' | null;\n depName?: string;\n baseBranches?: string[];\n commitBody?: string;\n useBaseBranchConfig?: UseBaseBranchConfigType;\n baseBranch?: string;\n defaultBranch?: string;\n branchList?: string[];\n cloneSubmodulesFilter?: string[];\n description?: string | string[];\n force?: RenovateConfig;\n errors?: ValidationMessage[];\n\n gitAuthor?: string;\n\n hostRules?: HostRule[];\n\n inheritConfig?: boolean;\n inheritConfigFileName?: string;\n inheritConfigRepoName?: string;\n inheritConfigStrict?: boolean;\n\n ignorePresets?: string[];\n forkProcessing?: 'auto' | 'enabled' | 'disabled';\n isFork?: boolean;\n\n fileList?: string[];\n configWarningReuseIssue?: boolean;\n dependencyDashboard?: boolean;\n dependencyDashboardAutoclose?: boolean;\n dependencyDashboardChecks?: Record<string, string>;\n dependencyDashboardIssue?: number;\n dependencyDashboardTitle?: string;\n dependencyDashboardHeader?: string;\n dependencyDashboardFooter?: string;\n dependencyDashboardLabels?: string[];\n dependencyDashboardOSVVulnerabilitySummary?: 'none' | 'all' | 'unresolved';\n packageFile?: string;\n packageRules?: PackageRule[];\n postUpdateOptions?: string[];\n prConcurrentLimit?: number;\n prHourlyLimit?: number;\n forkModeDisallowMaintainerEdits?: boolean;\n\n defaultRegistryUrls?: string[];\n registryUrls?: string[] | null;\n registryAliases?: Record<string, string>;\n\n repoIsOnboarded?: boolean;\n repoIsActivated?: boolean;\n\n updateInternalDeps?: boolean;\n updateType?: UpdateType;\n\n warnings?: ValidationMessage[];\n vulnerabilityAlerts?: RenovateSharedConfig;\n osvVulnerabilityAlerts?: boolean;\n vulnerabilitySeverity?: string;\n customManagers?: CustomManager[];\n customDatasources?: Record<string, CustomDatasourceConfig>;\n\n fetchChangeLogs?: FetchChangeLogsOptions;\n secrets?: Record<string, string>;\n\n constraints?: Record<string, string>;\n skipInstalls?: boolean | null;\n\n constraintsFiltering?: ConstraintsFilter;\n\n checkedBranches?: string[];\n customizeDashboard?: Record<string, string>;\n\n statusCheckNames?: Record<StatusCheckKey, string | null>;\n env?: UserEnv;\n logLevelRemap?: LogLevelRemap[];\n}\n\nconst CustomDatasourceFormats = ['json', 'plain', 'yaml', 'html'] as const;\nexport type CustomDatasourceFormats = (typeof CustomDatasourceFormats)[number];\n\nexport interface CustomDatasourceConfig {\n defaultRegistryUrlTemplate?: string;\n format?: CustomDatasourceFormats;\n transformTemplates?: string[];\n}\n\nexport interface AllConfig\n extends RenovateConfig,\n GlobalOnlyConfig,\n RepoGlobalConfig {}\n\nexport interface AssigneesAndReviewersConfig {\n assigneesFromCodeOwners?: boolean;\n expandCodeOwnersGroups?: boolean;\n assignees?: string[];\n assigneesSampleSize?: number;\n ignoreReviewers?: string[];\n reviewersFromCodeOwners?: boolean;\n reviewers?: string[];\n reviewersSampleSize?: number;\n additionalReviewers?: string[];\n filterUnavailableUsers?: boolean;\n}\n\nexport type UpdateType =\n | 'major'\n | 'minor'\n | 'patch'\n | 'pin'\n | 'digest'\n | 'pinDigest'\n | 'lockFileMaintenance'\n | 'lockfileUpdate'\n | 'rollback'\n | 'bump'\n | 'replacement';\n\nexport type FetchChangeLogsOptions = 'off' | 'branch' | 'pr';\n\nexport type MatchStringsStrategy = 'any' | 'recursive' | 'combination';\n\nexport type MergeStrategy =\n | 'auto'\n | 'fast-forward'\n | 'merge-commit'\n | 'rebase'\n | 'squash';\n\n// TODO: Proper typings\nexport interface PackageRule\n extends RenovateSharedConfig,\n UpdateConfig,\n Record<string, unknown> {\n description?: string | string[];\n isVulnerabilityAlert?: boolean;\n matchBaseBranches?: string[];\n matchCategories?: string[];\n matchConfidence?: MergeConfidence[];\n matchCurrentAge?: string;\n matchCurrentValue?: string;\n matchCurrentVersion?: string;\n matchDatasources?: string[];\n matchDepNames?: string[];\n matchDepTypes?: string[];\n matchFileNames?: string[];\n matchManagers?: string[];\n matchNewValue?: string;\n matchPackageNames?: string[];\n matchRepositories?: string[];\n matchSourceUrls?: string[];\n matchUpdateTypes?: UpdateType[];\n matchJsonata?: string[];\n registryUrls?: string[] | null;\n vulnerabilitySeverity?: string;\n vulnerabilityFixVersion?: string;\n}\n\nexport interface ValidationMessage {\n topic: string;\n message: string;\n}\n\nexport type AllowedParents =\n | 'customDatasources'\n | 'customManagers'\n | 'hostRules'\n | 'logLevelRemap'\n | 'packageRules'\n | 'postUpgradeTasks'\n | 'vulnerabilityAlerts';\nexport interface RenovateOptionBase {\n /**\n * If true, the option can only be configured by people with access to the Renovate instance.\n * Furthermore, the option should be documented in docs/usage/self-hosted-configuration.md.\n */\n globalOnly?: boolean;\n\n inheritConfigSupport?: boolean;\n\n allowedValues?: string[];\n\n allowString?: boolean;\n\n cli?: boolean;\n\n description: string;\n\n env?: false | string;\n\n /**\n * Do not validate object children\n */\n freeChoice?: boolean;\n\n mergeable?: boolean;\n\n autogenerated?: boolean;\n\n name: string;\n\n parents?: AllowedParents[];\n\n stage?: RenovateConfigStage;\n\n experimental?: boolean;\n\n experimentalDescription?: string;\n\n experimentalIssues?: number[];\n\n advancedUse?: boolean;\n\n /**\n * This is used to add depreciation message in the docs\n */\n deprecationMsg?: string;\n\n /**\n * For internal use only: add it to any config option that supports regex or glob matching\n */\n patternMatch?: boolean;\n\n /**\n * For internal use only: add it to any config option of type integer that supports negative integers\n */\n allowNegative?: boolean;\n}\n\nexport interface RenovateArrayOption<\n T extends string | number | Record<string, unknown> = Record<string, unknown>,\n> extends RenovateOptionBase {\n default?: T[] | null;\n mergeable?: boolean;\n type: 'array';\n subType?: 'string' | 'object' | 'number';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateStringArrayOption extends RenovateArrayOption<string> {\n format?: 'regex';\n subType: 'string';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateNumberArrayOption extends RenovateArrayOption<number> {\n subType: 'number';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateBooleanOption extends RenovateOptionBase {\n default?: boolean | null;\n type: 'boolean';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateIntegerOption extends RenovateOptionBase {\n default?: number | null;\n type: 'integer';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateStringOption extends RenovateOptionBase {\n default?: string | null;\n format?: 'regex';\n\n // Not used\n replaceLineReturns?: boolean;\n type: 'string';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateObjectOption extends RenovateOptionBase {\n default?: any;\n additionalProperties?: Record<string, unknown> | boolean;\n mergeable?: boolean;\n type: 'object';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport type RenovateOptions =\n | RenovateStringOption\n | RenovateNumberArrayOption\n | RenovateStringArrayOption\n | RenovateIntegerOption\n | RenovateBooleanOption\n | RenovateArrayOption\n | RenovateObjectOption;\n\nexport interface PackageRuleInputConfig extends Record<string, unknown> {\n versioning?: string;\n packageFile?: string;\n lockFiles?: string[];\n depType?: string;\n depTypes?: string[];\n depName?: string;\n packageName?: string | null;\n newValue?: string | null;\n currentValue?: string | null;\n currentVersion?: string;\n lockedVersion?: string;\n updateType?: UpdateType;\n mergeConfidenceLevel?: MergeConfidence | undefined;\n isBump?: boolean;\n sourceUrl?: string | null;\n categories?: string[];\n baseBranch?: string;\n manager?: string;\n datasource?: string;\n packageRules?: (PackageRule & PackageRuleInputConfig)[];\n releaseTimestamp?: string | null;\n repository?: string;\n currentVersionAgeInDays?: number;\n currentVersionTimestamp?: string;\n enabled?: boolean;\n skipReason?: SkipReason;\n skipStage?: StageName;\n}\n\nexport interface ConfigMigration {\n configMigration?: boolean;\n}\n\nexport interface MigratedConfig {\n isMigrated: boolean;\n migratedConfig: RenovateConfig;\n}\n\nexport interface MigratedRenovateConfig extends RenovateConfig {\n endpoints?: HostRule[];\n pathRules: PackageRule[];\n packages: PackageRule[];\n\n node?: RenovateConfig;\n travis?: RenovateConfig;\n gradle?: RenovateConfig;\n}\n\nexport interface ManagerConfig extends RenovateConfig {\n manager: string;\n}\n\nexport interface ValidationResult {\n errors: ValidationMessage[];\n warnings: ValidationMessage[];\n}\n"]}
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../lib/config/types.ts"],"names":[],"mappings":";;;AAqNa,QAAA,yBAAyB,GAAG;IACvC,mBAAmB;IACnB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;CACP,CAAC;AA+FX,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC","sourcesContent":["import type { PlatformId } from '../constants';\nimport type { LogLevelRemap } from '../logger/types';\nimport type { CustomManager } from '../modules/manager/custom/types';\nimport type { RepoSortMethod, SortMethod } from '../modules/platform/types';\nimport type { HostRule, SkipReason } from '../types';\nimport type { StageName } from '../types/skip-reason';\nimport type { GitNoVerifyOption } from '../util/git/types';\nimport type { MergeConfidence } from '../util/merge-confidence/types';\n\nexport type RenovateConfigStage =\n | 'global'\n | 'inherit'\n | 'repository'\n | 'package'\n | 'branch'\n | 'pr';\n\nexport type RepositoryCacheConfig = 'disabled' | 'enabled' | 'reset';\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nexport type RepositoryCacheType = 'local' | string;\nexport type DryRunConfig = 'extract' | 'lookup' | 'full';\nexport type RequiredConfig = 'required' | 'optional' | 'ignored';\n\nexport interface GroupConfig extends Record<string, unknown> {\n branchName?: string;\n branchTopic?: string;\n}\n\nexport type RecreateWhen = 'auto' | 'never' | 'always';\nexport type PlatformCommitOptions = 'auto' | 'disabled' | 'enabled';\n// TODO: Proper typings\nexport interface RenovateSharedConfig {\n $schema?: string;\n addLabels?: string[];\n autoReplaceGlobalMatch?: boolean;\n automerge?: boolean;\n automergeSchedule?: string[];\n automergeStrategy?: MergeStrategy;\n branchName?: string;\n branchNameStrict?: boolean;\n branchPrefix?: string;\n branchPrefixOld?: string;\n commitMessage?: string;\n commitMessageAction?: string;\n commitMessageExtra?: string;\n commitMessageLowerCase?: 'auto' | 'never';\n commitMessagePrefix?: string;\n commitMessageTopic?: string;\n confidential?: boolean;\n changelogUrl?: string;\n dependencyDashboardApproval?: boolean;\n draftPR?: boolean;\n enabled?: boolean;\n enabledManagers?: string[];\n extends?: string[];\n fileMatch?: string[];\n force?: RenovateConfig;\n gitIgnoredAuthors?: string[];\n group?: GroupConfig;\n groupName?: string;\n groupSlug?: string;\n hashedBranchLength?: number;\n ignoreDeps?: string[];\n ignorePaths?: string[];\n ignoreTests?: boolean;\n includePaths?: string[];\n internalChecksAsSuccess?: boolean;\n keepUpdatedLabel?: string;\n labels?: string[];\n manager?: string;\n milestone?: number;\n npmrc?: string;\n npmrcMerge?: boolean;\n platformCommit?: PlatformCommitOptions;\n postUpgradeTasks?: PostUpgradeTasks;\n prBodyColumns?: string[];\n prBodyDefinitions?: Record<string, string>;\n prCreation?: 'immediate' | 'not-pending' | 'status-success' | 'approval';\n prPriority?: number;\n productLinks?: Record<string, string>;\n pruneBranchAfterAutomerge?: boolean;\n rebaseLabel?: string;\n rebaseWhen?: string;\n recreateClosed?: boolean;\n recreateWhen?: RecreateWhen;\n repository?: string;\n repositoryCache?: RepositoryCacheConfig;\n repositoryCacheType?: RepositoryCacheType;\n respectLatest?: boolean;\n schedule?: string[];\n semanticCommitScope?: string | null;\n semanticCommitType?: string;\n semanticCommits?: 'auto' | 'enabled' | 'disabled';\n stopUpdatingLabel?: string;\n suppressNotifications?: string[];\n timezone?: string;\n unicodeEmoji?: boolean;\n}\n\n// Config options used only within the global worker\n// The below should contain config options where stage=global\nexport interface GlobalOnlyConfig {\n autodiscover?: boolean;\n autodiscoverFilter?: string[] | string;\n autodiscoverNamespaces?: string[];\n autodiscoverProjects?: string[];\n autodiscoverTopics?: string[];\n baseDir?: string;\n cacheDir?: string;\n containerbaseDir?: string;\n detectHostRulesFromEnv?: boolean;\n dockerCliOptions?: string;\n endpoint?: string;\n forceCli?: boolean;\n gitNoVerify?: GitNoVerifyOption[];\n gitPrivateKey?: string;\n globalExtends?: string[];\n mergeConfidenceDatasources?: string[];\n mergeConfidenceEndpoint?: string;\n platform?: PlatformId;\n prCommitsPerRunLimit?: number;\n privateKeyPath?: string;\n privateKeyPathOld?: string;\n redisPrefix?: string;\n redisUrl?: string;\n repositories?: RenovateRepository[];\n useCloudMetadataServices?: boolean;\n deleteConfigFile?: boolean;\n}\n\n// Config options used within the repository worker, but not user configurable\n// The below should contain config options where globalOnly=true\nexport interface RepoGlobalConfig {\n allowCustomCrateRegistries?: boolean;\n allowPlugins?: boolean;\n allowPostUpgradeCommandTemplating?: boolean;\n allowScripts?: boolean;\n allowedEnv?: string[];\n allowedHeaders?: string[];\n allowedPostUpgradeCommands?: string[];\n binarySource?: 'docker' | 'global' | 'install' | 'hermit';\n cacheDir?: string;\n cacheHardTtlMinutes?: number;\n cacheTtlOverride?: Record<string, number>;\n containerbaseDir?: string;\n customEnvVariables?: Record<string, string>;\n dockerChildPrefix?: string;\n dockerCliOptions?: string;\n dockerSidecarImage?: string;\n dockerUser?: string;\n dryRun?: DryRunConfig;\n encryptedWarning?: string;\n endpoint?: string;\n executionTimeout?: number;\n exposeAllEnv?: boolean;\n gitTimeout?: number;\n githubTokenWarn?: boolean;\n includeMirrors?: boolean;\n localDir?: string;\n migratePresets?: Record<string, string>;\n platform?: PlatformId;\n presetCachePersistence?: boolean;\n privateKey?: string;\n privateKeyOld?: string;\n httpCacheTtlDays?: number;\n autodiscoverRepoSort?: RepoSortMethod;\n autodiscoverRepoOrder?: SortMethod;\n userAgent?: string;\n dockerMaxPages?: number;\n s3Endpoint?: string;\n s3PathStyle?: boolean;\n cachePrivatePackages?: boolean;\n}\n\nexport interface LegacyAdminConfig {\n localDir?: string;\n\n logContext?: string;\n\n onboarding?: boolean;\n onboardingBranch?: string;\n onboardingCommitMessage?: string;\n onboardingNoDeps?: 'auto' | 'enabled' | 'disabled';\n onboardingRebaseCheckbox?: boolean;\n onboardingPrTitle?: string;\n onboardingConfig?: RenovateSharedConfig;\n onboardingConfigFileName?: string;\n\n requireConfig?: RequiredConfig;\n}\n\nexport type ExecutionMode = 'branch' | 'update';\n\nexport interface PostUpgradeTasks {\n commands?: string[];\n fileFilters?: string[];\n executionMode: ExecutionMode;\n}\n\nexport type UpdateConfig<\n T extends RenovateSharedConfig = RenovateSharedConfig,\n> = Partial<Record<UpdateType, T | null>>;\n\nexport type RenovateRepository =\n | string\n | {\n repository: string;\n secrets?: Record<string, string>;\n };\n\nexport type UseBaseBranchConfigType = 'merge' | 'none';\nexport type ConstraintsFilter = 'strict' | 'none';\n\nexport const allowedStatusCheckStrings = [\n 'minimumReleaseAge',\n 'mergeConfidence',\n 'configValidation',\n 'artifactError',\n] as const;\nexport type StatusCheckKey = (typeof allowedStatusCheckStrings)[number];\nexport type UserEnv = Record<string, string>;\n\n// TODO: Proper typings\nexport interface RenovateConfig\n extends LegacyAdminConfig,\n RenovateSharedConfig,\n UpdateConfig<PackageRule>,\n AssigneesAndReviewersConfig,\n ConfigMigration,\n Record<string, unknown> {\n s3Endpoint?: string;\n s3PathStyle?: boolean;\n reportPath?: string;\n reportType?: 'logging' | 'file' | 's3' | null;\n depName?: string;\n baseBranches?: string[];\n commitBody?: string;\n useBaseBranchConfig?: UseBaseBranchConfigType;\n baseBranch?: string;\n defaultBranch?: string;\n branchList?: string[];\n cloneSubmodulesFilter?: string[];\n description?: string | string[];\n force?: RenovateConfig;\n errors?: ValidationMessage[];\n\n gitAuthor?: string;\n\n hostRules?: HostRule[];\n\n inheritConfig?: boolean;\n inheritConfigFileName?: string;\n inheritConfigRepoName?: string;\n inheritConfigStrict?: boolean;\n\n ignorePresets?: string[];\n forkProcessing?: 'auto' | 'enabled' | 'disabled';\n isFork?: boolean;\n\n fileList?: string[];\n configWarningReuseIssue?: boolean;\n dependencyDashboard?: boolean;\n dependencyDashboardAutoclose?: boolean;\n dependencyDashboardChecks?: Record<string, string>;\n dependencyDashboardIssue?: number;\n dependencyDashboardTitle?: string;\n dependencyDashboardHeader?: string;\n dependencyDashboardFooter?: string;\n dependencyDashboardLabels?: string[];\n dependencyDashboardOSVVulnerabilitySummary?: 'none' | 'all' | 'unresolved';\n packageFile?: string;\n packageRules?: PackageRule[];\n postUpdateOptions?: string[];\n prConcurrentLimit?: number;\n prHourlyLimit?: number;\n forkModeDisallowMaintainerEdits?: boolean;\n\n defaultRegistryUrls?: string[];\n registryUrls?: string[] | null;\n registryAliases?: Record<string, string>;\n\n repoIsOnboarded?: boolean;\n repoIsActivated?: boolean;\n\n updateInternalDeps?: boolean;\n updateType?: UpdateType;\n\n warnings?: ValidationMessage[];\n vulnerabilityAlerts?: RenovateSharedConfig;\n osvVulnerabilityAlerts?: boolean;\n vulnerabilitySeverity?: string;\n customManagers?: CustomManager[];\n customDatasources?: Record<string, CustomDatasourceConfig>;\n\n fetchChangeLogs?: FetchChangeLogsOptions;\n secrets?: Record<string, string>;\n\n constraints?: Record<string, string>;\n skipInstalls?: boolean | null;\n\n constraintsFiltering?: ConstraintsFilter;\n\n checkedBranches?: string[];\n customizeDashboard?: Record<string, string>;\n\n statusCheckNames?: Record<StatusCheckKey, string | null>;\n env?: UserEnv;\n logLevelRemap?: LogLevelRemap[];\n\n branchTopic?: string;\n additionalBranchPrefix?: string;\n}\n\nconst CustomDatasourceFormats = ['json', 'plain', 'yaml', 'html'] as const;\nexport type CustomDatasourceFormats = (typeof CustomDatasourceFormats)[number];\n\nexport interface CustomDatasourceConfig {\n defaultRegistryUrlTemplate?: string;\n format?: CustomDatasourceFormats;\n transformTemplates?: string[];\n}\n\nexport interface AllConfig\n extends RenovateConfig,\n GlobalOnlyConfig,\n RepoGlobalConfig {}\n\nexport interface AssigneesAndReviewersConfig {\n assigneesFromCodeOwners?: boolean;\n expandCodeOwnersGroups?: boolean;\n assignees?: string[];\n assigneesSampleSize?: number;\n ignoreReviewers?: string[];\n reviewersFromCodeOwners?: boolean;\n reviewers?: string[];\n reviewersSampleSize?: number;\n additionalReviewers?: string[];\n filterUnavailableUsers?: boolean;\n}\n\nexport type UpdateType =\n | 'major'\n | 'minor'\n | 'patch'\n | 'pin'\n | 'digest'\n | 'pinDigest'\n | 'lockFileMaintenance'\n | 'lockfileUpdate'\n | 'rollback'\n | 'bump'\n | 'replacement';\n\nexport type FetchChangeLogsOptions = 'off' | 'branch' | 'pr';\n\nexport type MatchStringsStrategy = 'any' | 'recursive' | 'combination';\n\nexport type MergeStrategy =\n | 'auto'\n | 'fast-forward'\n | 'merge-commit'\n | 'rebase'\n | 'squash';\n\n// TODO: Proper typings\nexport interface PackageRule\n extends RenovateSharedConfig,\n UpdateConfig,\n Record<string, unknown> {\n description?: string | string[];\n isVulnerabilityAlert?: boolean;\n matchBaseBranches?: string[];\n matchCategories?: string[];\n matchConfidence?: MergeConfidence[];\n matchCurrentAge?: string;\n matchCurrentValue?: string;\n matchCurrentVersion?: string;\n matchDatasources?: string[];\n matchDepNames?: string[];\n matchDepTypes?: string[];\n matchFileNames?: string[];\n matchManagers?: string[];\n matchNewValue?: string;\n matchPackageNames?: string[];\n matchRepositories?: string[];\n matchSourceUrls?: string[];\n matchUpdateTypes?: UpdateType[];\n matchJsonata?: string[];\n registryUrls?: string[] | null;\n vulnerabilitySeverity?: string;\n vulnerabilityFixVersion?: string;\n}\n\nexport interface ValidationMessage {\n topic: string;\n message: string;\n}\n\nexport type AllowedParents =\n | 'customDatasources'\n | 'customManagers'\n | 'hostRules'\n | 'logLevelRemap'\n | 'packageRules'\n | 'postUpgradeTasks'\n | 'vulnerabilityAlerts';\nexport interface RenovateOptionBase {\n /**\n * If true, the option can only be configured by people with access to the Renovate instance.\n * Furthermore, the option should be documented in docs/usage/self-hosted-configuration.md.\n */\n globalOnly?: boolean;\n\n inheritConfigSupport?: boolean;\n\n allowedValues?: string[];\n\n allowString?: boolean;\n\n cli?: boolean;\n\n description: string;\n\n env?: false | string;\n\n /**\n * Do not validate object children\n */\n freeChoice?: boolean;\n\n mergeable?: boolean;\n\n autogenerated?: boolean;\n\n name: string;\n\n parents?: AllowedParents[];\n\n stage?: RenovateConfigStage;\n\n experimental?: boolean;\n\n experimentalDescription?: string;\n\n experimentalIssues?: number[];\n\n advancedUse?: boolean;\n\n /**\n * This is used to add depreciation message in the docs\n */\n deprecationMsg?: string;\n\n /**\n * For internal use only: add it to any config option that supports regex or glob matching\n */\n patternMatch?: boolean;\n\n /**\n * For internal use only: add it to any config option of type integer that supports negative integers\n */\n allowNegative?: boolean;\n}\n\nexport interface RenovateArrayOption<\n T extends string | number | Record<string, unknown> = Record<string, unknown>,\n> extends RenovateOptionBase {\n default?: T[] | null;\n mergeable?: boolean;\n type: 'array';\n subType?: 'string' | 'object' | 'number';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateStringArrayOption extends RenovateArrayOption<string> {\n format?: 'regex';\n subType: 'string';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateNumberArrayOption extends RenovateArrayOption<number> {\n subType: 'number';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateBooleanOption extends RenovateOptionBase {\n default?: boolean | null;\n type: 'boolean';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateIntegerOption extends RenovateOptionBase {\n default?: number | null;\n type: 'integer';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateStringOption extends RenovateOptionBase {\n default?: string | null;\n format?: 'regex';\n\n // Not used\n replaceLineReturns?: boolean;\n type: 'string';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport interface RenovateObjectOption extends RenovateOptionBase {\n default?: any;\n additionalProperties?: Record<string, unknown> | boolean;\n mergeable?: boolean;\n type: 'object';\n supportedManagers?: string[] | 'all';\n supportedPlatforms?: string[] | 'all';\n}\n\nexport type RenovateOptions =\n | RenovateStringOption\n | RenovateNumberArrayOption\n | RenovateStringArrayOption\n | RenovateIntegerOption\n | RenovateBooleanOption\n | RenovateArrayOption\n | RenovateObjectOption;\n\nexport interface PackageRuleInputConfig extends Record<string, unknown> {\n versioning?: string;\n packageFile?: string;\n lockFiles?: string[];\n depType?: string;\n depTypes?: string[];\n depName?: string;\n packageName?: string | null;\n newValue?: string | null;\n currentValue?: string | null;\n currentVersion?: string;\n lockedVersion?: string;\n updateType?: UpdateType;\n mergeConfidenceLevel?: MergeConfidence | undefined;\n isBump?: boolean;\n sourceUrl?: string | null;\n categories?: string[];\n baseBranch?: string;\n manager?: string;\n datasource?: string;\n packageRules?: (PackageRule & PackageRuleInputConfig)[];\n releaseTimestamp?: string | null;\n repository?: string;\n currentVersionAgeInDays?: number;\n currentVersionTimestamp?: string;\n enabled?: boolean;\n skipReason?: SkipReason;\n skipStage?: StageName;\n}\n\nexport interface ConfigMigration {\n configMigration?: boolean;\n}\n\nexport interface MigratedConfig {\n isMigrated: boolean;\n migratedConfig: RenovateConfig;\n}\n\nexport interface MigratedRenovateConfig extends RenovateConfig {\n endpoints?: HostRule[];\n pathRules: PackageRule[];\n packages: PackageRule[];\n\n node?: RenovateConfig;\n travis?: RenovateConfig;\n gradle?: RenovateConfig;\n}\n\nexport interface ManagerConfig extends RenovateConfig {\n manager: string;\n}\n\nexport interface ValidationResult {\n errors: ValidationMessage[];\n warnings: ValidationMessage[];\n}\n"]}
|
@@ -163,7 +163,15 @@ class GoProxyDatasource extends datasource_1.Datasource {
|
|
163
163
|
let releases = [];
|
164
164
|
try {
|
165
165
|
const res = await this.listVersions(baseUrl, pkg);
|
166
|
-
|
166
|
+
// Artifactory returns all versions in any major (past and future),
|
167
|
+
// so starting from v2, we filter them in order to avoid the infinite loop
|
168
|
+
const filteredReleases = res.filter(({ version }) => {
|
169
|
+
if (major < 2) {
|
170
|
+
return true;
|
171
|
+
}
|
172
|
+
return (version.split((0, regex_1.regEx)(/[^\d]+/)).find(is_1.default.truthy) === major.toString());
|
173
|
+
});
|
174
|
+
releases = await p.map(filteredReleases, async (versionInfo) => {
|
167
175
|
const { version, newDigest, releaseTimestamp } = versionInfo;
|
168
176
|
if (releaseTimestamp) {
|
169
177
|
return { version, newDigest, releaseTimestamp };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"releases-goproxy.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/go/releases-goproxy.ts"],"names":[],"mappings":";;;AA4BA,wDAgBC;;AA5CD,kEAAkC;AAClC,iCAAiC;AACjC,4CAAyC;AACzC,mFAA8E;AAC9E,qEAA8D;AAC9D,yDAAqD;AACrD,6CAA+C;AAC/C,kEAA4C;AAC5C,+CAA0D;AAC1D,2CAAiD;AACjD,iGAA6D;AAC7D,8CAA2C;AAE3C,iCAA0C;AAC1C,qCAAwC;AACxC,qDAA8D;AAC9D,uDAAuD;AAGvD,MAAM,QAAQ,GAAG,IAAA,aAAK,EAAC,iDA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AC,aAAa,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;oBAClE,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;gBACrC,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;oBAC5B,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC;oBAChE,IAAI,iBAAiB,EAAE,CAAC;wBACtB,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;oBAC1C,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACrB,MAAM;YACR,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,EAAE,WAAW,EAAqB;QACnD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QACpC,MAAM,OAAO,GAAG,IAAA,6BAAY,GAAE,CAAC;QAC/B,uBAAuB;QACvB,OAAO,GAAG,WAAW,KAAK,OAAO,KAAK,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC;IAC9D,CAAC;;AAtOH,8CAuOC;AA1NO;IAJL,IAAA,iBAAK,EAAC;QACL,SAAS,EAAE,cAAc,iBAAiB,CAAC,EAAE,EAAE;QAC/C,GAAG,EAAE,CAAC,MAAyB,EAAE,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC;KAC1E,CAAC;oDA8DD","sourcesContent":["import is from '@sindresorhus/is';\nimport { DateTime } from 'luxon';\nimport { logger } from '../../../logger';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport { cache } from '../../../util/cache/package/decorator';\nimport { filterMap } from '../../../util/filter-map';\nimport { HttpError } from '../../../util/http';\nimport * as p from '../../../util/promises';\nimport { newlineRegex, regEx } from '../../../util/regex';\nimport { joinUrlParts } from '../../../util/url';\nimport goVersioning from '../../versioning/go-mod-directive';\nimport { Datasource } from '../datasource';\nimport type { GetReleasesConfig, Release, ReleaseResult } from '../types';\nimport { BaseGoDatasource } from './base';\nimport { getSourceUrl } from './common';\nimport { parseGoproxy, parseNoproxy } from './goproxy-parser';\nimport { GoDirectDatasource } from './releases-direct';\nimport type { VersionInfo } from './types';\n\nconst modRegex = regEx(/^(?<baseMod>.*?)(?:[./]v(?<majorVersion>\\d+))?$/);\n\n/**\n * @see https://go.dev/ref/mod#pseudo-versions\n */\nconst pseudoVersionRegex = regEx(\n /v\\d+\\.\\d+\\.\\d+-(?:\\w+\\.)?(?:0\\.)?(?<timestamp>\\d{14})-(?<digest>[a-f0-9]{12})/i,\n);\n\nexport function pseudoVersionToRelease(pseudoVersion: string): Release | null {\n const match = pseudoVersion.match(pseudoVersionRegex)?.groups;\n if (!match) {\n return null;\n }\n\n const { digest: newDigest, timestamp } = match;\n const releaseTimestamp = DateTime.fromFormat(timestamp, 'yyyyMMddHHmmss', {\n zone: 'UTC',\n }).toISO({ suppressMilliseconds: true });\n\n return {\n version: pseudoVersion,\n newDigest,\n releaseTimestamp,\n };\n}\n\nexport class GoProxyDatasource extends Datasource {\n static readonly id = 'go-proxy';\n\n constructor() {\n super(GoProxyDatasource.id);\n }\n\n readonly direct = new GoDirectDatasource();\n\n @cache({\n namespace: `datasource-${GoProxyDatasource.id}`,\n key: (config: GetReleasesConfig) => GoProxyDatasource.getCacheKey(config),\n })\n async getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n const { packageName } = config;\n logger.trace(`goproxy.getReleases(${packageName})`);\n const goproxy = process.env.GOPROXY ?? 'https://proxy.golang.org,direct';\n if (goproxy === 'direct') {\n return this.direct.getReleases(config);\n }\n const proxyList = parseGoproxy(goproxy);\n const noproxy = parseNoproxy();\n\n let result: ReleaseResult | null = null;\n\n if (noproxy?.test(packageName)) {\n logger.debug(`Fetching ${packageName} via GONOPROXY match`);\n result = await this.direct.getReleases(config);\n return result;\n }\n\n for (const { url, fallback } of proxyList) {\n try {\n if (url === 'off') {\n break;\n } else if (url === 'direct') {\n result = await this.direct.getReleases(config);\n break;\n }\n\n const res = await this.getVersionsWithInfo(url, packageName);\n if (res.releases.length) {\n result = res;\n break;\n }\n } catch (err) {\n const potentialHttpError =\n err instanceof ExternalHostError ? err.err : err;\n const statusCode = potentialHttpError?.response?.statusCode;\n const canFallback =\n fallback === '|' ? true : statusCode === 404 || statusCode === 410;\n const msg = canFallback\n ? 'Goproxy error: trying next URL provided with GOPROXY'\n : 'Goproxy error: skipping other URLs provided with GOPROXY';\n logger.debug({ err }, msg);\n if (!canFallback) {\n break;\n }\n }\n }\n\n if (result && !result.sourceUrl) {\n try {\n const datasource = await BaseGoDatasource.getDatasource(packageName);\n const sourceUrl = getSourceUrl(datasource);\n if (sourceUrl) {\n result.sourceUrl = sourceUrl;\n }\n } catch (err) {\n logger.trace({ err }, `Can't get datasource for ${packageName}`);\n }\n }\n\n return result;\n }\n\n /**\n * Avoid ambiguity when serving from case-insensitive file systems.\n *\n * @see https://golang.org/ref/mod#goproxy-protocol\n */\n encodeCase(input: string): string {\n return input.replace(regEx(/([A-Z])/g), (x) => `!${x.toLowerCase()}`);\n }\n\n async listVersions(baseUrl: string, packageName: string): Promise<Release[]> {\n const url = joinUrlParts(\n baseUrl,\n this.encodeCase(packageName),\n '@v',\n 'list',\n );\n const { body } = await this.http.get(url);\n return filterMap(body.split(newlineRegex), (str) => {\n if (!is.nonEmptyStringAndNotWhitespace(str)) {\n return null;\n }\n\n const [version, releaseTimestamp] = str.trim().split(regEx(/\\s+/));\n const release: Release = pseudoVersionToRelease(version) ?? { version };\n\n if (releaseTimestamp) {\n release.releaseTimestamp = releaseTimestamp;\n }\n\n return release;\n });\n }\n\n async versionInfo(\n baseUrl: string,\n packageName: string,\n version: string,\n ): Promise<Release> {\n const url = joinUrlParts(\n baseUrl,\n this.encodeCase(packageName),\n '@v',\n `${version}.info`,\n );\n const res = await this.http.getJson<VersionInfo>(url);\n\n const result: Release = {\n version: res.body.Version,\n };\n\n if (res.body.Time) {\n result.releaseTimestamp = res.body.Time;\n }\n\n return result;\n }\n\n async getLatestVersion(\n baseUrl: string,\n packageName: string,\n ): Promise<string | null> {\n try {\n const url = joinUrlParts(\n baseUrl,\n this.encodeCase(packageName),\n '@latest',\n );\n const res = await this.http.getJson<VersionInfo>(url);\n return res.body.Version;\n } catch (err) {\n logger.trace({ err }, 'Failed to get latest version');\n return null;\n }\n }\n\n async getVersionsWithInfo(\n baseUrl: string,\n packageName: string,\n ): Promise<ReleaseResult> {\n const isGopkgin = packageName.startsWith('gopkg.in/');\n const majorSuffixSeparator = isGopkgin ? '.' : '/';\n const modParts = packageName.match(modRegex)?.groups;\n const baseMod = modParts?.baseMod ?? /* istanbul ignore next */ packageName;\n const packageMajor = parseInt(modParts?.majorVersion ?? '0');\n\n const result: ReleaseResult = { releases: [] };\n for (let major = packageMajor; ; major += 1) {\n let pkg = `${baseMod}${majorSuffixSeparator}v${major}`;\n if (!isGopkgin && major < 2) {\n pkg = baseMod;\n major += 1; // v0 and v1 are the same module\n }\n\n let releases: Release[] = [];\n\n try {\n const res = await this.listVersions(baseUrl, pkg);\n releases = await p.map(res, async (versionInfo) => {\n const { version, newDigest, releaseTimestamp } = versionInfo;\n\n if (releaseTimestamp) {\n return { version, newDigest, releaseTimestamp };\n }\n\n try {\n return await this.versionInfo(baseUrl, pkg, version);\n } catch (err) {\n logger.trace({ err }, `Can't obtain data from ${baseUrl}`);\n return { version };\n }\n });\n result.releases.push(...releases);\n } catch (err) {\n const potentialHttpError =\n err instanceof ExternalHostError ? err.err : err;\n if (\n potentialHttpError instanceof HttpError &&\n potentialHttpError.response?.statusCode === 404 &&\n major !== packageMajor\n ) {\n break;\n }\n\n throw err;\n }\n\n const latestVersion = await this.getLatestVersion(baseUrl, pkg);\n if (latestVersion) {\n result.tags ??= {};\n result.tags.latest ??= latestVersion;\n if (goVersioning.isGreaterThan(latestVersion, result.tags.latest)) {\n result.tags.latest = latestVersion;\n }\n if (!result.releases.length) {\n const releaseFromLatest = pseudoVersionToRelease(latestVersion);\n if (releaseFromLatest) {\n result.releases.push(releaseFromLatest);\n }\n }\n }\n\n if (!releases.length) {\n break;\n }\n }\n\n return result;\n }\n\n static getCacheKey({ packageName }: GetReleasesConfig): string {\n const goproxy = process.env.GOPROXY;\n const noproxy = parseNoproxy();\n // TODO: types (#22198)\n return `${packageName}@@${goproxy}@@${noproxy?.toString()}`;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"releases-goproxy.js","sourceRoot":"","sources":["../../../../lib/modules/datasource/go/releases-goproxy.ts"],"names":[],"mappings":";;;AA4BA,wDAgBC;;AA5CD,kEAAkC;AAClC,iCAAiC;AACjC,4CAAyC;AACzC,mFAA8E;AAC9E,qEAA8D;AAC9D,yDAAqD;AACrD,6CAA+C;AAC/C,kEAA4C;AAC5C,+CAA0D;AAC1D,2CAAiD;AACjD,iGAA6D;AAC7D,8CAA2C;AAE3C,iCAA0C;AAC1C,qCAAwC;AACxC,qDAA8D;AAC9D,uDAAuD;AAGvD,MAAM,QAAQ,GAAG,IAAA,aAAK,EAAC,iDAAiD,CAAC,CAAC;AAE1E;;GAEG;AACH,MAAM,kBAAkB,GAAG,IAAA,aAAK,EAC9B,gFAAgF,CACjF,CAAC;AAEF,SAAgB,sBAAsB,CAAC,aAAqB;IAC1D,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC9D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC/C,MAAM,gBAAgB,GAAG,gBAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,gBAAgB,EAAE;QACxE,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC,KAAK,CAAC,EAAE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AAC,MAAM,GAAG,aAAa,CAAC;gBACrC,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;oBAC5B,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC;oBAChE,IAAI,iBAAiB,EAAE,CAAC;wBACtB,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;oBAC1C,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACrB,MAAM;YACR,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,EAAE,WAAW,EAAqB;QACnD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QACpC,MAAM,OAAO,GAAG,IAAA,6BAAY,GAAE,CAAC;QAC/B,uBAAuB;QACvB,OAAO,GAAG,WAAW,KAAK,OAAO,KAAK,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC;IAC9D,CAAC;;AAnPH,8CAoPC;AAvOO;IAJL,IAAA,iBAAK,EAAC;QACL,SAAS,EAAE,cAAc,iBAAiB,CAAC,EAAE,EAAE;QAC/C,GAAG,EAAE,CAAC,MAAyB,EAAE,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC;KAC1E,CAAC;oDA8DD","sourcesContent":["import is from '@sindresorhus/is';\nimport { DateTime } from 'luxon';\nimport { logger } from '../../../logger';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport { cache } from '../../../util/cache/package/decorator';\nimport { filterMap } from '../../../util/filter-map';\nimport { HttpError } from '../../../util/http';\nimport * as p from '../../../util/promises';\nimport { newlineRegex, regEx } from '../../../util/regex';\nimport { joinUrlParts } from '../../../util/url';\nimport goVersioning from '../../versioning/go-mod-directive';\nimport { Datasource } from '../datasource';\nimport type { GetReleasesConfig, Release, ReleaseResult } from '../types';\nimport { BaseGoDatasource } from './base';\nimport { getSourceUrl } from './common';\nimport { parseGoproxy, parseNoproxy } from './goproxy-parser';\nimport { GoDirectDatasource } from './releases-direct';\nimport type { VersionInfo } from './types';\n\nconst modRegex = regEx(/^(?<baseMod>.*?)(?:[./]v(?<majorVersion>\\d+))?$/);\n\n/**\n * @see https://go.dev/ref/mod#pseudo-versions\n */\nconst pseudoVersionRegex = regEx(\n /v\\d+\\.\\d+\\.\\d+-(?:\\w+\\.)?(?:0\\.)?(?<timestamp>\\d{14})-(?<digest>[a-f0-9]{12})/i,\n);\n\nexport function pseudoVersionToRelease(pseudoVersion: string): Release | null {\n const match = pseudoVersion.match(pseudoVersionRegex)?.groups;\n if (!match) {\n return null;\n }\n\n const { digest: newDigest, timestamp } = match;\n const releaseTimestamp = DateTime.fromFormat(timestamp, 'yyyyMMddHHmmss', {\n zone: 'UTC',\n }).toISO({ suppressMilliseconds: true });\n\n return {\n version: pseudoVersion,\n newDigest,\n releaseTimestamp,\n };\n}\n\nexport class GoProxyDatasource extends Datasource {\n static readonly id = 'go-proxy';\n\n constructor() {\n super(GoProxyDatasource.id);\n }\n\n readonly direct = new GoDirectDatasource();\n\n @cache({\n namespace: `datasource-${GoProxyDatasource.id}`,\n key: (config: GetReleasesConfig) => GoProxyDatasource.getCacheKey(config),\n })\n async getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n const { packageName } = config;\n logger.trace(`goproxy.getReleases(${packageName})`);\n const goproxy = process.env.GOPROXY ?? 'https://proxy.golang.org,direct';\n if (goproxy === 'direct') {\n return this.direct.getReleases(config);\n }\n const proxyList = parseGoproxy(goproxy);\n const noproxy = parseNoproxy();\n\n let result: ReleaseResult | null = null;\n\n if (noproxy?.test(packageName)) {\n logger.debug(`Fetching ${packageName} via GONOPROXY match`);\n result = await this.direct.getReleases(config);\n return result;\n }\n\n for (const { url, fallback } of proxyList) {\n try {\n if (url === 'off') {\n break;\n } else if (url === 'direct') {\n result = await this.direct.getReleases(config);\n break;\n }\n\n const res = await this.getVersionsWithInfo(url, packageName);\n if (res.releases.length) {\n result = res;\n break;\n }\n } catch (err) {\n const potentialHttpError =\n err instanceof ExternalHostError ? err.err : err;\n const statusCode = potentialHttpError?.response?.statusCode;\n const canFallback =\n fallback === '|' ? true : statusCode === 404 || statusCode === 410;\n const msg = canFallback\n ? 'Goproxy error: trying next URL provided with GOPROXY'\n : 'Goproxy error: skipping other URLs provided with GOPROXY';\n logger.debug({ err }, msg);\n if (!canFallback) {\n break;\n }\n }\n }\n\n if (result && !result.sourceUrl) {\n try {\n const datasource = await BaseGoDatasource.getDatasource(packageName);\n const sourceUrl = getSourceUrl(datasource);\n if (sourceUrl) {\n result.sourceUrl = sourceUrl;\n }\n } catch (err) {\n logger.trace({ err }, `Can't get datasource for ${packageName}`);\n }\n }\n\n return result;\n }\n\n /**\n * Avoid ambiguity when serving from case-insensitive file systems.\n *\n * @see https://golang.org/ref/mod#goproxy-protocol\n */\n encodeCase(input: string): string {\n return input.replace(regEx(/([A-Z])/g), (x) => `!${x.toLowerCase()}`);\n }\n\n async listVersions(baseUrl: string, packageName: string): Promise<Release[]> {\n const url = joinUrlParts(\n baseUrl,\n this.encodeCase(packageName),\n '@v',\n 'list',\n );\n const { body } = await this.http.get(url);\n return filterMap(body.split(newlineRegex), (str) => {\n if (!is.nonEmptyStringAndNotWhitespace(str)) {\n return null;\n }\n\n const [version, releaseTimestamp] = str.trim().split(regEx(/\\s+/));\n const release: Release = pseudoVersionToRelease(version) ?? { version };\n\n if (releaseTimestamp) {\n release.releaseTimestamp = releaseTimestamp;\n }\n\n return release;\n });\n }\n\n async versionInfo(\n baseUrl: string,\n packageName: string,\n version: string,\n ): Promise<Release> {\n const url = joinUrlParts(\n baseUrl,\n this.encodeCase(packageName),\n '@v',\n `${version}.info`,\n );\n const res = await this.http.getJson<VersionInfo>(url);\n\n const result: Release = {\n version: res.body.Version,\n };\n\n if (res.body.Time) {\n result.releaseTimestamp = res.body.Time;\n }\n\n return result;\n }\n\n async getLatestVersion(\n baseUrl: string,\n packageName: string,\n ): Promise<string | null> {\n try {\n const url = joinUrlParts(\n baseUrl,\n this.encodeCase(packageName),\n '@latest',\n );\n const res = await this.http.getJson<VersionInfo>(url);\n return res.body.Version;\n } catch (err) {\n logger.trace({ err }, 'Failed to get latest version');\n return null;\n }\n }\n\n async getVersionsWithInfo(\n baseUrl: string,\n packageName: string,\n ): Promise<ReleaseResult> {\n const isGopkgin = packageName.startsWith('gopkg.in/');\n const majorSuffixSeparator = isGopkgin ? '.' : '/';\n const modParts = packageName.match(modRegex)?.groups;\n const baseMod = modParts?.baseMod ?? /* istanbul ignore next */ packageName;\n const packageMajor = parseInt(modParts?.majorVersion ?? '0');\n\n const result: ReleaseResult = { releases: [] };\n for (let major = packageMajor; ; major += 1) {\n let pkg = `${baseMod}${majorSuffixSeparator}v${major}`;\n if (!isGopkgin && major < 2) {\n pkg = baseMod;\n major += 1; // v0 and v1 are the same module\n }\n\n let releases: Release[] = [];\n\n try {\n const res = await this.listVersions(baseUrl, pkg);\n\n // Artifactory returns all versions in any major (past and future),\n // so starting from v2, we filter them in order to avoid the infinite loop\n const filteredReleases = res.filter(({ version }) => {\n if (major < 2) {\n return true;\n }\n\n return (\n version.split(regEx(/[^\\d]+/)).find(is.truthy) === major.toString()\n );\n });\n\n releases = await p.map(filteredReleases, async (versionInfo) => {\n const { version, newDigest, releaseTimestamp } = versionInfo;\n\n if (releaseTimestamp) {\n return { version, newDigest, releaseTimestamp };\n }\n\n try {\n return await this.versionInfo(baseUrl, pkg, version);\n } catch (err) {\n logger.trace({ err }, `Can't obtain data from ${baseUrl}`);\n return { version };\n }\n });\n result.releases.push(...releases);\n } catch (err) {\n const potentialHttpError =\n err instanceof ExternalHostError ? err.err : err;\n if (\n potentialHttpError instanceof HttpError &&\n potentialHttpError.response?.statusCode === 404 &&\n major !== packageMajor\n ) {\n break;\n }\n\n throw err;\n }\n\n const latestVersion = await this.getLatestVersion(baseUrl, pkg);\n if (latestVersion) {\n result.tags ??= {};\n result.tags.latest ??= latestVersion;\n if (goVersioning.isGreaterThan(latestVersion, result.tags.latest)) {\n result.tags.latest = latestVersion;\n }\n if (!result.releases.length) {\n const releaseFromLatest = pseudoVersionToRelease(latestVersion);\n if (releaseFromLatest) {\n result.releases.push(releaseFromLatest);\n }\n }\n }\n\n if (!releases.length) {\n break;\n }\n }\n\n return result;\n }\n\n static getCacheKey({ packageName }: GetReleasesConfig): string {\n const goproxy = process.env.GOPROXY;\n const noproxy = parseNoproxy();\n // TODO: types (#22198)\n return `${packageName}@@${goproxy}@@${noproxy?.toString()}`;\n }\n}\n"]}
|
@@ -246,7 +246,7 @@ async function updateYarnBinary(lockFileDir, updatedArtifacts, existingYarnrcYml
|
|
246
246
|
let yarnrcYml = existingYarnrcYmlContent;
|
247
247
|
try {
|
248
248
|
const yarnrcYmlFilename = upath_1.default.join(lockFileDir, '.yarnrc.yml');
|
249
|
-
yarnrcYml
|
249
|
+
yarnrcYml ??= (await (0, git_1.getFile)(yarnrcYmlFilename)) ?? undefined;
|
250
250
|
const newYarnrcYml = await (0, fs_1.readLocalFile)(yarnrcYmlFilename, 'utf8');
|
251
251
|
if (!is_1.default.string(yarnrcYml) || !is_1.default.string(newYarnrcYml)) {
|
252
252
|
return existingYarnrcYmlContent;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/modules/manager/npm/post-update/index.ts"],"names":[],"mappings":";;AA+CA,sDAoEC;AAED,gDAsGC;AAED,4DA6BC;AAwDD,4CAkDC;AAED,gDAqRC;;AA3nBD,uBAAuB;AACvB,kEAAkC;AAClC,kEAAkC;AAClC,0DAA0B;AAC1B,+CAA4C;AAC5C,sFAAiF;AACjF,mDAA+D;AAC/D,4CAK6B;AAC7B,8CAA8D;AAE9D,+EAAyD;AACzD,kDAA6D;AAC7D,8CAA2D;AAC3D,gDAA8D;AAC9D,iDAAwD;AACxD,+CAA4C;AAE5C,0C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C/E,EACD,mBAAa,CAAC,EAAE,CACjB,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;YACD,cAAc,CAAC,IAAI,CAAC;gBAClB,QAAQ,EAAE,cAAc;gBACxB,wEAAwE;gBACxE,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM;aACjC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,MAAM,eAAe,GAAG,MAAM,IAAA,aAAO,EACnC,cAAc,EACd,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CACnE,CAAC;YACF,IAAI,GAAG,CAAC,QAAQ,KAAK,eAAe,EAAE,CAAC;gBACrC,eAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,eAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;gBAC9C,gBAAgB,CAAC,IAAI,CAAC;oBACpB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,cAAc;oBACpB,mCAAmC;oBACnC,QAAQ,EAAE,GAAG,CAAC,QAAS;iBACxB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,MAAM,IAAA,yBAAiB,EAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["// TODO: types (#22198)\nimport is from '@sindresorhus/is';\nimport deepmerge from 'deepmerge';\nimport upath from 'upath';\nimport { logger } from '../../../../logger';\nimport { ExternalHostError } from '../../../../types/errors/external-host-error';\nimport { getChildProcessEnv } from '../../../../util/exec/env';\nimport {\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../../util/fs';\nimport { getFile, getRepoStatus } from '../../../../util/git';\nimport type { FileChange } from '../../../../util/git/types';\nimport * as hostRules from '../../../../util/host-rules';\nimport { newlineRegex, regEx } from '../../../../util/regex';\nimport { ensureTrailingSlash } from '../../../../util/url';\nimport { dump, parseSingleYaml } from '../../../../util/yaml';\nimport { NpmDatasource } from '../../../datasource/npm';\nimport { scm } from '../../../platform/scm';\nimport type { PackageFile, PostUpdateConfig, Upgrade } from '../../types';\nimport { getZeroInstallPaths } from '../extract/yarn';\nimport type { NpmManagerData } from '../types';\nimport {\n composeLockFile,\n getNpmrcContent,\n parseLockFile,\n resetNpmrcContent,\n updateNpmrcContent,\n} from '../utils';\nimport * as npm from './npm';\nimport * as pnpm from './pnpm';\nimport { processHostRules } from './rules';\nimport type {\n AdditionalPackageFiles,\n ArtifactError,\n DetermineLockFileDirsResult,\n WriteExistingFilesResult,\n YarnRcYmlFile,\n} from './types';\nimport * as yarn from './yarn';\n\n// Strips empty values, deduplicates, and returns the directories from filenames\nconst getDirs = (arr: (string | null | undefined)[]): string[] =>\n Array.from(new Set(arr.filter(is.string)));\n\nexport function determineLockFileDirs(\n config: PostUpdateConfig,\n packageFiles: AdditionalPackageFiles,\n): DetermineLockFileDirsResult {\n const npmLockDirs: (string | undefined)[] = [];\n const yarnLockDirs: (string | undefined)[] = [];\n const pnpmShrinkwrapDirs: (string | undefined)[] = [];\n\n for (const upgrade of config.upgrades) {\n if (\n upgrade.updateType === 'lockFileMaintenance' ||\n upgrade.isRemediation === true ||\n upgrade.isLockfileUpdate === true\n ) {\n yarnLockDirs.push(upgrade.managerData?.yarnLock);\n npmLockDirs.push(upgrade.managerData?.npmLock);\n pnpmShrinkwrapDirs.push(upgrade.managerData?.pnpmShrinkwrap);\n }\n }\n\n if (\n config.upgrades.every(\n (upgrade: Upgrade) =>\n upgrade.updateType === 'lockFileMaintenance' ||\n upgrade.isLockfileUpdate,\n )\n ) {\n return {\n yarnLockDirs: getDirs(yarnLockDirs),\n npmLockDirs: getDirs(npmLockDirs),\n pnpmShrinkwrapDirs: getDirs(pnpmShrinkwrapDirs),\n };\n }\n\n function getPackageFile(\n fileName: string,\n ): Partial<PackageFile<NpmManagerData>> {\n logger.trace('Looking for packageFile: ' + fileName);\n\n for (const packageFile of packageFiles.npm!) {\n if (packageFile.packageFile === fileName) {\n logger.trace({ packageFile }, 'Found packageFile');\n return packageFile;\n }\n logger.trace('No match');\n }\n return {};\n }\n\n // TODO #22198\n for (const p of config.updatedPackageFiles!) {\n logger.trace(`Checking ${String(p.path)} for lock files`);\n const packageFile = getPackageFile(p.path);\n // istanbul ignore if\n if (!packageFile.managerData) {\n continue;\n }\n // push full lock file names and convert them later\n yarnLockDirs.push(packageFile.managerData.yarnLock);\n npmLockDirs.push(packageFile.managerData.npmLock);\n pnpmShrinkwrapDirs.push(packageFile.managerData.pnpmShrinkwrap);\n }\n\n return {\n yarnLockDirs: getDirs(yarnLockDirs),\n npmLockDirs: getDirs(npmLockDirs),\n pnpmShrinkwrapDirs: getDirs(pnpmShrinkwrapDirs),\n };\n}\n\nexport async function writeExistingFiles(\n config: PostUpdateConfig,\n packageFiles: AdditionalPackageFiles,\n): Promise<void> {\n if (!packageFiles.npm) {\n return;\n }\n const npmFiles = packageFiles.npm;\n logger.debug(\n { packageFiles: npmFiles.map((n) => n.packageFile) },\n 'Writing package.json files',\n );\n for (const packageFile of npmFiles) {\n // istanbul ignore if\n if (!packageFile.managerData) {\n continue;\n }\n // TODO #22198\n const basedir = upath.dirname(packageFile.packageFile!);\n const npmrc = packageFile.npmrc;\n const npmrcFilename = upath.join(basedir, '.npmrc');\n if (is.string(npmrc)) {\n try {\n await writeLocalFile(npmrcFilename, npmrc.replace(/\\n?$/, '\\n'));\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ npmrcFilename, err }, 'Error writing .npmrc');\n }\n }\n const npmLock = packageFile.managerData.npmLock;\n if (npmLock) {\n const npmLockPath = npmLock;\n logger.debug(`Writing ${npmLock}`);\n let existingNpmLock: string;\n try {\n existingNpmLock = (await getFile(npmLock)) ?? '';\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ err }, 'Error reading npm lock file');\n existingNpmLock = '';\n }\n const { detectedIndent, lockFileParsed: npmLockParsed } =\n parseLockFile(existingNpmLock);\n if (npmLockParsed) {\n const packageNames =\n 'packages' in npmLockParsed\n ? Object.keys(npmLockParsed.packages)\n : [];\n const widens: string[] = [];\n let lockFileChanged = false;\n for (const upgrade of config.upgrades) {\n if (upgrade.lockFiles && !upgrade.lockFiles.includes(npmLock)) {\n continue;\n }\n if (!upgrade.managerData) {\n continue;\n }\n if (\n upgrade.rangeStrategy === 'widen' &&\n upgrade.managerData.npmLock === npmLock\n ) {\n // TODO #22198\n widens.push(upgrade.depName!);\n }\n const { depName } = upgrade;\n for (const packageName of packageNames) {\n if (\n 'packages' in npmLockParsed &&\n (packageName === `node_modules/${depName}` ||\n packageName.startsWith(`node_modules/${depName}/`))\n ) {\n logger.trace({ packageName }, 'Massaging out package name');\n lockFileChanged = true;\n delete npmLockParsed.packages[packageName];\n }\n }\n }\n if (widens.length) {\n logger.debug(\n `Removing ${String(widens)} from ${npmLock} to force an update`,\n );\n lockFileChanged = true;\n try {\n if ('dependencies' in npmLockParsed && npmLockParsed.dependencies) {\n widens.forEach((depName) => {\n // TODO #22198\n delete npmLockParsed.dependencies![depName];\n });\n }\n } catch /* istanbul ignore next */ {\n logger.warn(\n { npmLock },\n 'Error massaging package-lock.json for widen',\n );\n }\n }\n if (lockFileChanged) {\n logger.debug('Massaging npm lock file before writing to disk');\n existingNpmLock = composeLockFile(npmLockParsed, detectedIndent);\n }\n await writeLocalFile(npmLockPath, existingNpmLock);\n }\n }\n }\n}\n\nexport async function writeUpdatedPackageFiles(\n config: PostUpdateConfig,\n): Promise<void> {\n logger.trace({ config }, 'writeUpdatedPackageFiles');\n logger.debug('Writing any updated package files');\n if (!config.updatedPackageFiles) {\n logger.debug('No files found');\n return;\n }\n const supportedLockFiles = ['package-lock.json', 'yarn.lock'];\n for (const packageFile of config.updatedPackageFiles) {\n if (packageFile.type !== 'addition') {\n continue;\n }\n if (\n supportedLockFiles.some((fileName) => packageFile.path.endsWith(fileName))\n ) {\n logger.debug(`Writing lock file: ${packageFile.path}`);\n // TODO #22198\n\n await writeLocalFile(packageFile.path, packageFile.contents!);\n continue;\n }\n if (!packageFile.path.endsWith('package.json')) {\n continue;\n }\n logger.debug(`Writing ${packageFile.path}`);\n await writeLocalFile(packageFile.path, packageFile.contents!);\n }\n}\n\n// istanbul ignore next\nasync function updateYarnOffline(\n lockFileDir: string,\n updatedArtifacts: FileChange[],\n): Promise<void> {\n try {\n const resolvedPaths: string[] = [];\n const yarnrcYml = await getFile(upath.join(lockFileDir, '.yarnrc.yml'));\n const yarnrc = await getFile(upath.join(lockFileDir, '.yarnrc'));\n\n // As .yarnrc.yml overrides .yarnrc in Yarn 1 (https://git.io/JUcco)\n // both files may exist, so check for .yarnrc.yml first\n if (yarnrcYml) {\n // Yarn 2 (offline cache and zero-installs)\n const paths = getZeroInstallPaths(yarnrcYml);\n resolvedPaths.push(...paths.map((p) => upath.join(lockFileDir, p)));\n } else if (yarnrc) {\n // Yarn 1 (offline mirror)\n const mirrorLine = yarnrc\n .split(newlineRegex)\n .find((line) => line.startsWith('yarn-offline-mirror '));\n if (mirrorLine) {\n const mirrorPath = ensureTrailingSlash(\n mirrorLine.split(' ')[1].replace(regEx(/\"/g), ''),\n );\n resolvedPaths.push(upath.join(lockFileDir, mirrorPath));\n }\n }\n logger.debug({ resolvedPaths }, 'updateYarnOffline resolvedPaths');\n\n if (resolvedPaths.length) {\n const status = await getRepoStatus();\n for (const f of status.modified.concat(status.not_added)) {\n if (resolvedPaths.some((p) => f.startsWith(p))) {\n updatedArtifacts.push({\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n });\n }\n }\n for (const f of status.deleted || []) {\n if (resolvedPaths.some((p) => f.startsWith(p))) {\n updatedArtifacts.push({ type: 'deletion', path: f });\n }\n }\n }\n } catch (err) {\n logger.error({ err }, 'Error updating yarn offline packages');\n }\n}\n\n// TODO: move to ./yarn.ts\n// exported for testing\nexport async function updateYarnBinary(\n lockFileDir: string,\n updatedArtifacts: FileChange[],\n existingYarnrcYmlContent: string | undefined | null,\n): Promise<string | undefined | null> {\n let yarnrcYml = existingYarnrcYmlContent;\n try {\n const yarnrcYmlFilename = upath.join(lockFileDir, '.yarnrc.yml');\n yarnrcYml ||= (await getFile(yarnrcYmlFilename)) ?? undefined;\n const newYarnrcYml = await readLocalFile(yarnrcYmlFilename, 'utf8');\n if (!is.string(yarnrcYml) || !is.string(newYarnrcYml)) {\n return existingYarnrcYmlContent;\n }\n\n // TODO: use schema (#9610)\n const oldYarnPath = parseSingleYaml<YarnRcYmlFile>(yarnrcYml)?.yarnPath;\n const newYarnPath = parseSingleYaml<YarnRcYmlFile>(newYarnrcYml)?.yarnPath;\n if (\n !is.nonEmptyStringAndNotWhitespace(oldYarnPath) ||\n !is.nonEmptyStringAndNotWhitespace(newYarnPath)\n ) {\n return existingYarnrcYmlContent;\n }\n\n const oldYarnFullPath = upath.join(lockFileDir, oldYarnPath);\n const newYarnFullPath = upath.join(lockFileDir, newYarnPath);\n logger.debug({ oldYarnPath, newYarnPath }, 'Found updated Yarn binary');\n\n yarnrcYml = yarnrcYml.replace(oldYarnPath, newYarnPath);\n updatedArtifacts.push(\n {\n type: 'addition',\n path: yarnrcYmlFilename,\n contents: yarnrcYml,\n },\n {\n type: 'deletion',\n path: oldYarnFullPath,\n },\n {\n type: 'addition',\n path: newYarnFullPath,\n contents: await readLocalFile(newYarnFullPath, 'utf8'),\n isExecutable: true,\n },\n );\n } catch (err) /* istanbul ignore next */ {\n logger.error({ err }, 'Error updating Yarn binary');\n }\n return existingYarnrcYmlContent && yarnrcYml;\n}\n\nexport async function getAdditionalFiles(\n config: PostUpdateConfig<NpmManagerData>,\n packageFiles: AdditionalPackageFiles,\n): Promise<WriteExistingFilesResult> {\n logger.trace({ config }, 'getAdditionalFiles');\n const artifactErrors: ArtifactError[] = [];\n const updatedArtifacts: FileChange[] = [];\n if (!packageFiles.npm?.length) {\n return { artifactErrors, updatedArtifacts };\n }\n if (!config.updateLockFiles) {\n logger.debug('Skipping lock file generation');\n return { artifactErrors, updatedArtifacts };\n }\n if (\n config.reuseExistingBranch &&\n !config.updatedPackageFiles?.length &&\n config.upgrades?.every((upgrade) => upgrade.isLockfileUpdate)\n ) {\n logger.debug('Existing branch contains all necessary lock file updates');\n return { artifactErrors, updatedArtifacts };\n }\n logger.debug('Getting updated lock files');\n if (\n config.updateType === 'lockFileMaintenance' &&\n config.reuseExistingBranch &&\n (await scm.branchExists(config.branchName))\n ) {\n logger.debug('Skipping lockFileMaintenance update');\n return { artifactErrors, updatedArtifacts };\n }\n const dirs = determineLockFileDirs(config, packageFiles);\n logger.trace({ dirs }, 'lock file dirs');\n await writeExistingFiles(config, packageFiles);\n await writeUpdatedPackageFiles(config);\n\n const { additionalNpmrcContent, additionalYarnRcYml } = processHostRules();\n\n const env = {\n ...getChildProcessEnv(),\n NPM_CONFIG_CACHE: await ensureCacheDir('npm'),\n YARN_CACHE_FOLDER: await ensureCacheDir('yarn'),\n YARN_GLOBAL_FOLDER: await ensureCacheDir('berry'),\n npm_config_store: await ensureCacheDir('pnpm'),\n NODE_ENV: 'dev',\n };\n\n let token: string | undefined;\n try {\n ({ token } = hostRules.find({\n hostType: 'github',\n url: 'https://api.github.com/',\n }));\n token = token ? /* istanbul ignore next */ `${token}@` : token;\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ err }, 'Error getting token for packageFile');\n }\n const tokenRe = regEx(`${token ?? ''}`, 'g', false);\n for (const npmLock of dirs.npmLockDirs) {\n const lockFileDir = upath.dirname(npmLock);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n const fileName = upath.basename(npmLock);\n logger.debug(`Generating ${fileName} for ${lockFileDir}`);\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.npmLock === npmLock,\n );\n const res = await npm.generateLockFile(\n lockFileDir,\n env,\n fileName,\n config,\n upgrades,\n );\n if (res.error) {\n // istanbul ignore if\n if (res.stderr?.includes('No matching version found for')) {\n for (const upgrade of config.upgrades) {\n if (\n res.stderr.includes(\n `No matching version found for ${upgrade.depName}`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'npm' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n const err = new Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(err, NpmDatasource.id);\n }\n }\n }\n artifactErrors.push({\n lockFile: npmLock,\n stderr: res.stderr,\n });\n } else if (res.lockFile) {\n const existingContent = await getFile(\n npmLock,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(`${npmLock} hasn't changed`);\n } else {\n logger.debug(`${npmLock} needs updating`);\n updatedArtifacts.push({\n type: 'addition',\n path: npmLock,\n // TODO: can this be undefined? (#22198)\n\n contents: res.lockFile.replace(tokenRe, ''),\n });\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n }\n\n for (const yarnLock of dirs.yarnLockDirs) {\n const lockFileDir = upath.dirname(yarnLock);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n let yarnRcYmlFilename: string | undefined;\n let existingYarnrcYmlContent: string | undefined | null;\n if (additionalYarnRcYml) {\n yarnRcYmlFilename = getSiblingFileName(yarnLock, '.yarnrc.yml');\n existingYarnrcYmlContent = await readLocalFile(yarnRcYmlFilename, 'utf8');\n if (existingYarnrcYmlContent) {\n try {\n // TODO: use schema (#9610)\n const existingYarnrRcYml = parseSingleYaml<Record<string, unknown>>(\n existingYarnrcYmlContent,\n );\n\n const updatedYarnYrcYml = deepmerge(\n existingYarnrRcYml,\n yarn.fuzzyMatchAdditionalYarnrcYml(\n additionalYarnRcYml,\n existingYarnrRcYml,\n ),\n );\n\n await writeLocalFile(yarnRcYmlFilename, dump(updatedYarnYrcYml));\n logger.debug('Added authentication to .yarnrc.yml');\n } catch (err) {\n logger.warn({ err }, 'Error appending .yarnrc.yml content');\n }\n }\n }\n logger.debug(`Generating yarn.lock for ${lockFileDir}`);\n const lockFileName = upath.join(lockFileDir, 'yarn.lock');\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.yarnLock === yarnLock,\n );\n const res = await yarn.generateLockFile(lockFileDir, env, config, upgrades);\n if (res.error) {\n // istanbul ignore if\n if (res.stderr?.includes(`Couldn't find any versions for`)) {\n for (const upgrade of config.upgrades) {\n /* eslint-disable no-useless-escape */\n if (\n res.stderr.includes(\n `Couldn't find any versions for \\\\\\\"${upgrade.depName}\\\\\\\"`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'yarn' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(\n new Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n ),\n NpmDatasource.id,\n );\n }\n /* eslint-enable no-useless-escape */\n }\n }\n artifactErrors.push({\n lockFile: yarnLock,\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n stderr: res.stderr || res.stdout,\n });\n } else {\n const existingContent = await getFile(\n lockFileName,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(\"yarn.lock hasn't changed\");\n } else {\n logger.debug('yarn.lock needs updating');\n updatedArtifacts.push({\n type: 'addition',\n path: lockFileName,\n // TODO #22198\n contents: res.lockFile!,\n });\n await updateYarnOffline(lockFileDir, updatedArtifacts);\n }\n\n // istanbul ignore if: already tested seperately, needs additional test?\n if (upgrades.some(yarn.isYarnUpdate)) {\n existingYarnrcYmlContent = await updateYarnBinary(\n lockFileDir,\n updatedArtifacts,\n existingYarnrcYmlContent,\n );\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n // istanbul ignore if: needs test\n if (existingYarnrcYmlContent) {\n // TODO #22198\n await writeLocalFile(yarnRcYmlFilename!, existingYarnrcYmlContent);\n }\n }\n\n for (const pnpmShrinkwrap of dirs.pnpmShrinkwrapDirs) {\n const lockFileDir = upath.dirname(pnpmShrinkwrap);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n logger.debug(`Generating pnpm-lock.yaml for ${lockFileDir}`);\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.pnpmShrinkwrap === pnpmShrinkwrap,\n );\n const res = await pnpm.generateLockFile(lockFileDir, env, config, upgrades);\n if (res.error) {\n // istanbul ignore if\n if (res.stdout?.includes(`No compatible version found:`)) {\n for (const upgrade of config.upgrades) {\n if (\n res.stdout.includes(\n `No compatible version found: ${upgrade.depName}`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'pnpm' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(\n Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n ),\n NpmDatasource.id,\n );\n }\n }\n }\n artifactErrors.push({\n lockFile: pnpmShrinkwrap,\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n stderr: res.stderr || res.stdout,\n });\n } else {\n const existingContent = await getFile(\n pnpmShrinkwrap,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(\"pnpm-lock.yaml hasn't changed\");\n } else {\n logger.debug('pnpm-lock.yaml needs updating');\n updatedArtifacts.push({\n type: 'addition',\n path: pnpmShrinkwrap,\n // TODO: can be undefined? (#22198)\n contents: res.lockFile!,\n });\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n }\n\n return { artifactErrors, updatedArtifacts };\n}\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/modules/manager/npm/post-update/index.ts"],"names":[],"mappings":";;AA+CA,sDAoEC;AAED,gDAsGC;AAED,4DA6BC;AAwDD,4CAkDC;AAED,gDAqRC;;AA3nBD,uBAAuB;A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,OAAO,CAAC,OAAO,EAAE,CAClD,EACD,CAAC;wBACD,eAAM,CAAC,KAAK,CACV,EAAE,UAAU,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAC7C,8EAA8E,CAC/E,CAAC;wBACF,MAAM,IAAI,uCAAiB,CACzB,KAAK,CACH,8EAA8E,CAC/E,EACD,mBAAa,CAAC,EAAE,CACjB,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;YACD,cAAc,CAAC,IAAI,CAAC;gBAClB,QAAQ,EAAE,cAAc;gBACxB,wEAAwE;gBACxE,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM;aACjC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,MAAM,eAAe,GAAG,MAAM,IAAA,aAAO,EACnC,cAAc,EACd,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CACnE,CAAC;YACF,IAAI,GAAG,CAAC,QAAQ,KAAK,eAAe,EAAE,CAAC;gBACrC,eAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,eAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;gBAC9C,gBAAgB,CAAC,IAAI,CAAC;oBACpB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,cAAc;oBACpB,mCAAmC;oBACnC,QAAQ,EAAE,GAAG,CAAC,QAAS;iBACxB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,MAAM,IAAA,yBAAiB,EAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["// TODO: types (#22198)\nimport is from '@sindresorhus/is';\nimport deepmerge from 'deepmerge';\nimport upath from 'upath';\nimport { logger } from '../../../../logger';\nimport { ExternalHostError } from '../../../../types/errors/external-host-error';\nimport { getChildProcessEnv } from '../../../../util/exec/env';\nimport {\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../../util/fs';\nimport { getFile, getRepoStatus } from '../../../../util/git';\nimport type { FileChange } from '../../../../util/git/types';\nimport * as hostRules from '../../../../util/host-rules';\nimport { newlineRegex, regEx } from '../../../../util/regex';\nimport { ensureTrailingSlash } from '../../../../util/url';\nimport { dump, parseSingleYaml } from '../../../../util/yaml';\nimport { NpmDatasource } from '../../../datasource/npm';\nimport { scm } from '../../../platform/scm';\nimport type { PackageFile, PostUpdateConfig, Upgrade } from '../../types';\nimport { getZeroInstallPaths } from '../extract/yarn';\nimport type { NpmManagerData } from '../types';\nimport {\n composeLockFile,\n getNpmrcContent,\n parseLockFile,\n resetNpmrcContent,\n updateNpmrcContent,\n} from '../utils';\nimport * as npm from './npm';\nimport * as pnpm from './pnpm';\nimport { processHostRules } from './rules';\nimport type {\n AdditionalPackageFiles,\n ArtifactError,\n DetermineLockFileDirsResult,\n WriteExistingFilesResult,\n YarnRcYmlFile,\n} from './types';\nimport * as yarn from './yarn';\n\n// Strips empty values, deduplicates, and returns the directories from filenames\nconst getDirs = (arr: (string | null | undefined)[]): string[] =>\n Array.from(new Set(arr.filter(is.string)));\n\nexport function determineLockFileDirs(\n config: PostUpdateConfig,\n packageFiles: AdditionalPackageFiles,\n): DetermineLockFileDirsResult {\n const npmLockDirs: (string | undefined)[] = [];\n const yarnLockDirs: (string | undefined)[] = [];\n const pnpmShrinkwrapDirs: (string | undefined)[] = [];\n\n for (const upgrade of config.upgrades) {\n if (\n upgrade.updateType === 'lockFileMaintenance' ||\n upgrade.isRemediation === true ||\n upgrade.isLockfileUpdate === true\n ) {\n yarnLockDirs.push(upgrade.managerData?.yarnLock);\n npmLockDirs.push(upgrade.managerData?.npmLock);\n pnpmShrinkwrapDirs.push(upgrade.managerData?.pnpmShrinkwrap);\n }\n }\n\n if (\n config.upgrades.every(\n (upgrade: Upgrade) =>\n upgrade.updateType === 'lockFileMaintenance' ||\n upgrade.isLockfileUpdate,\n )\n ) {\n return {\n yarnLockDirs: getDirs(yarnLockDirs),\n npmLockDirs: getDirs(npmLockDirs),\n pnpmShrinkwrapDirs: getDirs(pnpmShrinkwrapDirs),\n };\n }\n\n function getPackageFile(\n fileName: string,\n ): Partial<PackageFile<NpmManagerData>> {\n logger.trace('Looking for packageFile: ' + fileName);\n\n for (const packageFile of packageFiles.npm!) {\n if (packageFile.packageFile === fileName) {\n logger.trace({ packageFile }, 'Found packageFile');\n return packageFile;\n }\n logger.trace('No match');\n }\n return {};\n }\n\n // TODO #22198\n for (const p of config.updatedPackageFiles!) {\n logger.trace(`Checking ${String(p.path)} for lock files`);\n const packageFile = getPackageFile(p.path);\n // istanbul ignore if\n if (!packageFile.managerData) {\n continue;\n }\n // push full lock file names and convert them later\n yarnLockDirs.push(packageFile.managerData.yarnLock);\n npmLockDirs.push(packageFile.managerData.npmLock);\n pnpmShrinkwrapDirs.push(packageFile.managerData.pnpmShrinkwrap);\n }\n\n return {\n yarnLockDirs: getDirs(yarnLockDirs),\n npmLockDirs: getDirs(npmLockDirs),\n pnpmShrinkwrapDirs: getDirs(pnpmShrinkwrapDirs),\n };\n}\n\nexport async function writeExistingFiles(\n config: PostUpdateConfig,\n packageFiles: AdditionalPackageFiles,\n): Promise<void> {\n if (!packageFiles.npm) {\n return;\n }\n const npmFiles = packageFiles.npm;\n logger.debug(\n { packageFiles: npmFiles.map((n) => n.packageFile) },\n 'Writing package.json files',\n );\n for (const packageFile of npmFiles) {\n // istanbul ignore if\n if (!packageFile.managerData) {\n continue;\n }\n // TODO #22198\n const basedir = upath.dirname(packageFile.packageFile!);\n const npmrc = packageFile.npmrc;\n const npmrcFilename = upath.join(basedir, '.npmrc');\n if (is.string(npmrc)) {\n try {\n await writeLocalFile(npmrcFilename, npmrc.replace(/\\n?$/, '\\n'));\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ npmrcFilename, err }, 'Error writing .npmrc');\n }\n }\n const npmLock = packageFile.managerData.npmLock;\n if (npmLock) {\n const npmLockPath = npmLock;\n logger.debug(`Writing ${npmLock}`);\n let existingNpmLock: string;\n try {\n existingNpmLock = (await getFile(npmLock)) ?? '';\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ err }, 'Error reading npm lock file');\n existingNpmLock = '';\n }\n const { detectedIndent, lockFileParsed: npmLockParsed } =\n parseLockFile(existingNpmLock);\n if (npmLockParsed) {\n const packageNames =\n 'packages' in npmLockParsed\n ? Object.keys(npmLockParsed.packages)\n : [];\n const widens: string[] = [];\n let lockFileChanged = false;\n for (const upgrade of config.upgrades) {\n if (upgrade.lockFiles && !upgrade.lockFiles.includes(npmLock)) {\n continue;\n }\n if (!upgrade.managerData) {\n continue;\n }\n if (\n upgrade.rangeStrategy === 'widen' &&\n upgrade.managerData.npmLock === npmLock\n ) {\n // TODO #22198\n widens.push(upgrade.depName!);\n }\n const { depName } = upgrade;\n for (const packageName of packageNames) {\n if (\n 'packages' in npmLockParsed &&\n (packageName === `node_modules/${depName}` ||\n packageName.startsWith(`node_modules/${depName}/`))\n ) {\n logger.trace({ packageName }, 'Massaging out package name');\n lockFileChanged = true;\n delete npmLockParsed.packages[packageName];\n }\n }\n }\n if (widens.length) {\n logger.debug(\n `Removing ${String(widens)} from ${npmLock} to force an update`,\n );\n lockFileChanged = true;\n try {\n if ('dependencies' in npmLockParsed && npmLockParsed.dependencies) {\n widens.forEach((depName) => {\n // TODO #22198\n delete npmLockParsed.dependencies![depName];\n });\n }\n } catch /* istanbul ignore next */ {\n logger.warn(\n { npmLock },\n 'Error massaging package-lock.json for widen',\n );\n }\n }\n if (lockFileChanged) {\n logger.debug('Massaging npm lock file before writing to disk');\n existingNpmLock = composeLockFile(npmLockParsed, detectedIndent);\n }\n await writeLocalFile(npmLockPath, existingNpmLock);\n }\n }\n }\n}\n\nexport async function writeUpdatedPackageFiles(\n config: PostUpdateConfig,\n): Promise<void> {\n logger.trace({ config }, 'writeUpdatedPackageFiles');\n logger.debug('Writing any updated package files');\n if (!config.updatedPackageFiles) {\n logger.debug('No files found');\n return;\n }\n const supportedLockFiles = ['package-lock.json', 'yarn.lock'];\n for (const packageFile of config.updatedPackageFiles) {\n if (packageFile.type !== 'addition') {\n continue;\n }\n if (\n supportedLockFiles.some((fileName) => packageFile.path.endsWith(fileName))\n ) {\n logger.debug(`Writing lock file: ${packageFile.path}`);\n // TODO #22198\n\n await writeLocalFile(packageFile.path, packageFile.contents!);\n continue;\n }\n if (!packageFile.path.endsWith('package.json')) {\n continue;\n }\n logger.debug(`Writing ${packageFile.path}`);\n await writeLocalFile(packageFile.path, packageFile.contents!);\n }\n}\n\n// istanbul ignore next\nasync function updateYarnOffline(\n lockFileDir: string,\n updatedArtifacts: FileChange[],\n): Promise<void> {\n try {\n const resolvedPaths: string[] = [];\n const yarnrcYml = await getFile(upath.join(lockFileDir, '.yarnrc.yml'));\n const yarnrc = await getFile(upath.join(lockFileDir, '.yarnrc'));\n\n // As .yarnrc.yml overrides .yarnrc in Yarn 1 (https://git.io/JUcco)\n // both files may exist, so check for .yarnrc.yml first\n if (yarnrcYml) {\n // Yarn 2 (offline cache and zero-installs)\n const paths = getZeroInstallPaths(yarnrcYml);\n resolvedPaths.push(...paths.map((p) => upath.join(lockFileDir, p)));\n } else if (yarnrc) {\n // Yarn 1 (offline mirror)\n const mirrorLine = yarnrc\n .split(newlineRegex)\n .find((line) => line.startsWith('yarn-offline-mirror '));\n if (mirrorLine) {\n const mirrorPath = ensureTrailingSlash(\n mirrorLine.split(' ')[1].replace(regEx(/\"/g), ''),\n );\n resolvedPaths.push(upath.join(lockFileDir, mirrorPath));\n }\n }\n logger.debug({ resolvedPaths }, 'updateYarnOffline resolvedPaths');\n\n if (resolvedPaths.length) {\n const status = await getRepoStatus();\n for (const f of status.modified.concat(status.not_added)) {\n if (resolvedPaths.some((p) => f.startsWith(p))) {\n updatedArtifacts.push({\n type: 'addition',\n path: f,\n contents: await readLocalFile(f),\n });\n }\n }\n for (const f of status.deleted || []) {\n if (resolvedPaths.some((p) => f.startsWith(p))) {\n updatedArtifacts.push({ type: 'deletion', path: f });\n }\n }\n }\n } catch (err) {\n logger.error({ err }, 'Error updating yarn offline packages');\n }\n}\n\n// TODO: move to ./yarn.ts\n// exported for testing\nexport async function updateYarnBinary(\n lockFileDir: string,\n updatedArtifacts: FileChange[],\n existingYarnrcYmlContent: string | undefined | null,\n): Promise<string | undefined | null> {\n let yarnrcYml = existingYarnrcYmlContent;\n try {\n const yarnrcYmlFilename = upath.join(lockFileDir, '.yarnrc.yml');\n yarnrcYml ??= (await getFile(yarnrcYmlFilename)) ?? undefined;\n const newYarnrcYml = await readLocalFile(yarnrcYmlFilename, 'utf8');\n if (!is.string(yarnrcYml) || !is.string(newYarnrcYml)) {\n return existingYarnrcYmlContent;\n }\n\n // TODO: use schema (#9610)\n const oldYarnPath = parseSingleYaml<YarnRcYmlFile>(yarnrcYml)?.yarnPath;\n const newYarnPath = parseSingleYaml<YarnRcYmlFile>(newYarnrcYml)?.yarnPath;\n if (\n !is.nonEmptyStringAndNotWhitespace(oldYarnPath) ||\n !is.nonEmptyStringAndNotWhitespace(newYarnPath)\n ) {\n return existingYarnrcYmlContent;\n }\n\n const oldYarnFullPath = upath.join(lockFileDir, oldYarnPath);\n const newYarnFullPath = upath.join(lockFileDir, newYarnPath);\n logger.debug({ oldYarnPath, newYarnPath }, 'Found updated Yarn binary');\n\n yarnrcYml = yarnrcYml.replace(oldYarnPath, newYarnPath);\n updatedArtifacts.push(\n {\n type: 'addition',\n path: yarnrcYmlFilename,\n contents: yarnrcYml,\n },\n {\n type: 'deletion',\n path: oldYarnFullPath,\n },\n {\n type: 'addition',\n path: newYarnFullPath,\n contents: await readLocalFile(newYarnFullPath, 'utf8'),\n isExecutable: true,\n },\n );\n } catch (err) /* istanbul ignore next */ {\n logger.error({ err }, 'Error updating Yarn binary');\n }\n return existingYarnrcYmlContent && yarnrcYml;\n}\n\nexport async function getAdditionalFiles(\n config: PostUpdateConfig<NpmManagerData>,\n packageFiles: AdditionalPackageFiles,\n): Promise<WriteExistingFilesResult> {\n logger.trace({ config }, 'getAdditionalFiles');\n const artifactErrors: ArtifactError[] = [];\n const updatedArtifacts: FileChange[] = [];\n if (!packageFiles.npm?.length) {\n return { artifactErrors, updatedArtifacts };\n }\n if (!config.updateLockFiles) {\n logger.debug('Skipping lock file generation');\n return { artifactErrors, updatedArtifacts };\n }\n if (\n config.reuseExistingBranch &&\n !config.updatedPackageFiles?.length &&\n config.upgrades?.every((upgrade) => upgrade.isLockfileUpdate)\n ) {\n logger.debug('Existing branch contains all necessary lock file updates');\n return { artifactErrors, updatedArtifacts };\n }\n logger.debug('Getting updated lock files');\n if (\n config.updateType === 'lockFileMaintenance' &&\n config.reuseExistingBranch &&\n (await scm.branchExists(config.branchName))\n ) {\n logger.debug('Skipping lockFileMaintenance update');\n return { artifactErrors, updatedArtifacts };\n }\n const dirs = determineLockFileDirs(config, packageFiles);\n logger.trace({ dirs }, 'lock file dirs');\n await writeExistingFiles(config, packageFiles);\n await writeUpdatedPackageFiles(config);\n\n const { additionalNpmrcContent, additionalYarnRcYml } = processHostRules();\n\n const env = {\n ...getChildProcessEnv(),\n NPM_CONFIG_CACHE: await ensureCacheDir('npm'),\n YARN_CACHE_FOLDER: await ensureCacheDir('yarn'),\n YARN_GLOBAL_FOLDER: await ensureCacheDir('berry'),\n npm_config_store: await ensureCacheDir('pnpm'),\n NODE_ENV: 'dev',\n };\n\n let token: string | undefined;\n try {\n ({ token } = hostRules.find({\n hostType: 'github',\n url: 'https://api.github.com/',\n }));\n token = token ? /* istanbul ignore next */ `${token}@` : token;\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ err }, 'Error getting token for packageFile');\n }\n const tokenRe = regEx(`${token ?? ''}`, 'g', false);\n for (const npmLock of dirs.npmLockDirs) {\n const lockFileDir = upath.dirname(npmLock);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n const fileName = upath.basename(npmLock);\n logger.debug(`Generating ${fileName} for ${lockFileDir}`);\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.npmLock === npmLock,\n );\n const res = await npm.generateLockFile(\n lockFileDir,\n env,\n fileName,\n config,\n upgrades,\n );\n if (res.error) {\n // istanbul ignore if\n if (res.stderr?.includes('No matching version found for')) {\n for (const upgrade of config.upgrades) {\n if (\n res.stderr.includes(\n `No matching version found for ${upgrade.depName}`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'npm' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n const err = new Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(err, NpmDatasource.id);\n }\n }\n }\n artifactErrors.push({\n lockFile: npmLock,\n stderr: res.stderr,\n });\n } else if (res.lockFile) {\n const existingContent = await getFile(\n npmLock,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(`${npmLock} hasn't changed`);\n } else {\n logger.debug(`${npmLock} needs updating`);\n updatedArtifacts.push({\n type: 'addition',\n path: npmLock,\n // TODO: can this be undefined? (#22198)\n\n contents: res.lockFile.replace(tokenRe, ''),\n });\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n }\n\n for (const yarnLock of dirs.yarnLockDirs) {\n const lockFileDir = upath.dirname(yarnLock);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n let yarnRcYmlFilename: string | undefined;\n let existingYarnrcYmlContent: string | undefined | null;\n if (additionalYarnRcYml) {\n yarnRcYmlFilename = getSiblingFileName(yarnLock, '.yarnrc.yml');\n existingYarnrcYmlContent = await readLocalFile(yarnRcYmlFilename, 'utf8');\n if (existingYarnrcYmlContent) {\n try {\n // TODO: use schema (#9610)\n const existingYarnrRcYml = parseSingleYaml<Record<string, unknown>>(\n existingYarnrcYmlContent,\n );\n\n const updatedYarnYrcYml = deepmerge(\n existingYarnrRcYml,\n yarn.fuzzyMatchAdditionalYarnrcYml(\n additionalYarnRcYml,\n existingYarnrRcYml,\n ),\n );\n\n await writeLocalFile(yarnRcYmlFilename, dump(updatedYarnYrcYml));\n logger.debug('Added authentication to .yarnrc.yml');\n } catch (err) {\n logger.warn({ err }, 'Error appending .yarnrc.yml content');\n }\n }\n }\n logger.debug(`Generating yarn.lock for ${lockFileDir}`);\n const lockFileName = upath.join(lockFileDir, 'yarn.lock');\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.yarnLock === yarnLock,\n );\n const res = await yarn.generateLockFile(lockFileDir, env, config, upgrades);\n if (res.error) {\n // istanbul ignore if\n if (res.stderr?.includes(`Couldn't find any versions for`)) {\n for (const upgrade of config.upgrades) {\n /* eslint-disable no-useless-escape */\n if (\n res.stderr.includes(\n `Couldn't find any versions for \\\\\\\"${upgrade.depName}\\\\\\\"`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'yarn' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(\n new Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n ),\n NpmDatasource.id,\n );\n }\n /* eslint-enable no-useless-escape */\n }\n }\n artifactErrors.push({\n lockFile: yarnLock,\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n stderr: res.stderr || res.stdout,\n });\n } else {\n const existingContent = await getFile(\n lockFileName,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(\"yarn.lock hasn't changed\");\n } else {\n logger.debug('yarn.lock needs updating');\n updatedArtifacts.push({\n type: 'addition',\n path: lockFileName,\n // TODO #22198\n contents: res.lockFile!,\n });\n await updateYarnOffline(lockFileDir, updatedArtifacts);\n }\n\n // istanbul ignore if: already tested seperately, needs additional test?\n if (upgrades.some(yarn.isYarnUpdate)) {\n existingYarnrcYmlContent = await updateYarnBinary(\n lockFileDir,\n updatedArtifacts,\n existingYarnrcYmlContent,\n );\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n // istanbul ignore if: needs test\n if (existingYarnrcYmlContent) {\n // TODO #22198\n await writeLocalFile(yarnRcYmlFilename!, existingYarnrcYmlContent);\n }\n }\n\n for (const pnpmShrinkwrap of dirs.pnpmShrinkwrapDirs) {\n const lockFileDir = upath.dirname(pnpmShrinkwrap);\n const npmrcContent = await getNpmrcContent(lockFileDir);\n await updateNpmrcContent(lockFileDir, npmrcContent, additionalNpmrcContent);\n logger.debug(`Generating pnpm-lock.yaml for ${lockFileDir}`);\n const upgrades = config.upgrades.filter(\n (upgrade) => upgrade.managerData?.pnpmShrinkwrap === pnpmShrinkwrap,\n );\n const res = await pnpm.generateLockFile(lockFileDir, env, config, upgrades);\n if (res.error) {\n // istanbul ignore if\n if (res.stdout?.includes(`No compatible version found:`)) {\n for (const upgrade of config.upgrades) {\n if (\n res.stdout.includes(\n `No compatible version found: ${upgrade.depName}`,\n )\n ) {\n logger.debug(\n { dependency: upgrade.depName, type: 'pnpm' },\n 'lock file failed for the dependency being updated - skipping branch creation',\n );\n throw new ExternalHostError(\n Error(\n 'lock file failed for the dependency being updated - skipping branch creation',\n ),\n NpmDatasource.id,\n );\n }\n }\n }\n artifactErrors.push({\n lockFile: pnpmShrinkwrap,\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n stderr: res.stderr || res.stdout,\n });\n } else {\n const existingContent = await getFile(\n pnpmShrinkwrap,\n config.reuseExistingBranch ? config.branchName : config.baseBranch,\n );\n if (res.lockFile === existingContent) {\n logger.debug(\"pnpm-lock.yaml hasn't changed\");\n } else {\n logger.debug('pnpm-lock.yaml needs updating');\n updatedArtifacts.push({\n type: 'addition',\n path: pnpmShrinkwrap,\n // TODO: can be undefined? (#22198)\n contents: res.lockFile!,\n });\n }\n }\n await resetNpmrcContent(lockFileDir, npmrcContent);\n }\n\n return { artifactErrors, updatedArtifacts };\n}\n"]}
|
@@ -9,6 +9,7 @@ const composer = tslib_1.__importStar(require("./composer"));
|
|
9
9
|
const conan = tslib_1.__importStar(require("./conan"));
|
10
10
|
const deb = tslib_1.__importStar(require("./deb"));
|
11
11
|
const debian = tslib_1.__importStar(require("./debian"));
|
12
|
+
const devbox = tslib_1.__importStar(require("./devbox"));
|
12
13
|
const docker = tslib_1.__importStar(require("./docker"));
|
13
14
|
const git = tslib_1.__importStar(require("./git"));
|
14
15
|
const glasskube = tslib_1.__importStar(require("./glasskube"));
|
@@ -52,6 +53,7 @@ api.set(composer.id, composer.api);
|
|
52
53
|
api.set(conan.id, conan.api);
|
53
54
|
api.set(deb.id, deb.api);
|
54
55
|
api.set(debian.id, debian.api);
|
56
|
+
api.set(devbox.id, devbox.api);
|
55
57
|
api.set(docker.id, docker.api);
|
56
58
|
api.set(git.id, git.api);
|
57
59
|
api.set(glasskube.id, glasskube.api);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../lib/modules/versioning/api.ts"],"names":[],"mappings":";;;AAAA,gFAA0D;AAC1D,uEAAiD;AACjD,oEAA8C;AAC9C,uDAAiC;AACjC,6DAAuC;AACvC,uDAAiC;AACjC,mDAA6B;AAC7B,yDAAmC;AACnC,yDAAmC;AACnC,mDAA6B;AAC7B,+DAAyC;AACzC,2EAAqD;AACrD,yDAAmC;AACnC,+DAAyC;AACzC,qDAA+B;AAC/B,yDAAmC;AACnC,mDAA6B;AAC7B,mDAA6B;AAC7B,wEAAkD;AAClD,uDAAiC;AACjC,uDAAiC;AACjC,2DAAqC;AACrC,qDAA+B;AAC/B,mDAA6B;AAC7B,uDAAiC;AACjC,yDAAmC;AACnC,qDAA+B;AAC/B,yDAAmC;AACnC,mDAA6B;AAC7B,yDAAmC;AACnC,yDAAmC;AACnC,uDAAiC;AACjC,mDAA6B;AAC7B,mDAA6B;AAC7B,qDAA+B;AAC/B,gEAA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azure-rest-api';\nimport * as bazelModule from './bazel-module';\nimport * as cargo from './cargo';\nimport * as composer from './composer';\nimport * as conan from './conan';\nimport * as deb from './deb';\nimport * as debian from './debian';\nimport * as docker from './docker';\nimport * as git from './git';\nimport * as glasskube from './glasskube';\nimport * as goModDirective from './go-mod-directive';\nimport * as gradle from './gradle';\nimport * as hashicorp from './hashicorp';\nimport * as helm from './helm';\nimport * as hermit from './hermit';\nimport * as hex from './hex';\nimport * as ivy from './ivy';\nimport * as kubernetesApi from './kubernetes-api';\nimport * as loose from './loose';\nimport * as maven from './maven';\nimport * as nixpkgs from './nixpkgs';\nimport * as node from './node';\nimport * as npm from './npm';\nimport * as nuget from './nuget';\nimport * as pep440 from './pep440';\nimport * as perl from './perl';\nimport * as poetry from './poetry';\nimport * as pvp from './pvp';\nimport * as python from './python';\nimport * as redhat from './redhat';\nimport * as regex from './regex';\nimport * as rez from './rez';\nimport * as rpm from './rpm';\nimport * as ruby from './ruby';\nimport * as sameMajor from './same-major';\nimport * as semver from './semver';\nimport * as semverCoerced from './semver-coerced';\nimport * as swift from './swift';\nimport type { VersioningApi, VersioningApiConstructor } from './types';\nimport * as ubuntu from './ubuntu';\nimport * as unity3d from './unity3d';\n\nconst api = new Map<string, VersioningApi | VersioningApiConstructor>();\nexport default api;\n\napi.set(amazonMachineImage.id, amazonMachineImage.api);\napi.set(azureRestApi.id, azureRestApi.api);\napi.set(bazelModule.id, bazelModule.api);\napi.set(cargo.id, cargo.api);\napi.set(composer.id, composer.api);\napi.set(conan.id, conan.api);\napi.set(deb.id, deb.api);\napi.set(debian.id, debian.api);\napi.set(docker.id, docker.api);\napi.set(git.id, git.api);\napi.set(glasskube.id, glasskube.api);\napi.set(goModDirective.id, goModDirective.api);\napi.set(gradle.id, gradle.api);\napi.set(hashicorp.id, hashicorp.api);\napi.set(helm.id, helm.api);\napi.set(hermit.id, hermit.api);\napi.set(hex.id, hex.api);\napi.set(ivy.id, ivy.api);\napi.set(kubernetesApi.id, kubernetesApi.api);\napi.set(loose.id, loose.api);\napi.set(maven.id, maven.api);\napi.set(nixpkgs.id, nixpkgs.api);\napi.set(node.id, node.api);\napi.set(npm.id, npm.api);\napi.set(nuget.id, nuget.api);\napi.set(pep440.id, pep440.api);\napi.set(perl.id, perl.api);\napi.set(poetry.id, poetry.api);\napi.set(pvp.id, pvp.api);\napi.set(python.id, python.api);\napi.set(redhat.id, redhat.api);\napi.set(regex.id, regex.api);\napi.set(rez.id, rez.api);\napi.set(rpm.id, rpm.api);\napi.set(ruby.id, ruby.api);\napi.set(sameMajor.id, sameMajor.api);\napi.set(semver.id, semver.api);\napi.set(semverCoerced.id, semverCoerced.api);\napi.set(swift.id, swift.api);\napi.set(ubuntu.id, ubuntu.api);\napi.set(unity3d.id, unity3d.api);\n"]}
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../lib/modules/versioning/api.ts"],"names":[],"mappings":";;;AAAA,gFAA0D;AAC1D,uEAAiD;AACjD,oEAA8C;AAC9C,uDAAiC;AACjC,6DAAuC;AACvC,uDAAiC;AACjC,mDAA6B;AAC7B,yDAAmC;AACnC,yDAAmC;AACnC,yDAAmC;AACnC,mDAA6B;AAC7B,+DAAyC;AACzC,2EAAqD;AACrD,yDAAmC;AACnC,+DAAyC;AACzC,qDAA+B;AAC/B,yDAAmC;AACnC,mDAA6B;AAC7B,mDAA6B;AAC7B,wEAAkD;AAClD,uDAAiC;AACjC,uDAAiC;AACjC,2DAAqC;AACrC,qDAA+B;AAC/B,mDAA6B;AAC7B,uDAAiC;AACjC,yDAAmC;AACnC,qDAA+B;AAC/B,yDAAmC;AACnC,mDAA6B;AAC7B,yDAAmC;AACnC,yDAAmC;AACnC,uDAAiC;AACjC,mDAA6B;AAC7B,mDAA6B;AAC7B,qDAA+B;AAC/B,gEAA0C;AAC1C,yDAAmC;AACnC,wEAAkD;AAClD,uDAAiC;AAEjC,yDAAmC;AACnC,2DAAqC;AAErC,MAAM,GAAG,GAAG,IAAI,GAAG,EAA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EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/B,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;AACzB,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/B,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/B,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7B,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;AACzB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;AACzB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;AACrC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/B,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;AAC7C,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7B,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/B,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC","sourcesContent":["import * as amazonMachineImage from './aws-machine-image';\nimport * as azureRestApi from './azure-rest-api';\nimport * as bazelModule from './bazel-module';\nimport * as cargo from './cargo';\nimport * as composer from './composer';\nimport * as conan from './conan';\nimport * as deb from './deb';\nimport * as debian from './debian';\nimport * as devbox from './devbox';\nimport * as docker from './docker';\nimport * as git from './git';\nimport * as glasskube from './glasskube';\nimport * as goModDirective from './go-mod-directive';\nimport * as gradle from './gradle';\nimport * as hashicorp from './hashicorp';\nimport * as helm from './helm';\nimport * as hermit from './hermit';\nimport * as hex from './hex';\nimport * as ivy from './ivy';\nimport * as kubernetesApi from './kubernetes-api';\nimport * as loose from './loose';\nimport * as maven from './maven';\nimport * as nixpkgs from './nixpkgs';\nimport * as node from './node';\nimport * as npm from './npm';\nimport * as nuget from './nuget';\nimport * as pep440 from './pep440';\nimport * as perl from './perl';\nimport * as poetry from './poetry';\nimport * as pvp from './pvp';\nimport * as python from './python';\nimport * as redhat from './redhat';\nimport * as regex from './regex';\nimport * as rez from './rez';\nimport * as rpm from './rpm';\nimport * as ruby from './ruby';\nimport * as sameMajor from './same-major';\nimport * as semver from './semver';\nimport * as semverCoerced from './semver-coerced';\nimport * as swift from './swift';\nimport type { VersioningApi, VersioningApiConstructor } from './types';\nimport * as ubuntu from './ubuntu';\nimport * as unity3d from './unity3d';\n\nconst api = new Map<string, VersioningApi | VersioningApiConstructor>();\nexport default api;\n\napi.set(amazonMachineImage.id, amazonMachineImage.api);\napi.set(azureRestApi.id, azureRestApi.api);\napi.set(bazelModule.id, bazelModule.api);\napi.set(cargo.id, cargo.api);\napi.set(composer.id, composer.api);\napi.set(conan.id, conan.api);\napi.set(deb.id, deb.api);\napi.set(debian.id, debian.api);\napi.set(devbox.id, devbox.api);\napi.set(docker.id, docker.api);\napi.set(git.id, git.api);\napi.set(glasskube.id, glasskube.api);\napi.set(goModDirective.id, goModDirective.api);\napi.set(gradle.id, gradle.api);\napi.set(hashicorp.id, hashicorp.api);\napi.set(helm.id, helm.api);\napi.set(hermit.id, hermit.api);\napi.set(hex.id, hex.api);\napi.set(ivy.id, ivy.api);\napi.set(kubernetesApi.id, kubernetesApi.api);\napi.set(loose.id, loose.api);\napi.set(maven.id, maven.api);\napi.set(nixpkgs.id, nixpkgs.api);\napi.set(node.id, node.api);\napi.set(npm.id, npm.api);\napi.set(nuget.id, nuget.api);\napi.set(pep440.id, pep440.api);\napi.set(perl.id, perl.api);\napi.set(poetry.id, poetry.api);\napi.set(pvp.id, pvp.api);\napi.set(python.id, python.api);\napi.set(redhat.id, redhat.api);\napi.set(regex.id, regex.api);\napi.set(rez.id, rez.api);\napi.set(rpm.id, rpm.api);\napi.set(ruby.id, ruby.api);\napi.set(sameMajor.id, sameMajor.api);\napi.set(semver.id, semver.api);\napi.set(semverCoerced.id, semverCoerced.api);\napi.set(swift.id, swift.api);\napi.set(ubuntu.id, ubuntu.api);\napi.set(unity3d.id, unity3d.api);\n"]}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { VersioningApi } from '../types';
|
2
|
+
export declare const id = "devbox";
|
3
|
+
export declare const displayName = "devbox";
|
4
|
+
export declare const urls: never[];
|
5
|
+
export declare const supportsRanges = false;
|
6
|
+
export declare const api: VersioningApi;
|
7
|
+
export default api;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.api = exports.supportsRanges = exports.urls = exports.displayName = exports.id = void 0;
|
4
|
+
const regex_1 = require("../../../util/regex");
|
5
|
+
const generic_1 = require("../generic");
|
6
|
+
exports.id = 'devbox';
|
7
|
+
exports.displayName = 'devbox';
|
8
|
+
exports.urls = [];
|
9
|
+
exports.supportsRanges = false;
|
10
|
+
const validPattern = (0, regex_1.regEx)(/^((\d|[1-9]\d*)(\.(\d|[1-9]\d*)){0,2})$/);
|
11
|
+
const versionPattern = (0, regex_1.regEx)(/^((\d|[1-9]\d*)(\.(\d|[1-9]\d*)){2})$/);
|
12
|
+
class DevboxVersioningApi extends generic_1.GenericVersioningApi {
|
13
|
+
_parse(version) {
|
14
|
+
const matches = validPattern.exec(version);
|
15
|
+
if (!matches) {
|
16
|
+
return null;
|
17
|
+
}
|
18
|
+
const release = matches[0].split('.').map(Number);
|
19
|
+
return { release };
|
20
|
+
}
|
21
|
+
isValid(version) {
|
22
|
+
if (version === 'latest') {
|
23
|
+
return true;
|
24
|
+
}
|
25
|
+
return this._parse(version) !== null;
|
26
|
+
}
|
27
|
+
isVersion(version) {
|
28
|
+
if (version === 'latest') {
|
29
|
+
return false;
|
30
|
+
}
|
31
|
+
const matches = versionPattern.exec(version);
|
32
|
+
return !!matches;
|
33
|
+
}
|
34
|
+
matches(version, range) {
|
35
|
+
return this.isVersion(version) && this.equals(version, range);
|
36
|
+
}
|
37
|
+
_compare(version, other) {
|
38
|
+
const parsed1 = this._parse(version);
|
39
|
+
const parsed2 = this._parse(other);
|
40
|
+
// Treat "latest" as * and always return equal
|
41
|
+
if (other === 'latest' && parsed1) {
|
42
|
+
return 0;
|
43
|
+
}
|
44
|
+
// If either version is invalid, return unequal
|
45
|
+
if (!(parsed1 && parsed2)) {
|
46
|
+
return 1;
|
47
|
+
}
|
48
|
+
// support variable length compare
|
49
|
+
const length = Math.max(parsed1.release.length, parsed2.release.length);
|
50
|
+
for (let i = 0; i < length; i += 1) {
|
51
|
+
// 2.1 and 2.1.0 are equivalent
|
52
|
+
const part1 = parsed1.release[i];
|
53
|
+
const part2 = parsed2.release[i];
|
54
|
+
// if part1 or part2 is undefined, we should treat them as equal
|
55
|
+
// e.g. 1.0.0 === 1.0
|
56
|
+
if (part1 !== undefined && part2 !== undefined && part1 !== part2) {
|
57
|
+
return part1 - part2;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return 0;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
exports.api = new DevboxVersioningApi();
|
64
|
+
exports.default = exports.api;
|
65
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/devbox/index.ts"],"names":[],"mappings":";;;AAAA,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AAC,OAAe,EAAE,KAAa;QACxD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEnC,8CAA8C;QAC9C,IAAI,KAAK,KAAK,QAAQ,IAAI,OAAO,EAAE,CAAC;YAClC,OAAO,CAAC,CAAC;QACX,CAAC;QAED,+CAA+C;QAC/C,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC;YAC1B,OAAO,CAAC,CAAC;QACX,CAAC;QACD,kCAAkC;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACxE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,+BAA+B;YAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,gEAAgE;YAChE,qBAAqB;YACrB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;gBAClE,OAAO,KAAK,GAAG,KAAK,CAAC;YACvB,CAAC;QACH,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AAEY,QAAA,GAAG,GAAkB,IAAI,mBAAmB,EAAE,CAAC;AAE5D,kBAAe,WAAG,CAAC","sourcesContent":["import { regEx } from '../../../util/regex';\nimport type { GenericVersion } from '../generic';\nimport { GenericVersioningApi } from '../generic';\nimport type { VersioningApi } from '../types';\n\nexport const id = 'devbox';\nexport const displayName = 'devbox';\nexport const urls = [];\nexport const supportsRanges = false;\n\nconst validPattern = regEx(/^((\\d|[1-9]\\d*)(\\.(\\d|[1-9]\\d*)){0,2})$/);\nconst versionPattern = regEx(/^((\\d|[1-9]\\d*)(\\.(\\d|[1-9]\\d*)){2})$/);\n\nclass DevboxVersioningApi extends GenericVersioningApi {\n protected _parse(version: string): GenericVersion | null {\n const matches = validPattern.exec(version);\n if (!matches) {\n return null;\n }\n const release = matches[0].split('.').map(Number);\n return { release };\n }\n\n override isValid(version: string): boolean {\n if (version === 'latest') {\n return true;\n }\n return this._parse(version) !== null;\n }\n\n override isVersion(version: string): boolean {\n if (version === 'latest') {\n return false;\n }\n const matches = versionPattern.exec(version);\n return !!matches;\n }\n\n override matches(version: string, range: string): boolean {\n return this.isVersion(version) && this.equals(version, range);\n }\n\n protected override _compare(version: string, other: string): number {\n const parsed1 = this._parse(version);\n const parsed2 = this._parse(other);\n\n // Treat \"latest\" as * and always return equal\n if (other === 'latest' && parsed1) {\n return 0;\n }\n\n // If either version is invalid, return unequal\n if (!(parsed1 && parsed2)) {\n return 1;\n }\n // support variable length compare\n const length = Math.max(parsed1.release.length, parsed2.release.length);\n for (let i = 0; i < length; i += 1) {\n // 2.1 and 2.1.0 are equivalent\n const part1 = parsed1.release[i];\n const part2 = parsed2.release[i];\n // if part1 or part2 is undefined, we should treat them as equal\n // e.g. 1.0.0 === 1.0\n if (part1 !== undefined && part2 !== undefined && part1 !== part2) {\n return part1 - part2;\n }\n }\n return 0;\n }\n}\n\nexport const api: VersioningApi = new DevboxVersioningApi();\n\nexport default api;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../../lib/workers/global/config/parse/env.ts"],"names":[],"mappings":";;AA0BA,gCASC;AAmFD,8BA4HC;;AAlPD,kEAAkC;AAClC,0DAA0B;AAC1B,wDAAwD;AAExD,+CAA4C;AAC5C,2CAAwC;AAExC,iCAAkD;AAElD,SAAS,iBAAiB,CACxB,GAAsB,EACtB,MAA0B;IAE1B,MAAM,MAAM,GAAG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,CAAC,IAAI,CAAY,KAAK,MAAM,EAAE,CAAC;4BAC/C,eAAM,CAAC,IAAI,CACT,gEAAgE,CACjE,CAAC;4BACF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;wBAClC,CAAC;6BAAM,IAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAY,KAAK,OAAO,EAAE,CAAC;4BACvD,eAAM,CAAC,IAAI,CACT,iEAAiE,CAClE,CAAC;4BACF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;wBACnC,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,GAAG,CAAC,gBAAgB,EAAE,CAAC;QACzB,eAAM,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACpE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;YACpB,QAAQ,EAAE,QAAQ;YAClB,SAAS,EAAE,YAAY;YACvB,KAAK,EAAE,GAAG,CAAC,gBAAgB;SAC5B,CAAC,CAAC;IACL,CAAC;IAED,0EAA0E;IAC1E,MAAM,cAAc,GAAG;QACrB,iBAAiB;QACjB,oBAAoB;QACpB,oBAAoB;QACpB,iBAAiB;QACjB,cAAc;QACd,iBAAiB;QACjB,cAAc;QACd,eAAe;QACf,YAAY;KACb,CAAC;IAEF,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport JSON5 from 'json5';\nimport { getOptions } from '../../../../config/options';\nimport type { AllConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport { coersions } from './coersions';\nimport type { ParseConfigOptions } from './types';\nimport { migrateAndValidateConfig } from './util';\n\nfunction normalizePrefixes(\n env: NodeJS.ProcessEnv,\n prefix: string | undefined,\n): NodeJS.ProcessEnv {\n const result = { ...env };\n if (prefix) {\n for (const [key, val] of Object.entries(result)) {\n if (key.startsWith(prefix)) {\n const newKey = key.replace(prefix, 'RENOVATE_');\n result[newKey] = val;\n delete result[key];\n }\n }\n }\n return result;\n}\n\nexport function getEnvName(option: ParseConfigOptions): string {\n if (option.env === false) {\n return '';\n }\n if (option.env) {\n return option.env;\n }\n const nameWithUnderscores = option.name.replace(/([A-Z])/g, '_$1');\n return `RENOVATE_${nameWithUnderscores.toUpperCase()}`;\n}\n\nconst renameKeys = {\n aliases: 'registryAliases',\n azureAutoComplete: 'platformAutomerge', // migrate: azureAutoComplete\n gitLabAutomerge: 'platformAutomerge', // migrate: gitLabAutomerge\n mergeConfidenceApiBaseUrl: 'mergeConfidenceEndpoint',\n mergeConfidenceSupportedDatasources: 'mergeConfidenceDatasources',\n};\n\nfunction renameEnvKeys(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const [from, to] of Object.entries(renameKeys)) {\n const fromKey = getEnvName({ name: from });\n const toKey = getEnvName({ name: to });\n if (env[fromKey]) {\n result[toKey] = env[fromKey];\n delete result[fromKey];\n }\n }\n return result;\n}\n\nconst migratedKeysWithValues = [\n {\n oldName: 'recreateClosed',\n newName: 'recreateWhen',\n from: 'true',\n to: 'always',\n },\n {\n oldName: 'recreateClosed',\n newName: 'recreateWhen',\n from: 'false',\n to: 'auto',\n },\n];\n\nfunction massageEnvKeyValues(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const { oldName, newName, from, to } of migratedKeysWithValues) {\n const key = getEnvName({ name: oldName });\n if (env[key] !== undefined) {\n if (result[key] === from) {\n delete result[key];\n result[getEnvName({ name: newName })] = to;\n }\n }\n }\n return result;\n}\n\n// these experimental env vars have been converted into self-hosted config options\nconst convertedExperimentalEnvVars = [\n 'RENOVATE_X_AUTODISCOVER_REPO_SORT',\n 'RENOVATE_X_AUTODISCOVER_REPO_ORDER',\n 'RENOVATE_X_DOCKER_MAX_PAGES',\n 'RENOVATE_X_DELETE_CONFIG_FILE',\n 'RENOVATE_X_S3_ENDPOINT',\n 'RENOVATE_X_S3_PATH_STYLE',\n 'RENOVATE_X_MERGE_CONFIDENCE_API_BASE_URL',\n 'RENOVATE_X_MERGE_CONFIDENCE_SUPPORTED_DATASOURCES',\n];\n\n/**\n * Massages the experimental env vars which have been converted to config options\n *\n * e.g. RENOVATE_X_AUTODISCOVER_REPO_SORT -> RENOVATE_AUTODISCOVER_REPO_SORT\n */\nfunction massageConvertedExperimentalVars(\n env: NodeJS.ProcessEnv,\n): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const key of convertedExperimentalEnvVars) {\n if (env[key] !== undefined) {\n const newKey = key.replace('RENOVATE_X_', 'RENOVATE_');\n result[newKey] = env[key];\n delete result[key];\n }\n }\n return result;\n}\n\nexport async function getConfig(\n inputEnv: NodeJS.ProcessEnv,\n): Promise<AllConfig> {\n let env = inputEnv;\n env = normalizePrefixes(inputEnv, inputEnv.ENV_PREFIX);\n env = massageConvertedExperimentalVars(env);\n env = renameEnvKeys(env);\n // massage the values of migrated configuration keys\n env = massageEnvKeyValues(env);\n\n const options = getOptions();\n\n let config: AllConfig = {};\n\n if (env.RENOVATE_CONFIG) {\n try {\n config = JSON5.parse(env.RENOVATE_CONFIG);\n logger.debug({ config }, 'Detected config in env RENOVATE_CONFIG');\n\n config = await migrateAndValidateConfig(config, 'RENOVATE_CONFIG');\n } catch (err) {\n logger.fatal({ err }, 'Could not parse RENOVATE_CONFIG');\n process.exit(1);\n }\n }\n\n config.hostRules ||= [];\n\n options.forEach((option) => {\n if (option.env !== false) {\n const envName = getEnvName(option);\n const envVal = env[envName];\n if (envVal) {\n if (option.type === 'array' && option.subType === 'object') {\n try {\n const parsed = JSON5.parse(envVal);\n if (is.array(parsed)) {\n config[option.name] = parsed;\n } else {\n logger.debug(\n { val: envVal, envName },\n 'Could not parse object array',\n );\n }\n } catch {\n logger.debug(\n { val: envVal, envName },\n 'Could not parse environment variable',\n );\n }\n } else {\n const coerce = coersions[option.type];\n config[option.name] = coerce(envVal);\n if (option.name === 'dryRun') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config dryRun property has been changed to full',\n );\n config[option.name] = 'full';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config dryRun property has been changed to null',\n );\n delete config[option.name];\n } else if ((config[option.name] as string) === 'null') {\n delete config[option.name];\n }\n }\n if (option.name === 'requireConfig') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config requireConfig property has been changed to required',\n );\n config[option.name] = 'required';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config requireConfig property has been changed to optional',\n );\n config[option.name] = 'optional';\n }\n }\n if (option.name === 'platformCommit') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config platformCommit property has been changed to enabled',\n );\n config[option.name] = 'enabled';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config platformCommit property has been changed to disabled',\n );\n config[option.name] = 'disabled';\n }\n }\n }\n }\n }\n });\n\n if (env.GITHUB_COM_TOKEN) {\n logger.debug(`Converting GITHUB_COM_TOKEN into a global host rule`);\n config.hostRules.push({\n hostType: 'github',\n matchHost: 'github.com',\n token: env.GITHUB_COM_TOKEN,\n });\n }\n\n // These env vars are deprecated and deleted to make sure they're not used\n const unsupportedEnv = [\n 'BITBUCKET_TOKEN',\n 'BITBUCKET_USERNAME',\n 'BITBUCKET_PASSWORD',\n 'GITHUB_ENDPOINT',\n 'GITHUB_TOKEN',\n 'GITLAB_ENDPOINT',\n 'GITLAB_TOKEN',\n 'VSTS_ENDPOINT',\n 'VSTS_TOKEN',\n ];\n\n unsupportedEnv.forEach((val) => delete env[val]);\n\n return config;\n}\n"]}
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../../lib/workers/global/config/parse/env.ts"],"names":[],"mappings":";;AA0BA,gCASC;AAmFD,8BA4HC;;AA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AAC,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;wBACnC,CAAC;oBACH,CAAC;oBACD,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;wBACrC,IAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAY,KAAK,MAAM,EAAE,CAAC;4BAC/C,eAAM,CAAC,IAAI,CACT,gEAAgE,CACjE,CAAC;4BACF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;wBAClC,CAAC;6BAAM,IAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAY,KAAK,OAAO,EAAE,CAAC;4BACvD,eAAM,CAAC,IAAI,CACT,iEAAiE,CAClE,CAAC;4BACF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;wBACnC,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,GAAG,CAAC,gBAAgB,EAAE,CAAC;QACzB,eAAM,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACpE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;YACpB,QAAQ,EAAE,QAAQ;YAClB,SAAS,EAAE,YAAY;YACvB,KAAK,EAAE,GAAG,CAAC,gBAAgB;SAC5B,CAAC,CAAC;IACL,CAAC;IAED,0EAA0E;IAC1E,MAAM,cAAc,GAAG;QACrB,iBAAiB;QACjB,oBAAoB;QACpB,oBAAoB;QACpB,iBAAiB;QACjB,cAAc;QACd,iBAAiB;QACjB,cAAc;QACd,eAAe;QACf,YAAY;KACb,CAAC;IAEF,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport JSON5 from 'json5';\nimport { getOptions } from '../../../../config/options';\nimport type { AllConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport { coersions } from './coersions';\nimport type { ParseConfigOptions } from './types';\nimport { migrateAndValidateConfig } from './util';\n\nfunction normalizePrefixes(\n env: NodeJS.ProcessEnv,\n prefix: string | undefined,\n): NodeJS.ProcessEnv {\n const result = { ...env };\n if (prefix) {\n for (const [key, val] of Object.entries(result)) {\n if (key.startsWith(prefix)) {\n const newKey = key.replace(prefix, 'RENOVATE_');\n result[newKey] = val;\n delete result[key];\n }\n }\n }\n return result;\n}\n\nexport function getEnvName(option: ParseConfigOptions): string {\n if (option.env === false) {\n return '';\n }\n if (option.env) {\n return option.env;\n }\n const nameWithUnderscores = option.name.replace(/([A-Z])/g, '_$1');\n return `RENOVATE_${nameWithUnderscores.toUpperCase()}`;\n}\n\nconst renameKeys = {\n aliases: 'registryAliases',\n azureAutoComplete: 'platformAutomerge', // migrate: azureAutoComplete\n gitLabAutomerge: 'platformAutomerge', // migrate: gitLabAutomerge\n mergeConfidenceApiBaseUrl: 'mergeConfidenceEndpoint',\n mergeConfidenceSupportedDatasources: 'mergeConfidenceDatasources',\n};\n\nfunction renameEnvKeys(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const [from, to] of Object.entries(renameKeys)) {\n const fromKey = getEnvName({ name: from });\n const toKey = getEnvName({ name: to });\n if (env[fromKey]) {\n result[toKey] = env[fromKey];\n delete result[fromKey];\n }\n }\n return result;\n}\n\nconst migratedKeysWithValues = [\n {\n oldName: 'recreateClosed',\n newName: 'recreateWhen',\n from: 'true',\n to: 'always',\n },\n {\n oldName: 'recreateClosed',\n newName: 'recreateWhen',\n from: 'false',\n to: 'auto',\n },\n];\n\nfunction massageEnvKeyValues(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const { oldName, newName, from, to } of migratedKeysWithValues) {\n const key = getEnvName({ name: oldName });\n if (env[key] !== undefined) {\n if (result[key] === from) {\n delete result[key];\n result[getEnvName({ name: newName })] = to;\n }\n }\n }\n return result;\n}\n\n// these experimental env vars have been converted into self-hosted config options\nconst convertedExperimentalEnvVars = [\n 'RENOVATE_X_AUTODISCOVER_REPO_SORT',\n 'RENOVATE_X_AUTODISCOVER_REPO_ORDER',\n 'RENOVATE_X_DOCKER_MAX_PAGES',\n 'RENOVATE_X_DELETE_CONFIG_FILE',\n 'RENOVATE_X_S3_ENDPOINT',\n 'RENOVATE_X_S3_PATH_STYLE',\n 'RENOVATE_X_MERGE_CONFIDENCE_API_BASE_URL',\n 'RENOVATE_X_MERGE_CONFIDENCE_SUPPORTED_DATASOURCES',\n];\n\n/**\n * Massages the experimental env vars which have been converted to config options\n *\n * e.g. RENOVATE_X_AUTODISCOVER_REPO_SORT -> RENOVATE_AUTODISCOVER_REPO_SORT\n */\nfunction massageConvertedExperimentalVars(\n env: NodeJS.ProcessEnv,\n): NodeJS.ProcessEnv {\n const result = { ...env };\n for (const key of convertedExperimentalEnvVars) {\n if (env[key] !== undefined) {\n const newKey = key.replace('RENOVATE_X_', 'RENOVATE_');\n result[newKey] = env[key];\n delete result[key];\n }\n }\n return result;\n}\n\nexport async function getConfig(\n inputEnv: NodeJS.ProcessEnv,\n): Promise<AllConfig> {\n let env = inputEnv;\n env = normalizePrefixes(inputEnv, inputEnv.ENV_PREFIX);\n env = massageConvertedExperimentalVars(env);\n env = renameEnvKeys(env);\n // massage the values of migrated configuration keys\n env = massageEnvKeyValues(env);\n\n const options = getOptions();\n\n let config: AllConfig = {};\n\n if (env.RENOVATE_CONFIG) {\n try {\n config = JSON5.parse(env.RENOVATE_CONFIG);\n logger.debug({ config }, 'Detected config in env RENOVATE_CONFIG');\n\n config = await migrateAndValidateConfig(config, 'RENOVATE_CONFIG');\n } catch (err) {\n logger.fatal({ err }, 'Could not parse RENOVATE_CONFIG');\n process.exit(1);\n }\n }\n\n config.hostRules ??= [];\n\n options.forEach((option) => {\n if (option.env !== false) {\n const envName = getEnvName(option);\n const envVal = env[envName];\n if (envVal) {\n if (option.type === 'array' && option.subType === 'object') {\n try {\n const parsed = JSON5.parse(envVal);\n if (is.array(parsed)) {\n config[option.name] = parsed;\n } else {\n logger.debug(\n { val: envVal, envName },\n 'Could not parse object array',\n );\n }\n } catch {\n logger.debug(\n { val: envVal, envName },\n 'Could not parse environment variable',\n );\n }\n } else {\n const coerce = coersions[option.type];\n config[option.name] = coerce(envVal);\n if (option.name === 'dryRun') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config dryRun property has been changed to full',\n );\n config[option.name] = 'full';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config dryRun property has been changed to null',\n );\n delete config[option.name];\n } else if ((config[option.name] as string) === 'null') {\n delete config[option.name];\n }\n }\n if (option.name === 'requireConfig') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config requireConfig property has been changed to required',\n );\n config[option.name] = 'required';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config requireConfig property has been changed to optional',\n );\n config[option.name] = 'optional';\n }\n }\n if (option.name === 'platformCommit') {\n if ((config[option.name] as string) === 'true') {\n logger.warn(\n 'env config platformCommit property has been changed to enabled',\n );\n config[option.name] = 'enabled';\n } else if ((config[option.name] as string) === 'false') {\n logger.warn(\n 'env config platformCommit property has been changed to disabled',\n );\n config[option.name] = 'disabled';\n }\n }\n }\n }\n }\n });\n\n if (env.GITHUB_COM_TOKEN) {\n logger.debug(`Converting GITHUB_COM_TOKEN into a global host rule`);\n config.hostRules.push({\n hostType: 'github',\n matchHost: 'github.com',\n token: env.GITHUB_COM_TOKEN,\n });\n }\n\n // These env vars are deprecated and deleted to make sure they're not used\n const unsupportedEnv = [\n 'BITBUCKET_TOKEN',\n 'BITBUCKET_USERNAME',\n 'BITBUCKET_PASSWORD',\n 'GITHUB_ENDPOINT',\n 'GITHUB_TOKEN',\n 'GITLAB_ENDPOINT',\n 'GITLAB_TOKEN',\n 'VSTS_ENDPOINT',\n 'VSTS_TOKEN',\n ];\n\n unsupportedEnv.forEach((val) => delete env[val]);\n\n return config;\n}\n"]}
|
@@ -83,9 +83,9 @@ async function detectVulnerabilityAlerts(input) {
|
|
83
83
|
const fileType = fileName.split('/').pop();
|
84
84
|
const firstPatchedVersion = alert.security_vulnerability.first_patched_version.identifier;
|
85
85
|
const advisory = alert.security_advisory;
|
86
|
-
combinedAlerts[fileName]
|
87
|
-
combinedAlerts[fileName][datasource]
|
88
|
-
combinedAlerts[fileName][datasource][depName]
|
86
|
+
combinedAlerts[fileName] ??= {};
|
87
|
+
combinedAlerts[fileName][datasource] ??= {};
|
88
|
+
combinedAlerts[fileName][datasource][depName] ??= {
|
89
89
|
advisories: [],
|
90
90
|
};
|
91
91
|
const alertDetails = combinedAlerts[fileName][datasource][depName];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vulnerability.js","sourceRoot":"","sources":["../../../../lib/workers/repository/init/vulnerability.ts"],"names":[],"mappings":";;AAyCA,kEAUC;AAGD,8DA8JC;;AAnND,sEAA4E;AAC5E,4CAAyC;AACzC,6DAAoE;AACpE,uDAA8D;AAC9D,6DAAoE;AACpE,yDAAgE;AAChE,6DAAoE;AACpE,qEAA4E;AAC5E,2DAAkE;AAClE,mEAA0E;AAC1E,wDAAqD;AACrD,mFAA6D;AAC7D,iGAA2E;AAC3E,2FAAqE;AACrE,uFAAiE;AACjE,6FAAuE;AACvE,yFAAmE;AACnE,6FAAuE;AAEvE,qDAA0D;AAqB1D,SAAgB,2BAA2B,CACzC,YAAoB,EACpB,UAAkB;IAElB,IAAI,UAAU,KAAK,uBAAe,CAAC,EAAE,IAAI,UAAU,KAAK,uBAAe,CAAC,EAAE,EAAE,CAAC;QAC3E,OAAO,IAAI,YAAY,IAAI,CAAC;IAC9B,CAAC;IAED,0CAA0C;IAC1C,OAAO,MAAM,YAAY,EAAE,CAAC;AAC9B,CAAC;AAED,kDAAkD;AAC3C,KAAK,UAAU,yBAAyB,CAC7C,KAAqB;IAErB,IAAI,CAAC,KAAK,EAAE,m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AAC;oBACxC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;gBACjB,IAAI,SAAS,GAAgB;oBAC3B,gBAAgB,EAAE,CAAC,UAAU,CAAC;oBAC9B,iBAAiB,EAAE,CAAC,OAAO,CAAC;oBAC5B,cAAc;iBACf,CAAC;gBAEF,IAAI,mBAAmB,GAAG,KAAK,GAAG,CAAC,mBAAmB,EAAE,CAAC;gBACzD,IACE,UAAU,KAAK,uBAAe,CAAC,EAAE;oBACjC,UAAU,KAAK,uBAAe,CAAC,EAAE,EACjC,CAAC;oBACD,mBAAmB,GAAG,KAAK,GAAG,CAAC,mBAAmB,GAAG,CAAC;gBACxD,CAAC;gBAED,qCAAqC;gBACrC,SAAS,GAAG;oBACV,GAAG,SAAS;oBACZ,mBAAmB;oBACnB,uBAAuB,EAAE,GAAG,CAAC,mBAAmB;oBAChD,WAAW;oBACX,oBAAoB,EAAE,IAAI;oBAC1B,KAAK,EAAE;wBACL,GAAG,MAAM,CAAC,mBAAmB;qBAC9B;iBACF,CAAC;gBACF,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;IACH,CAAC;IACD,eAAM,CAAC,KAAK,CAAC,EAAE,iBAAiB,EAAE,EAAE,qBAAqB,CAAC,CAAC;IAC3D,MAAM,CAAC,YAAY,GAAG,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC5E,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { PackageRule, RenovateConfig } from '../../../config/types';\nimport { NO_VULNERABILITY_ALERTS } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { CrateDatasource } from '../../../modules/datasource/crate';\nimport { GoDatasource } from '../../../modules/datasource/go';\nimport { MavenDatasource } from '../../../modules/datasource/maven';\nimport { NpmDatasource } from '../../../modules/datasource/npm';\nimport { NugetDatasource } from '../../../modules/datasource/nuget';\nimport { PackagistDatasource } from '../../../modules/datasource/packagist';\nimport { PypiDatasource } from '../../../modules/datasource/pypi';\nimport { RubygemsDatasource } from '../../../modules/datasource/rubygems';\nimport { platform } from '../../../modules/platform';\nimport * as allVersioning from '../../../modules/versioning';\nimport * as composerVersioning from '../../../modules/versioning/composer';\nimport * as mavenVersioning from '../../../modules/versioning/maven';\nimport * as npmVersioning from '../../../modules/versioning/npm';\nimport * as pep440Versioning from '../../../modules/versioning/pep440';\nimport * as rubyVersioning from '../../../modules/versioning/ruby';\nimport * as semverVersioning from '../../../modules/versioning/semver';\nimport type { SecurityAdvisory } from '../../../types';\nimport { sanitizeMarkdown } from '../../../util/markdown';\n\ntype Datasource = string;\ntype DependencyName = string;\ntype FileName = string;\n\ntype CombinedAlert = Record<\n FileName,\n Record<\n Datasource,\n Record<\n DependencyName,\n {\n advisories: SecurityAdvisory[];\n fileType?: string;\n firstPatchedVersion?: string;\n }\n >\n >\n>;\n\nexport function getFixedVersionByDatasource(\n fixedVersion: string,\n datasource: string,\n): string {\n if (datasource === MavenDatasource.id || datasource === NugetDatasource.id) {\n return `[${fixedVersion},)`;\n }\n\n // crates.io, Go, Hex, npm, RubyGems, PyPI\n return `>= ${fixedVersion}`;\n}\n\n// TODO can return `null` and `undefined` (#22198)\nexport async function detectVulnerabilityAlerts(\n input: RenovateConfig,\n): Promise<RenovateConfig> {\n if (!input?.vulnerabilityAlerts) {\n return input;\n }\n if (input.vulnerabilityAlerts.enabled === false) {\n logger.debug('Vulnerability alerts are disabled');\n return input;\n }\n const alerts = await platform.getVulnerabilityAlerts?.();\n if (!alerts?.length) {\n logger.debug('No vulnerability alerts found');\n if (input.vulnerabilityAlertsOnly) {\n throw new Error(NO_VULNERABILITY_ALERTS);\n }\n return input;\n }\n const config = { ...input };\n const versionings: Record<string, string> = {\n 'github-tags': semverVersioning.id,\n go: semverVersioning.id,\n packagist: composerVersioning.id,\n maven: mavenVersioning.id,\n npm: npmVersioning.id,\n nuget: semverVersioning.id,\n pypi: pep440Versioning.id,\n rubygems: rubyVersioning.id,\n };\n const combinedAlerts: CombinedAlert = {};\n for (const alert of alerts) {\n try {\n if (alert.dismissed_reason) {\n continue;\n }\n if (!alert.security_vulnerability?.first_patched_version) {\n logger.debug(\n { alert },\n 'Vulnerability alert has no firstPatchedVersion - skipping',\n );\n continue;\n }\n const datasourceMapping: Record<string, string> = {\n composer: PackagistDatasource.id,\n go: GoDatasource.id,\n maven: MavenDatasource.id,\n npm: NpmDatasource.id,\n nuget: NugetDatasource.id,\n pip: PypiDatasource.id,\n rubygems: RubygemsDatasource.id,\n rust: CrateDatasource.id,\n };\n const datasource =\n datasourceMapping[alert.security_vulnerability.package.ecosystem];\n const depName = alert.security_vulnerability.package.name;\n const fileName = alert.dependency.manifest_path;\n const fileType = fileName.split('/').pop();\n const firstPatchedVersion =\n alert.security_vulnerability.first_patched_version.identifier;\n const advisory = alert.security_advisory;\n\n combinedAlerts[fileName] ||= {};\n combinedAlerts[fileName][datasource] ||= {};\n combinedAlerts[fileName][datasource][depName] ||= {\n advisories: [],\n };\n const alertDetails = combinedAlerts[fileName][datasource][depName];\n alertDetails.advisories.push(advisory);\n const versioningApi = allVersioning.get(versionings[datasource]);\n if (versioningApi.isVersion(firstPatchedVersion)) {\n if (\n !alertDetails.firstPatchedVersion ||\n versioningApi.isGreaterThan(\n firstPatchedVersion,\n alertDetails.firstPatchedVersion,\n )\n ) {\n alertDetails.firstPatchedVersion = firstPatchedVersion;\n }\n } else {\n logger.debug('Invalid firstPatchedVersion: ' + firstPatchedVersion);\n }\n alertDetails.fileType = fileType;\n } catch (err) {\n logger.warn({ err }, 'Error parsing vulnerability alert');\n }\n }\n const alertPackageRules: PackageRule[] = [];\n config.remediations = {} as never;\n for (const [fileName, files] of Object.entries(combinedAlerts)) {\n for (const [datasource, dependencies] of Object.entries(files)) {\n for (const [depName, val] of Object.entries(dependencies)) {\n let prBodyNotes: string[] = [];\n try {\n prBodyNotes = ['### GitHub Vulnerability Alerts'].concat(\n val.advisories.map((advisory) => {\n const identifiers = advisory.identifiers;\n const description = advisory.description;\n let content = '#### ';\n let heading: string;\n if (identifiers.some((id) => id.type === 'CVE')) {\n heading = identifiers\n .filter((id) => id.type === 'CVE')\n .map((id) => id.value)\n .join(' / ');\n } else {\n heading = identifiers.map((id) => id.value).join(' / ');\n }\n if (advisory.references?.length) {\n heading = `[${heading}](${advisory.references[0].url})`;\n }\n content += heading;\n content += '\\n\\n';\n\n content += sanitizeMarkdown(description);\n return content;\n }),\n );\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ err }, 'Error generating vulnerability PR notes');\n }\n // TODO: types (#22198)\n const matchFileNames =\n datasource === GoDatasource.id\n ? [fileName.replace('go.sum', 'go.mod')]\n : [fileName];\n let matchRule: PackageRule = {\n matchDatasources: [datasource],\n matchPackageNames: [depName],\n matchFileNames,\n };\n\n let matchCurrentVersion = `< ${val.firstPatchedVersion}`;\n if (\n datasource === MavenDatasource.id ||\n datasource === NugetDatasource.id\n ) {\n matchCurrentVersion = `(,${val.firstPatchedVersion})`;\n }\n\n // Remediate only direct dependencies\n matchRule = {\n ...matchRule,\n matchCurrentVersion,\n vulnerabilityFixVersion: val.firstPatchedVersion,\n prBodyNotes,\n isVulnerabilityAlert: true,\n force: {\n ...config.vulnerabilityAlerts,\n },\n };\n alertPackageRules.push(matchRule);\n }\n }\n }\n logger.debug({ alertPackageRules }, 'alert package rules');\n config.packageRules = (config.packageRules ?? []).concat(alertPackageRules);\n return config;\n}\n"]}
|
1
|
+
{"version":3,"file":"vulnerability.js","sourceRoot":"","sources":["../../../../lib/workers/repository/init/vulnerability.ts"],"names":[],"mappings":";;AAyCA,kEAUC;AAGD,8DA8JC;;AAnND,sEAA4E;AAC5E,4CAAyC;AACzC,6DAAoE;AACpE,uDAA8D;AAC9D,6DAAoE;AACpE,yDAAgE;AAChE,6DAAoE;AACpE,qEAA4E;AAC5E,2DAAkE;AAClE,mEAA0E;AAC1E,wDAAqD;AACrD,mFAA6D;AAC7D,iGAA2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C;IAC3D,MAAM,CAAC,YAAY,GAAG,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC5E,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { PackageRule, RenovateConfig } from '../../../config/types';\nimport { NO_VULNERABILITY_ALERTS } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { CrateDatasource } from '../../../modules/datasource/crate';\nimport { GoDatasource } from '../../../modules/datasource/go';\nimport { MavenDatasource } from '../../../modules/datasource/maven';\nimport { NpmDatasource } from '../../../modules/datasource/npm';\nimport { NugetDatasource } from '../../../modules/datasource/nuget';\nimport { PackagistDatasource } from '../../../modules/datasource/packagist';\nimport { PypiDatasource } from '../../../modules/datasource/pypi';\nimport { RubygemsDatasource } from '../../../modules/datasource/rubygems';\nimport { platform } from '../../../modules/platform';\nimport * as allVersioning from '../../../modules/versioning';\nimport * as composerVersioning from '../../../modules/versioning/composer';\nimport * as mavenVersioning from '../../../modules/versioning/maven';\nimport * as npmVersioning from '../../../modules/versioning/npm';\nimport * as pep440Versioning from '../../../modules/versioning/pep440';\nimport * as rubyVersioning from '../../../modules/versioning/ruby';\nimport * as semverVersioning from '../../../modules/versioning/semver';\nimport type { SecurityAdvisory } from '../../../types';\nimport { sanitizeMarkdown } from '../../../util/markdown';\n\ntype Datasource = string;\ntype DependencyName = string;\ntype FileName = string;\n\ntype CombinedAlert = Record<\n FileName,\n Record<\n Datasource,\n Record<\n DependencyName,\n {\n advisories: SecurityAdvisory[];\n fileType?: string;\n firstPatchedVersion?: string;\n }\n >\n >\n>;\n\nexport function getFixedVersionByDatasource(\n fixedVersion: string,\n datasource: string,\n): string {\n if (datasource === MavenDatasource.id || datasource === NugetDatasource.id) {\n return `[${fixedVersion},)`;\n }\n\n // crates.io, Go, Hex, npm, RubyGems, PyPI\n return `>= ${fixedVersion}`;\n}\n\n// TODO can return `null` and `undefined` (#22198)\nexport async function detectVulnerabilityAlerts(\n input: RenovateConfig,\n): Promise<RenovateConfig> {\n if (!input?.vulnerabilityAlerts) {\n return input;\n }\n if (input.vulnerabilityAlerts.enabled === false) {\n logger.debug('Vulnerability alerts are disabled');\n return input;\n }\n const alerts = await platform.getVulnerabilityAlerts?.();\n if (!alerts?.length) {\n logger.debug('No vulnerability alerts found');\n if (input.vulnerabilityAlertsOnly) {\n throw new Error(NO_VULNERABILITY_ALERTS);\n }\n return input;\n }\n const config = { ...input };\n const versionings: Record<string, string> = {\n 'github-tags': semverVersioning.id,\n go: semverVersioning.id,\n packagist: composerVersioning.id,\n maven: mavenVersioning.id,\n npm: npmVersioning.id,\n nuget: semverVersioning.id,\n pypi: pep440Versioning.id,\n rubygems: rubyVersioning.id,\n };\n const combinedAlerts: CombinedAlert = {};\n for (const alert of alerts) {\n try {\n if (alert.dismissed_reason) {\n continue;\n }\n if (!alert.security_vulnerability?.first_patched_version) {\n logger.debug(\n { alert },\n 'Vulnerability alert has no firstPatchedVersion - skipping',\n );\n continue;\n }\n const datasourceMapping: Record<string, string> = {\n composer: PackagistDatasource.id,\n go: GoDatasource.id,\n maven: MavenDatasource.id,\n npm: NpmDatasource.id,\n nuget: NugetDatasource.id,\n pip: PypiDatasource.id,\n rubygems: RubygemsDatasource.id,\n rust: CrateDatasource.id,\n };\n const datasource =\n datasourceMapping[alert.security_vulnerability.package.ecosystem];\n const depName = alert.security_vulnerability.package.name;\n const fileName = alert.dependency.manifest_path;\n const fileType = fileName.split('/').pop();\n const firstPatchedVersion =\n alert.security_vulnerability.first_patched_version.identifier;\n const advisory = alert.security_advisory;\n\n combinedAlerts[fileName] ??= {};\n combinedAlerts[fileName][datasource] ??= {};\n combinedAlerts[fileName][datasource][depName] ??= {\n advisories: [],\n };\n const alertDetails = combinedAlerts[fileName][datasource][depName];\n alertDetails.advisories.push(advisory);\n const versioningApi = allVersioning.get(versionings[datasource]);\n if (versioningApi.isVersion(firstPatchedVersion)) {\n if (\n !alertDetails.firstPatchedVersion ||\n versioningApi.isGreaterThan(\n firstPatchedVersion,\n alertDetails.firstPatchedVersion,\n )\n ) {\n alertDetails.firstPatchedVersion = firstPatchedVersion;\n }\n } else {\n logger.debug('Invalid firstPatchedVersion: ' + firstPatchedVersion);\n }\n alertDetails.fileType = fileType;\n } catch (err) {\n logger.warn({ err }, 'Error parsing vulnerability alert');\n }\n }\n const alertPackageRules: PackageRule[] = [];\n config.remediations = {} as never;\n for (const [fileName, files] of Object.entries(combinedAlerts)) {\n for (const [datasource, dependencies] of Object.entries(files)) {\n for (const [depName, val] of Object.entries(dependencies)) {\n let prBodyNotes: string[] = [];\n try {\n prBodyNotes = ['### GitHub Vulnerability Alerts'].concat(\n val.advisories.map((advisory) => {\n const identifiers = advisory.identifiers;\n const description = advisory.description;\n let content = '#### ';\n let heading: string;\n if (identifiers.some((id) => id.type === 'CVE')) {\n heading = identifiers\n .filter((id) => id.type === 'CVE')\n .map((id) => id.value)\n .join(' / ');\n } else {\n heading = identifiers.map((id) => id.value).join(' / ');\n }\n if (advisory.references?.length) {\n heading = `[${heading}](${advisory.references[0].url})`;\n }\n content += heading;\n content += '\\n\\n';\n\n content += sanitizeMarkdown(description);\n return content;\n }),\n );\n } catch (err) /* istanbul ignore next */ {\n logger.warn({ err }, 'Error generating vulnerability PR notes');\n }\n // TODO: types (#22198)\n const matchFileNames =\n datasource === GoDatasource.id\n ? [fileName.replace('go.sum', 'go.mod')]\n : [fileName];\n let matchRule: PackageRule = {\n matchDatasources: [datasource],\n matchPackageNames: [depName],\n matchFileNames,\n };\n\n let matchCurrentVersion = `< ${val.firstPatchedVersion}`;\n if (\n datasource === MavenDatasource.id ||\n datasource === NugetDatasource.id\n ) {\n matchCurrentVersion = `(,${val.firstPatchedVersion})`;\n }\n\n // Remediate only direct dependencies\n matchRule = {\n ...matchRule,\n matchCurrentVersion,\n vulnerabilityFixVersion: val.firstPatchedVersion,\n prBodyNotes,\n isVulnerabilityAlert: true,\n force: {\n ...config.vulnerabilityAlerts,\n },\n };\n alertPackageRules.push(matchRule);\n }\n }\n }\n logger.debug({ alertPackageRules }, 'alert package rules');\n config.packageRules = (config.packageRules ?? []).concat(alertPackageRules);\n return config;\n}\n"]}
|
@@ -123,7 +123,7 @@ function handleOnboardingManualRebase(onboardingPr) {
|
|
123
123
|
}
|
124
124
|
function invalidateExtractCache(baseBranch) {
|
125
125
|
const cache = (0, repository_1.getCache)();
|
126
|
-
cache.scan
|
126
|
+
cache.scan ??= {};
|
127
127
|
if (cache.scan?.[baseBranch]) {
|
128
128
|
delete cache.scan[baseBranch];
|
129
129
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/onboarding/branch/index.ts"],"names":[],"mappings":";;AA0BA,sDAqHC;;AA/ID,kEAAkC;AAClC,+CAAsD;AACtD,sDAAyD;AAEzD,yEAAmF;AACnF,+CAA4C;AAC5C,2DAAiE;AACjE,0DAAuD;AACvD,kEAA6D;AAC7D,8CAAqE;AACrE,iDAAqD;AACrD,2CAAuD;AACvD,4CAAuD;AACvD,sCAA4C;AAC5C,mCAAuD;AACvD,qCAA+C;AAC/C,qCAAkD;AAClD,uEAMmC;AACnC,qCAAkD;AAE3C,KAAK,UAAU,qBAAqB,CACzC,MAAsB;IAEtB,eAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAClC,eAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACzB,IAAI,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAC/C,MAAM,aAAa,GAAG,MAAM,CAAC,aAAc,CAAC;IAC5C,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,MAAM,eAAe,GAAG,MAAM,IAAA,mBAAW,EAAC,MAAM,CAAC,CAAC;IAClD,IAAI,eAAe,EAAE,CAAC;QACpB,eAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;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AO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;AACxC,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { mergeChildConfig } from '../../../../config';\nimport { GlobalConfig } from '../../../../config/global';\nimport type { RenovateConfig } from '../../../../config/types';\nimport { REPOSITORY_NO_PACKAGE_FILES } from '../../../../constants/error-messages';\nimport { logger } from '../../../../logger';\nimport { type Pr, platform } from '../../../../modules/platform';\nimport { scm } from '../../../../modules/platform/scm';\nimport { getCache } from '../../../../util/cache/repository';\nimport { getBranchCommit, setGitAuthor } from '../../../../util/git';\nimport { checkIfConfigured } from '../../configured';\nimport { extractAllDependencies } from '../../extract';\nimport { mergeRenovateConfig } from '../../init/merge';\nimport { OnboardingState } from '../common';\nimport { getOnboardingPr, isOnboarded } from './check';\nimport { getOnboardingConfig } from './config';\nimport { createOnboardingBranch } from './create';\nimport {\n deleteOnboardingCache,\n hasOnboardingBranchChanged,\n isOnboardingBranchConflicted,\n isOnboardingBranchModified,\n setOnboardingCache,\n} from './onboarding-branch-cache';\nimport { rebaseOnboardingBranch } from './rebase';\n\nexport async function checkOnboardingBranch(\n config: RenovateConfig,\n): Promise<RenovateConfig> {\n logger.debug('checkOnboarding()');\n logger.trace({ config });\n let onboardingBranch = config.onboardingBranch;\n const defaultBranch = config.defaultBranch!;\n let isConflicted = false;\n let isModified = false;\n const repoIsOnboarded = await isOnboarded(config);\n if (repoIsOnboarded) {\n logger.debug('Repo is onboarded');\n\n // delete onboarding cache\n deleteOnboardingCache();\n return { ...config, repoIsOnboarded };\n }\n checkIfConfigured(config);\n\n logger.debug('Repo is not onboarded');\n // global gitAuthor will need to be used\n setGitAuthor(config.gitAuthor);\n const onboardingPr = await getOnboardingPr(config);\n // TODO #22198\n const branchList = [onboardingBranch!];\n if (onboardingPr) {\n logger.debug('Onboarding PR already exists');\n\n isModified = await isOnboardingBranchModified(\n config.onboardingBranch!,\n defaultBranch,\n );\n // if onboarding branch is not modified, check if onboarding config has been changed and rebase if true\n if (!isModified) {\n const commit = await rebaseOnboardingBranch(\n config,\n onboardingPr.bodyStruct?.rawConfigHash,\n );\n if (commit) {\n logger.info(\n { branch: config.onboardingBranch, commit, onboarding: true },\n 'Branch updated',\n );\n }\n // istanbul ignore if\n if (platform.refreshPr) {\n await platform.refreshPr(onboardingPr.number);\n }\n }\n if (config.onboardingRebaseCheckbox) {\n handleOnboardingManualRebase(onboardingPr);\n }\n\n if (\n isConfigHashPresent(onboardingPr) && // needed so that existing onboarding PRs are updated with config hash comment\n isOnboardingCacheValid(defaultBranch, config.onboardingBranch!) &&\n !(config.onboardingRebaseCheckbox && OnboardingState.prUpdateRequested)\n ) {\n logger.debug(\n 'Skip processing since the onboarding branch is up to date and default branch has not changed',\n );\n OnboardingState.onboardingCacheValid = true;\n return { ...config, repoIsOnboarded, onboardingBranch, branchList };\n }\n OnboardingState.onboardingCacheValid = false;\n if (isModified) {\n if (hasOnboardingBranchChanged(config.onboardingBranch!)) {\n invalidateExtractCache(config.baseBranch!);\n }\n isConflicted = await isOnboardingBranchConflicted(\n config.baseBranch!,\n config.onboardingBranch!,\n );\n }\n } else {\n logger.debug('Onboarding PR does not exist');\n const onboardingConfig = await getOnboardingConfig(config);\n let mergedConfig = mergeChildConfig(config, onboardingConfig);\n mergedConfig = await mergeRenovateConfig(mergedConfig);\n onboardingBranch = mergedConfig.onboardingBranch;\n\n if (\n Object.entries((await extractAllDependencies(mergedConfig)).packageFiles)\n .length === 0\n ) {\n if (config.onboardingNoDeps !== 'enabled') {\n throw new Error(REPOSITORY_NO_PACKAGE_FILES);\n }\n }\n logger.debug('Need to create onboarding PR');\n if (config.onboardingRebaseCheckbox) {\n OnboardingState.prUpdateRequested = true;\n }\n const commit = await createOnboardingBranch(mergedConfig);\n // istanbul ignore if\n if (commit) {\n logger.info(\n { branch: onboardingBranch, commit, onboarding: true },\n 'Branch created',\n );\n }\n }\n if (!GlobalConfig.get('dryRun')) {\n // TODO #22198\n if (!isConflicted) {\n logger.debug('Merge onboarding branch in default branch');\n await scm.mergeToLocal(onboardingBranch!);\n }\n }\n setOnboardingCache(\n getBranchCommit(config.defaultBranch!)!,\n getBranchCommit(onboardingBranch!)!,\n isConflicted,\n isModified,\n );\n\n return { ...config, repoIsOnboarded, onboardingBranch, branchList };\n}\n\nfunction handleOnboardingManualRebase(onboardingPr: Pr): void {\n const pl = GlobalConfig.get('platform')!;\n const { rebaseRequested } = onboardingPr.bodyStruct ?? {};\n if (!['github', 'gitlab', 'gitea'].includes(pl)) {\n logger.trace(`Platform '${pl}' does not support extended markdown`);\n OnboardingState.prUpdateRequested = true;\n } else if (is.nullOrUndefined(rebaseRequested)) {\n logger.debug('No rebase checkbox was found in the onboarding PR');\n OnboardingState.prUpdateRequested = true;\n } else if (rebaseRequested) {\n logger.debug('Manual onboarding PR update requested');\n OnboardingState.prUpdateRequested = true;\n }\n}\n\nfunction invalidateExtractCache(baseBranch: string): void {\n const cache = getCache();\n cache.scan ||= {};\n\n if (cache.scan?.[baseBranch]) {\n delete cache.scan[baseBranch];\n }\n}\n\nfunction isOnboardingCacheValid(\n defaultBranch: string,\n onboardingBranch: string,\n): boolean {\n const cache = getCache();\n const onboardingBranchCache = cache?.onboardingBranchCache;\n return !!(\n onboardingBranchCache &&\n onboardingBranchCache.defaultBranchSha === getBranchCommit(defaultBranch) &&\n onboardingBranchCache.onboardingBranchSha ===\n getBranchCommit(onboardingBranch) &&\n onboardingBranchCache.configFileName &&\n onboardingBranchCache.configFileParsed\n );\n}\n\nfunction isConfigHashPresent(pr: Pr): boolean {\n const platform = GlobalConfig.get('platform')!;\n // if platform does not support html comments return true\n if (!['github', 'gitlab', 'gitea'].includes(platform)) {\n return true;\n }\n\n return !!pr.bodyStruct?.rawConfigHash;\n}\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../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,MAAM,KAAK,GAAG,IAAA,qBAAQ,GAAE,CAAC;IACzB,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;IAElB,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAC7B,aAAqB,EACrB,gBAAwB;IAExB,MAAM,KAAK,GAAG,IAAA,qBAAQ,GAAE,CAAC;IACzB,MAAM,qBAAqB,GAAG,KAAK,EAAE,qBAAqB,CAAC;IAC3D,OAAO,CAAC,CAAC,CACP,qBAAqB;QACrB,qBAAqB,CAAC,gBAAgB,KAAK,IAAA,qBAAe,EAAC,aAAa,CAAC;QACzE,qBAAqB,CAAC,mBAAmB;YACvC,IAAA,qBAAe,EAAC,gBAAgB,CAAC;QACnC,qBAAqB,CAAC,cAAc;QACpC,qBAAqB,CAAC,gBAAgB,CACvC,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,EAAM;IACjC,MAAM,QAAQ,GAAG,qBAAY,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC;IAC/C,yDAAyD;IACzD,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;AACxC,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { mergeChildConfig } from '../../../../config';\nimport { GlobalConfig } from '../../../../config/global';\nimport type { RenovateConfig } from '../../../../config/types';\nimport { REPOSITORY_NO_PACKAGE_FILES } from '../../../../constants/error-messages';\nimport { logger } from '../../../../logger';\nimport { type Pr, platform } from '../../../../modules/platform';\nimport { scm } from '../../../../modules/platform/scm';\nimport { getCache } from '../../../../util/cache/repository';\nimport { getBranchCommit, setGitAuthor } from '../../../../util/git';\nimport { checkIfConfigured } from '../../configured';\nimport { extractAllDependencies } from '../../extract';\nimport { mergeRenovateConfig } from '../../init/merge';\nimport { OnboardingState } from '../common';\nimport { getOnboardingPr, isOnboarded } from './check';\nimport { getOnboardingConfig } from './config';\nimport { createOnboardingBranch } from './create';\nimport {\n deleteOnboardingCache,\n hasOnboardingBranchChanged,\n isOnboardingBranchConflicted,\n isOnboardingBranchModified,\n setOnboardingCache,\n} from './onboarding-branch-cache';\nimport { rebaseOnboardingBranch } from './rebase';\n\nexport async function checkOnboardingBranch(\n config: RenovateConfig,\n): Promise<RenovateConfig> {\n logger.debug('checkOnboarding()');\n logger.trace({ config });\n let onboardingBranch = config.onboardingBranch;\n const defaultBranch = config.defaultBranch!;\n let isConflicted = false;\n let isModified = false;\n const repoIsOnboarded = await isOnboarded(config);\n if (repoIsOnboarded) {\n logger.debug('Repo is onboarded');\n\n // delete onboarding cache\n deleteOnboardingCache();\n return { ...config, repoIsOnboarded };\n }\n checkIfConfigured(config);\n\n logger.debug('Repo is not onboarded');\n // global gitAuthor will need to be used\n setGitAuthor(config.gitAuthor);\n const onboardingPr = await getOnboardingPr(config);\n // TODO #22198\n const branchList = [onboardingBranch!];\n if (onboardingPr) {\n logger.debug('Onboarding PR already exists');\n\n isModified = await isOnboardingBranchModified(\n config.onboardingBranch!,\n defaultBranch,\n );\n // if onboarding branch is not modified, check if onboarding config has been changed and rebase if true\n if (!isModified) {\n const commit = await rebaseOnboardingBranch(\n config,\n onboardingPr.bodyStruct?.rawConfigHash,\n );\n if (commit) {\n logger.info(\n { branch: config.onboardingBranch, commit, onboarding: true },\n 'Branch updated',\n );\n }\n // istanbul ignore if\n if (platform.refreshPr) {\n await platform.refreshPr(onboardingPr.number);\n }\n }\n if (config.onboardingRebaseCheckbox) {\n handleOnboardingManualRebase(onboardingPr);\n }\n\n if (\n isConfigHashPresent(onboardingPr) && // needed so that existing onboarding PRs are updated with config hash comment\n isOnboardingCacheValid(defaultBranch, config.onboardingBranch!) &&\n !(config.onboardingRebaseCheckbox && OnboardingState.prUpdateRequested)\n ) {\n logger.debug(\n 'Skip processing since the onboarding branch is up to date and default branch has not changed',\n );\n OnboardingState.onboardingCacheValid = true;\n return { ...config, repoIsOnboarded, onboardingBranch, branchList };\n }\n OnboardingState.onboardingCacheValid = false;\n if (isModified) {\n if (hasOnboardingBranchChanged(config.onboardingBranch!)) {\n invalidateExtractCache(config.baseBranch!);\n }\n isConflicted = await isOnboardingBranchConflicted(\n config.baseBranch!,\n config.onboardingBranch!,\n );\n }\n } else {\n logger.debug('Onboarding PR does not exist');\n const onboardingConfig = await getOnboardingConfig(config);\n let mergedConfig = mergeChildConfig(config, onboardingConfig);\n mergedConfig = await mergeRenovateConfig(mergedConfig);\n onboardingBranch = mergedConfig.onboardingBranch;\n\n if (\n Object.entries((await extractAllDependencies(mergedConfig)).packageFiles)\n .length === 0\n ) {\n if (config.onboardingNoDeps !== 'enabled') {\n throw new Error(REPOSITORY_NO_PACKAGE_FILES);\n }\n }\n logger.debug('Need to create onboarding PR');\n if (config.onboardingRebaseCheckbox) {\n OnboardingState.prUpdateRequested = true;\n }\n const commit = await createOnboardingBranch(mergedConfig);\n // istanbul ignore if\n if (commit) {\n logger.info(\n { branch: onboardingBranch, commit, onboarding: true },\n 'Branch created',\n );\n }\n }\n if (!GlobalConfig.get('dryRun')) {\n // TODO #22198\n if (!isConflicted) {\n logger.debug('Merge onboarding branch in default branch');\n await scm.mergeToLocal(onboardingBranch!);\n }\n }\n setOnboardingCache(\n getBranchCommit(config.defaultBranch!)!,\n getBranchCommit(onboardingBranch!)!,\n isConflicted,\n isModified,\n );\n\n return { ...config, repoIsOnboarded, onboardingBranch, branchList };\n}\n\nfunction handleOnboardingManualRebase(onboardingPr: Pr): void {\n const pl = GlobalConfig.get('platform')!;\n const { rebaseRequested } = onboardingPr.bodyStruct ?? {};\n if (!['github', 'gitlab', 'gitea'].includes(pl)) {\n logger.trace(`Platform '${pl}' does not support extended markdown`);\n OnboardingState.prUpdateRequested = true;\n } else if (is.nullOrUndefined(rebaseRequested)) {\n logger.debug('No rebase checkbox was found in the onboarding PR');\n OnboardingState.prUpdateRequested = true;\n } else if (rebaseRequested) {\n logger.debug('Manual onboarding PR update requested');\n OnboardingState.prUpdateRequested = true;\n }\n}\n\nfunction invalidateExtractCache(baseBranch: string): void {\n const cache = getCache();\n cache.scan ??= {};\n\n if (cache.scan?.[baseBranch]) {\n delete cache.scan[baseBranch];\n }\n}\n\nfunction isOnboardingCacheValid(\n defaultBranch: string,\n onboardingBranch: string,\n): boolean {\n const cache = getCache();\n const onboardingBranchCache = cache?.onboardingBranchCache;\n return !!(\n onboardingBranchCache &&\n onboardingBranchCache.defaultBranchSha === getBranchCommit(defaultBranch) &&\n onboardingBranchCache.onboardingBranchSha ===\n getBranchCommit(onboardingBranch) &&\n onboardingBranchCache.configFileName &&\n onboardingBranchCache.configFileParsed\n );\n}\n\nfunction isConfigHashPresent(pr: Pr): boolean {\n const platform = GlobalConfig.get('platform')!;\n // if platform does not support html comments return true\n if (!['github', 'gitlab', 'gitea'].includes(platform)) {\n return true;\n }\n\n return !!pr.bodyStruct?.rawConfigHash;\n}\n"]}
|
@@ -95,7 +95,7 @@ async function extract(config) {
|
|
95
95
|
const baseBranchSha = await scm_1.scm.getBranchCommit(baseBranch);
|
96
96
|
let packageFiles;
|
97
97
|
const cache = (0, repository_1.getCache)();
|
98
|
-
cache.scan
|
98
|
+
cache.scan ??= {};
|
99
99
|
const cachedExtract = cache.scan[baseBranch];
|
100
100
|
const configHash = (0, fingerprint_1.fingerprint)((0, extract_fingerprint_config_1.generateFingerprintConfig)(config));
|
101
101
|
// istanbul ignore if
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"extract-update.js","sourceRoot":"","sources":["../../../../lib/workers/repository/process/extract-update.ts"],"names":[],"mappings":";;;AAqEA,kDA2DC;AAED,0BAyDC;AAoBD,wBAgBC;AAED,wBAWC;;A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/is';\nimport type { RenovateConfig } from '../../../config/types';\nimport { logger } from '../../../logger';\nimport { hashMap } from '../../../modules/manager';\nimport type { PackageFile } from '../../../modules/manager/types';\nimport { scm } from '../../../modules/platform/scm';\nimport { getCache } from '../../../util/cache/repository';\nimport type { BaseBranchCache } from '../../../util/cache/repository/types';\nimport { checkGithubToken as ensureGithubToken } from '../../../util/check-token';\nimport { fingerprint } from '../../../util/fingerprint';\nimport type { BranchConfig } from '../../types';\nimport { extractAllDependencies } from '../extract';\nimport { generateFingerprintConfig } from '../extract/extract-fingerprint-config';\nimport { branchifyUpgrades } from '../updates/branchify';\nimport { fetchUpdates } from './fetch';\nimport { sortBranches } from './sort';\nimport { Vulnerabilities } from './vulnerabilities';\nimport type { WriteUpdateResult } from './write';\nimport { writeUpdates } from './write';\n\n// Increment this if needing to cache bust ALL extract caches\nexport const EXTRACT_CACHE_REVISION = 1;\n\nexport interface ExtractResult {\n branches: BranchConfig[];\n branchList: string[];\n packageFiles: Record<string, PackageFile[]>;\n}\n\nexport interface StatsResult {\n fileCount: number;\n depCount: number;\n}\n\nexport interface Stats {\n managers: Record<string, StatsResult>;\n total: StatsResult;\n}\n\n// istanbul ignore next\nfunction extractStats(\n packageFiles: Record<string, PackageFile[]>,\n): Stats | null {\n if (!packageFiles) {\n return null;\n }\n const stats: Stats = {\n managers: {},\n total: {\n fileCount: 0,\n depCount: 0,\n },\n };\n for (const [manager, managerPackageFiles] of Object.entries(packageFiles)) {\n const fileCount = managerPackageFiles.length;\n let depCount = 0;\n for (const file of managerPackageFiles) {\n depCount += file.deps.length;\n }\n stats.managers[manager] = {\n fileCount,\n depCount,\n };\n stats.total.fileCount += fileCount;\n stats.total.depCount += depCount;\n }\n return stats;\n}\n\nexport function isCacheExtractValid(\n baseBranchSha: string,\n configHash: string,\n cachedExtract?: BaseBranchCache,\n): boolean {\n if (!cachedExtract) {\n return false;\n }\n\n if (!cachedExtract.revision) {\n logger.debug('Cached extract is missing revision, so cannot be used');\n return false;\n }\n\n if (cachedExtract.revision !== EXTRACT_CACHE_REVISION) {\n logger.debug(\n `Extract cache revision has changed (old=${cachedExtract.revision}, new=${EXTRACT_CACHE_REVISION})`,\n );\n return false;\n }\n\n if (!(cachedExtract.sha && cachedExtract.configHash)) {\n return false;\n }\n if (cachedExtract.sha !== baseBranchSha) {\n logger.debug(\n `Cached extract result cannot be used due to base branch SHA change (old=${cachedExtract.sha}, new=${baseBranchSha})`,\n );\n return false;\n }\n if (cachedExtract.configHash !== configHash) {\n logger.debug('Cached extract result cannot be used due to config change');\n return false;\n }\n if (!cachedExtract.extractionFingerprints) {\n logger.debug(\n 'Cached extract is missing extractionFingerprints, so cannot be used',\n );\n return false;\n }\n const changedManagers = new Set();\n for (const [manager, fingerprint] of Object.entries(\n cachedExtract.extractionFingerprints,\n )) {\n if (fingerprint !== hashMap.get(manager)) {\n changedManagers.add(manager);\n }\n }\n if (changedManagers.size > 0) {\n logger.debug(\n { changedManagers: [...changedManagers] },\n 'Manager fingerprint(s) have changed, extract cache cannot be reused',\n );\n return false;\n }\n logger.debug(\n `Cached extract for sha=${baseBranchSha} is valid and can be used`,\n );\n return true;\n}\n\nexport async function extract(\n config: RenovateConfig,\n): Promise<Record<string, PackageFile[]>> {\n logger.debug('extract()');\n const { baseBranch } = config;\n const baseBranchSha = await scm.getBranchCommit(baseBranch!);\n let packageFiles: Record<string, PackageFile[]>;\n const cache = getCache();\n cache.scan ||= {};\n const cachedExtract = cache.scan[baseBranch!];\n const configHash = fingerprint(generateFingerprintConfig(config));\n // istanbul ignore if\n if (isCacheExtractValid(baseBranchSha!, configHash, cachedExtract)) {\n packageFiles = cachedExtract.packageFiles;\n try {\n for (const files of Object.values(packageFiles)) {\n for (const file of files) {\n for (const dep of file.deps) {\n delete dep.updates;\n }\n }\n }\n logger.debug('Deleted cached dep updates');\n } catch (err) {\n logger.info({ err }, 'Error deleting cached dep updates');\n }\n } else {\n await scm.checkoutBranch(baseBranch!);\n const extractResult = (await extractAllDependencies(config)) || {};\n packageFiles = extractResult.packageFiles;\n const { extractionFingerprints } = extractResult;\n // TODO: fix types (#22198)\n cache.scan[baseBranch!] = {\n revision: EXTRACT_CACHE_REVISION,\n sha: baseBranchSha!,\n configHash,\n extractionFingerprints,\n packageFiles,\n };\n // Clean up cached branch extracts\n const baseBranches = is.nonEmptyArray(config.baseBranches)\n ? config.baseBranches\n : [baseBranch];\n Object.keys(cache.scan).forEach((branchName) => {\n if (!baseBranches.includes(branchName)) {\n delete cache.scan![branchName];\n }\n });\n }\n const stats = extractStats(packageFiles);\n logger.info(\n { baseBranch: config.baseBranch, stats },\n `Dependency extraction complete`,\n );\n logger.trace({ config: packageFiles }, 'packageFiles');\n ensureGithubToken(packageFiles);\n return packageFiles;\n}\n\nasync function fetchVulnerabilities(\n config: RenovateConfig,\n packageFiles: Record<string, PackageFile[]>,\n): Promise<void> {\n if (config.osvVulnerabilityAlerts) {\n logger.debug('fetchVulnerabilities() - osvVulnerabilityAlerts=true');\n try {\n const vulnerabilities = await Vulnerabilities.create();\n await vulnerabilities.appendVulnerabilityPackageRules(\n config,\n packageFiles,\n );\n } catch (err) {\n logger.warn({ err }, 'Unable to read vulnerability information');\n }\n }\n}\n\nexport async function lookup(\n config: RenovateConfig,\n packageFiles: Record<string, PackageFile[]>,\n): Promise<ExtractResult> {\n await fetchVulnerabilities(config, packageFiles);\n await fetchUpdates(config, packageFiles);\n const { branches, branchList } = await branchifyUpgrades(\n config,\n packageFiles,\n );\n logger.debug(\n { baseBranch: config.baseBranch, config: packageFiles },\n 'packageFiles with updates',\n );\n sortBranches(branches);\n return { branches, branchList, packageFiles };\n}\n\nexport async function update(\n config: RenovateConfig,\n branches: BranchConfig[],\n): Promise<WriteUpdateResult | undefined> {\n let res: WriteUpdateResult | undefined;\n // istanbul ignore else\n if (config.repoIsOnboarded) {\n res = await writeUpdates(config, branches);\n }\n\n return res;\n}\n"]}
|
1
|
+
{"version":3,"file":"extract-update.js","sourceRoot":"","sources":["../../../../lib/workers/repository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QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { RenovateConfig } from '../../../config/types';\nimport { logger } from '../../../logger';\nimport { hashMap } from '../../../modules/manager';\nimport type { PackageFile } from '../../../modules/manager/types';\nimport { scm } from '../../../modules/platform/scm';\nimport { getCache } from '../../../util/cache/repository';\nimport type { BaseBranchCache } from '../../../util/cache/repository/types';\nimport { checkGithubToken as ensureGithubToken } from '../../../util/check-token';\nimport { fingerprint } from '../../../util/fingerprint';\nimport type { BranchConfig } from '../../types';\nimport { extractAllDependencies } from '../extract';\nimport { generateFingerprintConfig } from '../extract/extract-fingerprint-config';\nimport { branchifyUpgrades } from '../updates/branchify';\nimport { fetchUpdates } from './fetch';\nimport { sortBranches } from './sort';\nimport { Vulnerabilities } from './vulnerabilities';\nimport type { WriteUpdateResult } from './write';\nimport { writeUpdates } from './write';\n\n// Increment this if needing to cache bust ALL extract caches\nexport const EXTRACT_CACHE_REVISION = 1;\n\nexport interface ExtractResult {\n branches: BranchConfig[];\n branchList: string[];\n packageFiles: Record<string, PackageFile[]>;\n}\n\nexport interface StatsResult {\n fileCount: number;\n depCount: number;\n}\n\nexport interface Stats {\n managers: Record<string, StatsResult>;\n total: StatsResult;\n}\n\n// istanbul ignore next\nfunction extractStats(\n packageFiles: Record<string, PackageFile[]>,\n): Stats | null {\n if (!packageFiles) {\n return null;\n }\n const stats: Stats = {\n managers: {},\n total: {\n fileCount: 0,\n depCount: 0,\n },\n };\n for (const [manager, managerPackageFiles] of Object.entries(packageFiles)) {\n const fileCount = managerPackageFiles.length;\n let depCount = 0;\n for (const file of managerPackageFiles) {\n depCount += file.deps.length;\n }\n stats.managers[manager] = {\n fileCount,\n depCount,\n };\n stats.total.fileCount += fileCount;\n stats.total.depCount += depCount;\n }\n return stats;\n}\n\nexport function isCacheExtractValid(\n baseBranchSha: string,\n configHash: string,\n cachedExtract?: BaseBranchCache,\n): boolean {\n if (!cachedExtract) {\n return false;\n }\n\n if (!cachedExtract.revision) {\n logger.debug('Cached extract is missing revision, so cannot be used');\n return false;\n }\n\n if (cachedExtract.revision !== EXTRACT_CACHE_REVISION) {\n logger.debug(\n `Extract cache revision has changed (old=${cachedExtract.revision}, new=${EXTRACT_CACHE_REVISION})`,\n );\n return false;\n }\n\n if (!(cachedExtract.sha && cachedExtract.configHash)) {\n return false;\n }\n if (cachedExtract.sha !== baseBranchSha) {\n logger.debug(\n `Cached extract result cannot be used due to base branch SHA change (old=${cachedExtract.sha}, new=${baseBranchSha})`,\n );\n return false;\n }\n if (cachedExtract.configHash !== configHash) {\n logger.debug('Cached extract result cannot be used due to config change');\n return false;\n }\n if (!cachedExtract.extractionFingerprints) {\n logger.debug(\n 'Cached extract is missing extractionFingerprints, so cannot be used',\n );\n return false;\n }\n const changedManagers = new Set();\n for (const [manager, fingerprint] of Object.entries(\n cachedExtract.extractionFingerprints,\n )) {\n if (fingerprint !== hashMap.get(manager)) {\n changedManagers.add(manager);\n }\n }\n if (changedManagers.size > 0) {\n logger.debug(\n { changedManagers: [...changedManagers] },\n 'Manager fingerprint(s) have changed, extract cache cannot be reused',\n );\n return false;\n }\n logger.debug(\n `Cached extract for sha=${baseBranchSha} is valid and can be used`,\n );\n return true;\n}\n\nexport async function extract(\n config: RenovateConfig,\n): Promise<Record<string, PackageFile[]>> {\n logger.debug('extract()');\n const { baseBranch } = config;\n const baseBranchSha = await scm.getBranchCommit(baseBranch!);\n let packageFiles: Record<string, PackageFile[]>;\n const cache = getCache();\n cache.scan ??= {};\n const cachedExtract = cache.scan[baseBranch!];\n const configHash = fingerprint(generateFingerprintConfig(config));\n // istanbul ignore if\n if (isCacheExtractValid(baseBranchSha!, configHash, cachedExtract)) {\n packageFiles = cachedExtract.packageFiles;\n try {\n for (const files of Object.values(packageFiles)) {\n for (const file of files) {\n for (const dep of file.deps) {\n delete dep.updates;\n }\n }\n }\n logger.debug('Deleted cached dep updates');\n } catch (err) {\n logger.info({ err }, 'Error deleting cached dep updates');\n }\n } else {\n await scm.checkoutBranch(baseBranch!);\n const extractResult = (await extractAllDependencies(config)) || {};\n packageFiles = extractResult.packageFiles;\n const { extractionFingerprints } = extractResult;\n // TODO: fix types (#22198)\n cache.scan[baseBranch!] = {\n revision: EXTRACT_CACHE_REVISION,\n sha: baseBranchSha!,\n configHash,\n extractionFingerprints,\n packageFiles,\n };\n // Clean up cached branch extracts\n const baseBranches = is.nonEmptyArray(config.baseBranches)\n ? config.baseBranches\n : [baseBranch];\n Object.keys(cache.scan).forEach((branchName) => {\n if (!baseBranches.includes(branchName)) {\n delete cache.scan![branchName];\n }\n });\n }\n const stats = extractStats(packageFiles);\n logger.info(\n { baseBranch: config.baseBranch, stats },\n `Dependency extraction complete`,\n );\n logger.trace({ config: packageFiles }, 'packageFiles');\n ensureGithubToken(packageFiles);\n return packageFiles;\n}\n\nasync function fetchVulnerabilities(\n config: RenovateConfig,\n packageFiles: Record<string, PackageFile[]>,\n): Promise<void> {\n if (config.osvVulnerabilityAlerts) {\n logger.debug('fetchVulnerabilities() - osvVulnerabilityAlerts=true');\n try {\n const vulnerabilities = await Vulnerabilities.create();\n await vulnerabilities.appendVulnerabilityPackageRules(\n config,\n packageFiles,\n );\n } catch (err) {\n logger.warn({ err }, 'Unable to read vulnerability information');\n }\n }\n}\n\nexport async function lookup(\n config: RenovateConfig,\n packageFiles: Record<string, PackageFile[]>,\n): Promise<ExtractResult> {\n await fetchVulnerabilities(config, packageFiles);\n await fetchUpdates(config, packageFiles);\n const { branches, branchList } = await branchifyUpgrades(\n config,\n packageFiles,\n );\n logger.debug(\n { baseBranch: config.baseBranch, config: packageFiles },\n 'packageFiles with updates',\n );\n sortBranches(branches);\n return { branches, branchList, packageFiles };\n}\n\nexport async function update(\n config: RenovateConfig,\n branches: BranchConfig[],\n): Promise<WriteUpdateResult | undefined> {\n let res: WriteUpdateResult | undefined;\n // istanbul ignore else\n if (config.repoIsOnboarded) {\n res = await writeUpdates(config, branches);\n }\n\n return res;\n}\n"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "renovate",
|
3
3
|
"description": "Automated dependency updates. Flexible so you don't need to be.",
|
4
|
-
"version": "39.
|
4
|
+
"version": "39.78.0",
|
5
5
|
"type": "commonjs",
|
6
6
|
"bin": {
|
7
7
|
"renovate": "dist/renovate.js",
|
@@ -311,20 +311,20 @@
|
|
311
311
|
"@types/url-join": "4.0.3",
|
312
312
|
"@types/validate-npm-package-name": "4.0.2",
|
313
313
|
"@types/xmldoc": "1.1.9",
|
314
|
-
"@typescript-eslint/eslint-plugin": "8.
|
315
|
-
"@typescript-eslint/parser": "8.
|
314
|
+
"@typescript-eslint/eslint-plugin": "8.18.0",
|
315
|
+
"@typescript-eslint/parser": "8.18.0",
|
316
316
|
"aws-sdk-client-mock": "4.1.0",
|
317
317
|
"callsite": "1.0.0",
|
318
318
|
"common-tags": "1.8.2",
|
319
319
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
320
320
|
"emojibase-data": "16.0.2",
|
321
321
|
"eslint": "8.57.1",
|
322
|
-
"eslint-formatter-gha": "1.5.
|
323
|
-
"eslint-import-resolver-typescript": "3.
|
322
|
+
"eslint-formatter-gha": "1.5.2",
|
323
|
+
"eslint-import-resolver-typescript": "3.7.0",
|
324
324
|
"eslint-plugin-import": "2.31.0",
|
325
|
-
"eslint-plugin-jest": "28.
|
325
|
+
"eslint-plugin-jest": "28.9.0",
|
326
326
|
"eslint-plugin-jest-formatting": "3.1.0",
|
327
|
-
"eslint-plugin-promise": "7.1
|
327
|
+
"eslint-plugin-promise": "7.2.1",
|
328
328
|
"eslint-plugin-typescript-enum": "2.1.0",
|
329
329
|
"expect": "29.7.0",
|
330
330
|
"expect-more-jest": "5.5.0",
|